All Products
Search
Document Center

Resource Orchestration Service:Deploy etcd in a cluster

Last Updated:Jun 03, 2025

This topic describes how to deploy etcd in a 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 critical data. etcd implements reliable distributed collaboration by using distributed locks, leader election, and write barriers.

You can use the Deploys an etcd cluster (existing VPC) sample template to deploy etcd on multiple Elastic Compute Service (ECS) instances based on existing resources, such as a virtual private cloud (VPC), vSwitch, and security group. The ECS instances run CenOS 7.

After you create a stack by using the sample template, you can click the ID of the ECS instance on which the etcd primary service is deployed on the Resources tab to go to the Instances page. Then, you can click Connect in the Actions column of the instance to log on to the ECS instance.

Step 1: Create a stack

  1. Log on to the ROS console.

  2. In the left-side navigation pane, choose Templates > Public Templates.

  3. Search for the Deploys an etcd cluster (existing VPC) sample template.

  4. Click Create Stack.

  5. In the Configure Parameters step, configure the Stack Name parameter and the following parameters.

    Parameter

    Description

    Example

    VSwitch Availability Zone

    The zone ID of the vSwitch that resides 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****

    Existing VSwitch ID

    The ID of the vSwitch that resides in the VPC.

    For more information about how to create and query a vSwitch, see Create and manage vSwitches.

    vsw-bp183p93qs667muql****

    Business Security Group ID

    The ID of the ECS security group.

    For more information about how to query the ID of a security group, see Search for security groups.

    sg-bp15ed6xe1yxeycg7o****

    Instance Type

    The instance type of the ECS instances.

    Select a valid instance type. For more information, see Overview of instance families.

    ecs.c5.large

    Image

    The image ID of the ECS instances.

    Default value: centos_7_04_64_20G_alibase_201701015.vhd.

    For more information, see Overview.

    centos_7_04_64_20G_alibase_201701015.vhd

    System Disk Type

    The category of the system disk. Valid values:

    • cloud_efficiency: ultra disk.

    • cloud_ssd: standard SSD.

    • cloud_essd: Enterprise 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 ECS instances in the cluster in which you want to deploy etcd.

    Valid values: 3 to 10.

    3

    Instance Password

    The password of the ECS instances.

    Test_12****

  6. Click Next:Check and Confirm. Then, click Create.

  7. On the Stack Information tab, view the stack status. Wait until the stack is created. Then, click the Outputs tab to obtain the value of EtcdMasterServerConnectionAddress.

    Note

    The value of EtcdMasterServerConnectionAddress is required when you manage services by using etcdctl commands. We recommend that you record the value in a safe location.

  8. Click the Resources tab and click the ID of the ECS instance on which the etcd primary service is deployed to go to the Instances page. Then, click Connect in the Actions column of the instance to log on to the ECS instance.

    After you log on to the ECS instance, you can run etcdctl commands to manage services of the cluster. For more information about etcdctl commands, see Demo.

Step 2: View resources

  1. In the left-side navigation pane, click Stacks.

  2. On the Stacks page, click the ID of the desired stack.

  3. Click the Resources tab to view information about the resources in the stack.

    The following table describes the resources in this example.

    Resource

    Quantity

    Resource description

    Specification description

    ALIYUN::ECS::InstanceGroup

    1

    Creates an ECS instance to deploy the etcd primary service.

    • An ECS instance that has the following specifications is created:

    • Instance type: ecs.c5.large.

    • Disk category: ultra disk.

    • System disk size: 40 GB.

    • Public IP address: A public IP address is allocated.

    ALIYUN::ESS::ScalingGroup

    2

    Creates two scaling groups to deploy etcd secondary services.

    Scaling groups automatically scale elastic computing resources based on the scaling rules that you configure to meet your business requirements.

    • Two ECS instances are created. Each ECS instance has the following specifications:

    • Instance type: ecs.c5.large.

    • Disk category: ultra disk.

    • System disk size: 40 GB.

    • Public IP address: A public IP address is allocated.

    ALIYUN::RAM::Role

    1

    Creates a Resource Access Management (RAM) role to issue a Security Token Service (STS) token that is valid within a short period of time. This way, you can grant access permissions in a secure manner.

    None.

    Note

    For more information about the pricing details of resources, go to the relevant console or refer to the pricing documentation of each resource.