Preparing the Environment
Before deploying the game application, prepare the hardware and HUAWEI CLOUD environment.
Hardware Environment
Prepare a Windows PC with a graphics card and at least 20 GB disk space for running the game client.
Game Application Images
As shown in Figure 2, this game application consists of three components: wow-auth login authentication system, wow-world game server, and MySQL database.
CCE supports deployment of the MySQL database with just a few clicks, so you do not need to prepare the image of the MySQL database. Instead, prepare the images of the wow-auth login authentication system and wow-world game server.
In this tutorial, the images of the two components have been created, so you can directly download them. For details on how to create an image, see the related descriptions in Containerizing an Enterprise Application (ERP).
- Buy a HUAWEI CLOUD ECS for downloading and uploading images.
- Log in to the management console, and set the region to CN North-Beijing4 in the upper left corner.
- In the service list, choose Computing > Elastic Cloud Server, and click Buy ECS in the upper right corner.
- Set the parameters listed in Table 1 on the displayed Buy ECS page. For the other parameters, retain their default values.
Table 1 Buying ECS Parameter
Description
Billing Mode
To save costs, you are advised to select Pay-per-use. You can clear the resources after deploying the game application.
Image
For a public image, you are advised to select Ubuntu 16.04 server 64bit (40 GB), which is the same as the OS used for compiling games.
EIP
Create an EIP.
Login Mode
Set a password with high security level.
ECS Name
You can use the ECS name that is automatically generated. In this example, the ECS name is changed to ecs-test.
- After the configuration, click Buy Now. On the page displayed, confirm your order and click Submit.
- After the ECS is created, you can view it in the ECS list and its status is Running.
- Click
next to the EIP in the IP Address column to obtain the EIP. Figure 1 Obtaining the elastic IP address
- Use a remote login tool, such as Xshell, to log in to the ECS.
ssh root@elastic IP address bound to the ECS
- Run the following command to install Docker:
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
It takes about five minutes to install Docker.
- Log in to the Software Repository for Container (SWR) console. In the navigation pane, choose My Image and click Upload Through Docker Client. In step 2, click Generate a temporary Docker login command. Then, copy this command and run it on the node with Docker installed. Figure 2 Generating a temporary Docker login command
The command is successfully executed if the following information is displayed:Login Succeeded
- Pull the prepared four images, including two images for the wow-auth authentication system (versions 5.0 and 5.1) and another two images for the wow-world game server (versions 5.0 and 5.1). Two versions of images are prepared to demonstrate subsequent upgrade operations. Run the following commands to pull images:
It takes about 5 to 10 minutes to pull the images.
docker pull swr.cn-north-1.myhuaweicloud.com/wow/wow:wowauth-5.0
docker pull swr.cn-north-1.myhuaweicloud.com/wow/wow:wowworld-5.0-withmap
docker pull swr.cn-north-1.myhuaweicloud.com/wow/wow:wowauth-5.1
docker pull swr.cn-north-1.myhuaweicloud.com/wow/wow:wowworld-5.1-withmap
- Run the following command to view the images:
docker images
- Run the following command to upload the wowauth-5.0 image to SWR:
docker tag [Image name:Tag] swr.cn-north-4.myhuaweicloud.com/[Organization name]/[Image name:Tag]
Example:
- In the example command, gametest indicates the organization name, which must be globally unique. If an organization has been created on SWR, you are advised to use the name of the existing organization.
- cn-north-4 in swr.cn-north-4.myhuaweicloud.com indicates the region where the ECS for uploading images is located.
docker tag swr.cn-north-1.myhuaweicloud.com/wow/wow:wowauth-5.0 swr.cn-north-4.myhuaweicloud.com/gametest/wow:wowauth-5.0
docker push swr.cn-north-4.myhuaweicloud.com/gametest/wow:wowauth-5.0
Upload the wowauth-5.1, wowworld-5.0-withmap, and wowworld-5.1-withmap images in the same way.
- On the SWR console, choose My Images in the navigation pane, and click wow in the image list. Then, you can view the four image versions on the page that is displayed. Figure 3 My Images
Last Article: Analyzing the Game Application
Next Article: Deploying the Game Application
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.