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 mission-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 a stack is created 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 corresponding to the instance to log on to the instance.

Step 1: Create a stack

  1. Log on to the ROS console.
  2. In the left-side navigation pane, click Solution Center.
  3. Find the Deploy an etcd Cluster in an Existing VPC template.
  4. Click Create Stack.
  5. In the Configure Template Parameters step, set Stack Name and the following parameters.
    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 Work with VPCs.

    vpc-bp1m6fww66xbntjyc****
    VSwitch ID The ID of the vSwitch in the VPC.

    For more information about how to create and query a vSwitch, see Work with vSwitches.

    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 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 The system disk category of the ECS instance. Valid values:
    • cloud_efficiency: ultra disk
    • cloud_ssd: standard SSD
    • cloud_essd: enhanced SSD (ESSD)
    • cloud: basic disk
    • ephemeral_ssd: local SSD
    cloud_efficiency
    System Disk Space The system disk size of the ECS instance.

    Valid values: 40 to 500.

    Unit: GB.

    40
    Number of cluster hosts The number of hosts in the etcd cluster.

    Valid values: 3 to 10.

    3
    Instance Password The password that is used to log on to the ECS instance. Test_12****
  6. Click Create.
  7. On the stack management page, click the Stack Information tab to view the stack status. After the stack is created, click the Outputs tab to obtain the value of EtcdServerConnectionAddress.
    Note You are required to enter the value when you manage services by using etcdctl commands. We recommend that you record the returned value in advance in a safe location.
  8. Click the Resources tab, and click the resource ID of the ECS instance where the primary etcd service is deployed to go to the Instances page. Then, click Connect in the Actions column corresponding to the instance to log on to the instance.
    After you log on the ECS instance, you can use etcdctl commands to manage the cluster. For more information about etcdctl commands, see etcdctl commands.

Step 2: View resources

  1. Log on to the ROS console.
  2. In the left-side navigation pane, click Stacks.
  3. On the Stacks page, click the ID of the stack that you created.
  4. On the stack management page, click the Resources tab to view resources.
    The following table describes the resources in this example.
    Resource Quantity Description Specifications
    ALIYUN::ECS::Instance 1 Create an ECS instance to deploy the primary etcd service.
    • A single instance of 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 set to meet your business requirements.

    • Two instances of 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 is a more secure method to grant access permissions. None