This topic describes how to deploy an etcd cluster by creating a stack in the Resource Orchestration Service (ROS) console.
Background information
etcd is a distributed storage system that uses key-value pairs to store business-critical data. The system implements reliable distributed collaboration by using distributed locks, leader elections, and write barriers.
The Deploy an etcd Cluster in an Existing VPC sample template deploys etcd on CentOS 7 Elastic Compute Service (ECS) instances based on existing resources, such as virtual private clouds (VPCs), vSwitches, and security groups.
After you create a stack by using the template, click the resource ID of the ECS instance where the primary etcd service is deployed on the Resources tab. On the Instances page, click Connect in the Actions column of the instance to log on to the instance.
Step 1: Create a stack
- Log on to the ROS console.
- In the left-side navigation pane, click Solution Center.
- Find the Deploy an etcd Cluster in an Existing VPC template.
- Click Create Stack.
- In the Configure Template Parameters step, configure Stack Name and the parameters that are described in the following table.
Parameter Description Example VSwitch Zone ID The zone ID of the vSwitch in the VPC. Qingdao Zone C Existing VPC Instance ID The ID of the VPC. For more information about how to create and query a VPC, see Create and manage a VPC.
vpc-bp1m6fww66xbntjyc**** VSwitch ID The ID of the vSwitch in the VPC. For more information about how to create and query a vSwitch, see Create and manage a vSwitch.
vsw-bp183p93qs667muql**** Business Security Group ID The ID of the ECS security group. For more information about how to query security groups, see Query security groups.
sg-bp15ed6xe1yxeycg7o**** Instance Type The instance type of the ECS instance. Select a valid instance type. For more information, see Overview of instance families.
ecs.c5.large Image The image ID of the ECS instance. Default value: centos_7_04_64_20G_alibase_201701015.vhd.
For more information, see Image overview.
centos_7_04_64_20G_alibase_201701015.vhd System Disk Type Valid values: - cloud_efficiency: ultra disk
- cloud_ssd: standard SSD
- cloud_essd: enhanced SSD (ESSD)
- cloud: basic disk
- ephemeral_ssd: local SSD
For more information, see Disks.
cloud_efficiency System Disk Space The size of the system disk. Valid values: 40 to 500.
Unit: GB.
40 Number of cluster hosts The number of etcd clusters. Valid values: 3 to 10.
3 Instance Password The password that is used to log on to the ECS instance. Test_12**** - Click Create.
- On the stack management page, click the Stack Information tab to view the stack status. After you create the stack, click the Outputs tab to obtain the value of EtcdMasterServerConnectionAddress. Note You must enter the value of EtcdMasterServerConnectionAddress when you manage services by using the
etcdctl
commands. We recommend that you save the returned value in a safe place for subsequent use. - Click the Resources tab and click the resource ID of the ECS instance in which the primary etcd service is deployed to go to the Instances page. Then, click Connect in the Actions column of the instance to log on to the instance. After you log on to the ECS instance, you can use
etcdctl
commands to manage the cluster. For more information aboutetcdctl
commands, see etcdctl commands.
Step 2: View resources
- Log on to the ROS console.
- In the left-side navigation pane, click Stacks.
- On the Stacks page, click the ID of the stack that you created.
- On the stack management page, click the Resources tab to view the resources. The following table describes the resources in this example.
Resource Quantity Description Specifications ALIYUN::ECS::InstanceGroup 1 Creates an ECS instance to deploy the primary etcd service. A single instance with the following specifications is created: - InstanceType: ecs.c5.large
- SystemDiskCategory: cloud_efficiency
- SystemDiskSize: 40 (Unit: GB)
- AllocatePublicIP: true
ALIYUN::ESS::ScalingGroup 2 Creates two scaling groups to deploy the secondary etcd service. Scaling groups scale computing resources based on the scaling rules that you configure to meet your business requirements.
Two instances with the following specifications are created: - InstanceType: ecs.c5.large
- SystemDiskCategory: cloud_efficiency
- SystemDiskSize: 40 (Unit: GB)
- AllocatePublicIP: true
ALIYUN::RAM::Role 1 Creates a RAM role to issue a Security Token Service (STS) token that is valid within a temporary period. This way, you can grant access permissions in a secure manner. None Note For more information about the resource charges, see the pricing schedule on the official website or the product pricing documentation.