Basic concepts of Alibaba Cloud ECS cloud servers
1. Purchase and use of Alibaba Cloud ECS cloud host products
1. ECS cloud host product introduction
1.1. Introduction to ECS
ECS is a cloud service product (Elastic Compute Service, ECS for short) provided by Alibaba Cloud. It is a simple, efficient, and elastically scalable computing service.
When the running load of the program on the physical server is not enough, the usual method is to increase the server, so adding a server first requires a series of processes such as purchasing hardware, express delivery equipment, installing hardware equipment, deploying the system, deploying applications, and connecting to the cluster. It usually takes 1-2 days to complete these processes. If we use cloud hosts, we can realize automatic perception and automatic expansion of clusters. When we need to increase machines, we can directly purchase them.
1.2. ECS server configuration selection
WEB node: 4c X 16GB
Web cluster nodes are generally 4-core CPU + 16GB memory.
DB node: 4c X 64GB 4c X 32GB
Database nodes are generally 4-core CPU + 64GB memory or 32GB memory, and database nodes mainly look at disks.
K8S node: 8c X 128GB
K8S container nodes have high memory requirements, and the larger the memory, the better.
Disk selection includes high-efficiency cloud disks, SSD cloud disks, and ESSD cloud disks. Different cloud disks have different prices and IOPS.
Among them, the high-efficiency cloud disk has the lowest price. According to market research, the high-efficiency cloud disk is a storage resource pool composed of disks with poor performance, and the IOPS of the high-efficiency cloud disk is also low.
For a disk with the same capacity, the higher the IOPS value, the stronger the read/write rate of the disk, and the ESSD cloud disk is more expensive, but the ESSD cloud disk can choose different IOPS configurations according to the performance level, and the price is also different. Cloud disks are more expensive than other cloud disks.
As a service for data storage, it is recommended to use SSD disks.
Disk failure case:
The MySQL database server we run in the physical machine environment is configured as 4c X 64GB, and the disk is SATA with a read and write rate of 400Mbps. After migrating to the cloud host, the server configuration is 4c X 64GB, the disk is an efficient cloud disk, and the read and write rate is 100Mbps. It can be seen that the configuration of the cloud host and the physical machine are basically the same, but the disk type is different. We chose a high-efficiency cloud disk. When MySQL is running, you will find that the IO_WAIT index of the server is particularly high, which affects the performance of the database. .
The original disk read/write rate of the physical machine is 400Mbps, but after migrating to the cloud host, the read/write rate is 100Mbps, which is a difference of 4 times, which will definitely affect the read/write performance of the disk.
The solution is to replace the high-efficiency cloud disk with an SSD cloud disk to increase the IOPS value of the disk.
dd | hdparm -t /dev/vda1 Use this command to query the read and write speed of the disk
The read and write speed of the disk on our physical machine is more than 600 megabytes, and the disk is SSD.
This is the read and write rate of the high-efficiency cloud disk of the cloud host, and it can be seen that it is only more than 100 megabytes.
2. Use the Alibaba Cloud console
Log in to Alibaba Cloud and click the console in the upper right corner.
It is available in the console to add our commonly used cloud products to the navigation bar by clicking Favorites, which is convenient for us to use.
3. Purchase ECS cloud server
The general steps to purchase ECS cloud server:
1. Set the basic settings of ECS, including the product payment model, location and availability zone, and resource configuration;
2. Create the VPC network and switch equipment in the region where the ECS is located;
3. Set the network and security group of ECS, specify the VPC and switch used by ECS, and the open port number;
4. Set the system configuration of ECS, specify the server password and the name of the instance;
5. Set the grouping configuration of ECS, and put the ECS server into the corresponding resource group for easy query;
6. Confirm the order information.
3.1. Create an ECS cloud service instance
Click the ECS cloud server in the console to enter the management page of the ECS product.
Click Instance--->Create Instance.
3.2. Set the basic configuration of ECS
1) Set the payment mode and regional availability zone of ECS
The payment mode is set to pay-as-you-go.
2) Set the host architecture and resource configuration
The architecture selects x86 computing.
It is classified as shared type. In the shared type, you can find the shared basic host. This machine is relatively cheap. We choose a host with 1 core and 1G configuration.
3) Set the system version and disk configuration
Set the system version of the server here in the image, the operating system we use is CentOS, the version is 7.9.
In the storage, set the disk of the cloud host. We choose a high-efficiency cloud disk with a space of 40GB.
At this point, the basic configuration has been completed. You can see that the price is very cheap. We can click Next to start configuring the network and security group
3.3. Set up ECS network and security group
3.3.1. Create VPC network and switch
After entering the settings of the second network and security group, the first step is to configure the VPC. Alibaba Cloud will assign a VPC network to the region and availability zone we selected by default. If we don’t want to use the default VPC, click Go in the figure Create a console to create a VPC network. When creating a VPC, it will also allow us to create a switch. We can also click on the position of the switch in the figure to go to the console to create and create a switch separately.
1) Click Create VPC
2) Configure the VPC network
The region where the VPC is located is associated with the ECS region by default.
Points to note in IPV4 network segment configuration:
1. The network set up by VPC must be as large as possible, which is conducive to our later expansion. The IPV4 network segment set by VPC network is equivalent to setting a network range, which is used to assign address network segments to switches in different availability zones.
2. Each availability zone has its own switch device. The IPV4 network segment of the current availability zone also needs to be configured in the switch. The network segment set in the switch is the IP network segment address of the ECS server that is finally connected to the switch.
3. If the network segment we configure in the VPC network is very small, such as a 24-bit mask, the 24-bit mask can only modify the fourth IP segment, which is equivalent to only one network segment, and each availability zone The switches must be set to different network segments. At this time, the network segments cannot be allocated to the switches in other availability zones. The network segments set when the VPC is created cannot be modified. Therefore, we must configure the IPV4 network segment of the VPC network. It should be as large as possible, so as to avoid the inability to allocate addresses when the availability zone is increased later and many servers are added.
2) Configure the switch in the availability zone
3) Create a switch for availability zone B
Just now when we created the VPC, we directly created the switch for Availability Zone A. The switch can be created for each Availability Zone. Let’s create the switch for Availability Zone B.
Click Switch--->Create Switch
The VPC is selected as the VPC just created.
Set the name of the switch to SW-Area-B, and select the availability zone where the switch is located as availability zone B.
Finally, set the IPV4 network segment of the switch. The network segment of different switches cannot be the same. Set it to 10.1.2.0/24, and finally click OK.
4) View the created VPC and switch
Click the VPC to see the created VPC, and click the switch to see the created switch
3.3.2. Configure ECS network and security group
1) Set up the ECS network, select the VPC network and switch we created.
2) No public IP is assigned to ECS, the traffic of public IP is very expensive.
3) Set up the security group, open the required ports, 3389 does not belong to the port of Linux, we can not open it.
4) The elastic network card will automatically assign IP for us, and select the switch we created for us.
3.4. Set the system configuration of CES
1) Set the login credentials as a password, we choose to create and then set.
2) Set the name of the ECS instance, which is called Web-01.
3) Add description of ECS.
4) The host name can not be set.
After the configuration is complete, click Next to enter the group configuration.
3.5. Set the group configuration of ECS
The group setting is mainly to set different resource groups for different ECS, which is convenient for us to query the host.
1) Click in the figure to create a resource group and assign a resource group to ECS.
2) Click Resource Group--->Create Resource Group
3) Set the ID and name of the resource group.
4) Select the resource group for ECS, click Next to confirm the order.
3.6. Confirm order information to purchase ECS server
In the configuration list, we can see the configuration we selected, the price is still acceptable, click to create an instance.
The ECS instance is created successfully.
You can view the cloud server we purchased in the instance list of the cloud server ECS in the console. You can see in the figure that the internal network address of ECS is 10.1.1.153. This address is randomly assigned and we cannot control it.
4. Manage ECS cloud server
4.1. Set the password of the ECS server
Click More--->Password/Key--->Reset Instance Password
Fill in the instance password and click Submit.
After resetting the password, we will be asked to restart the server.
4.2. Remotely connect to the ECS server through the Alibaba Cloud console
Click Remote Connection to use WorkBench to remotely connect to the server.
Select the ECS instance to be remote, and enter the server account and password to log in remotely.
At this point, you have connected to the ECS terminal, and you can execute corresponding commands.
4.3. Bind public network IP for ECS to connect to cloud server through Xshell
4.3.1. Create an elastic public IP
1) Search for the elastic public network IP in the console, and enter the product management page.
2) Click Create Elastic Public IP
3) Configure elastic public network IP
Select Pay-As-You-Go for Product Type, and select the region and region where the ECS is located for Region and Region. The peak bandwidth will be fully charged directly, and select Pay-as-you-go traffic type.
4) Confirm the order information and click to activate immediately
After the purchase is successful, you can see it in the elastic public network IP of the console.
4.3.2. Bind public IP to ESC instance
Click More--->Network and Security Group--->Bind Elastic IP
Choose a purchased elastic public IP.
After the elastic IP binding is complete, you can see that an elastic address has been added to the ECS IP address, and the status of the elastic public network IP is already assigned.
4.3.3. Use xshell to connect to ECS cloud host
4.4. Connect to the server via VNC
VNC is equivalent to the operation interface in our VM virtual machine, which is used to debug the server. When the server has a problem, it can be operated here.
1) First set the VNC password
Restart the ECS instance
ECS restart is very slow, you can also enter reboot in the terminal to restart.
Connect to ECS via VNC
Select VNC login as the remote connection method.
Enter the VNC password.
4.5. Prohibit ping public network IP
Find the ECS management page ---> security group ---> find the security group list corresponding to ECS
Click Add Manually, the authorization policy is Deny, set the priority, the protocol type is all ICMP, the setting range is -1/-1, and the authorization object is 0.0.0.0/0, which means that all hosts are prohibited from using the ICMP protocol to request hosts.
Protocol added successfully.
It is no longer possible to ping the public network address to protect the security of the intranet.
5. ECS cloud server disk expansion
In actual work, ECS cloud service needs a system disk and a data disk. The ECS server we just bought does not have a data disk. We can buy a cloud disk and mount it to the ECS server. When the data disk space of the ECS server When it is not enough, you can flexibly expand the disk capacity.
5.1. Purchase a cloud disk
1) Find the cloud disk on the ECS management interface ---> create a cloud disk
2) Set the basic information and storage space of the cloud disk
3) Set the name information of the cloud disk
4) Confirm creation
5.2. Mount the cloud disk to ECS
1) Find the purchased cloud disk, click More--->Mount.
2) Select the corresponding ECS instance and execute the mount.
3) Successfully mounted to ECS.
5.3. Initialize a new cloud disk and mount it
5.4. Expand the capacity of the existing cloud disk
1) Click More--->Cloud Disk Expansion.
2) Check Online Capacity Expansion, set the expanded capacity to 30GB, and finally check the Expansion Notes to confirm the capacity expansion.
3) It can be seen that the cloud disk and the expansion are successful, and the capacity of the cloud disk mounted on the ECS is already the expanded space, but the partition has not changed.
5.5. Refresh the expanded cloud disk capacity in ECS
Steps: First unmount the cloud disk, then delete the partition of the existing cloud disk, re-partition the cloud disk, and finally refresh the disk.
Deleting a partition will not clear the data in the disk, the data is stored in the track rather than the partition.
A detailed explanation of Hadoop core architecture HDFS
Knowledge Base Team
What Does IOT Mean
Knowledge Base Team
6 Optional Technologies for Data Storage
Knowledge Base Team
What Is Blockchain Technology
Knowledge Base Team
Explore More Special Offers
Short Message Service(SMS) & Mail Service
50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00