Deploy an etcd cluster

更新时间:
复制 MD 格式

Deploy an etcd cluster on Elastic Compute Service (ECS) instances by creating a Resource Orchestration Service (ROS) stack from a template.

Background information

etcd is a distributed key-value store that uses distributed locks, leader election, and write barriers for reliable distributed coordination.

The etcd cluster for an existing VPC template deploys etcd on CentOS 7 using your existing virtual private cloud (VPC), vSwitch, and security group.

After the stack is created, go to the Resources tab, click the resource ID of the etcd server, and then click Remote Connection to log on to the server. Log on to a Linux instance using Workbench.

Step 1: Create a stack

  1. Log in to the ROS console.

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

  3. Find the etcd cluster for an existing VPC template.

  4. Click Create Stack.

  5. On the Configure Parameters page, enter a Stack Name and set the following parameters.

    Parameter

    Description

    Example

    vSwitch Zone

    The zone ID of the vSwitch in the VPC.

    China North 1 Zone C

    Existing VPC Instance ID

    The ID of the VPC-connected instance.

    For more information about how to create and query VPC-connected instances, 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 manage vSwitches, 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 security group IDs, see Query security groups.

    sg-bp15ed6xe1yxeycg7o****

    Instance specification

    The ECS instance type.

    Select a valid type from Instance families.

    ecs.c5.large

    Image

    The ECS instance image ID.

    Default: centos_7_04_64_20G_alibase_201701015.vhd.

    For more information, see Image overview.

    centos_7_04_64_20G_alibase_201701015.vhd

    System Disk Category

    The system disk type. Valid values:

    • cloud_efficiency: ultra disk.

    • cloud_ssd: Standard SSD.

    • cloud_essd: enhanced SSD (ESSD).

    • cloud: basic cloud disk.

    • ephemeral_ssd: local SSD.

    For more information, see Disk overview.

    cloud_efficiency

    System Disk Size

    The system disk size.

    Valid values: 40 to 500.

    Unit: GB.

    40

    Number of Cluster Hosts

    The number of etcd cluster nodes.

    Valid values: 3 to 10.

    3

    Instance Password

    The logon password for the ECS instance.

    Test_12****

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

  7. On the Stack Information tab, check the stack status. After the stack is created, click the Output tab to obtain the EtcdMasterServerConnectionAddress.

    Note

    The EtcdMasterServerConnectionAddress is required to manage the service with etcdctl. Record this address for later use.

  8. Click the Resources tab, click the resource ID of the etcd service to go to the instance page, and then click Remote Connection to log on to the etcd server.

    After you log on to the etcd server, use etcdctl to manage the cluster. For etcdctl usage, see etcdctl command.

Step 2: View resources

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

  2. On the Stacks page, click the target stack name.

  3. Click the Resources tab to view resource information.

    The following table describes the resources created in this example.

    Resource

    Quantity

    Resource description

    Specification description

    ALIYUN::ECS::InstanceGroup

    1

    Creates an ECS instance for the etcd Master service.

    • Quantity: 1.

    • Instance type: ecs.c5.large.

    • Disk category: ultra disk.

    • System disk size: 40 GB.

    • Public IP address assigned: Yes.

    ALIYUN::ESS::ScalingGroup

    2

    Creates two Auto Scaling groups for the etcd Slave service.

    Auto Scaling groups automatically adjust computing resources based on your scaling rules.

    • Quantity: 2.

    • Instance type: ecs.c5.large.

    • Disk category: ultra disk.

    • System disk size: 40 GB.

    • Public IP address assigned: Yes.

    ALIYUN::RAM::Role

    1

    Creates a RAM role to issue STS tokens for secure access control.

    None

    Note

    For pricing details, see the pricing documentation for each product.