You can add an existing ECS instance in the following ways:
- Add ECS instances automatically: The image and system disk of the ECS instance are reset by using this method. You can add one or more ECS instances to the cluster at a time.
- Add the ECS instance manually: Manually add the ECS instance by running scripts on the ECS instance. You can only add one ECS instance to the cluster at a time.
Prerequisites
If you have not created a cluster before, create a cluster first.
Instructions
- The ECS instance to be added must be in the same region and use the same network type (Virtual Private Cloud (VPC)) as the cluster.
- When adding an existing ECS instance, make sure that your ECS instance has an Elastic IP (EIP) for the network type VPC, or the corresponding VPC has configured the NAT gateway. In short, make sure the corresponding node can access public network normally. Otherwise, the ECS instance fails to be added.
- The ECS instance to be added must be under the same account as the cluster.
- If you select to manually add the ECS instance, note that:
- If you have already installed Docker on your ECS instance, the ECS instance may fail
to be added. We recommend that you uninstall Docker and remove the Docker folders
before adding the ECS instance by running the following command:
Ubuntu:
apt-get remove -y docker-engine
,rm -fr /etc/docker/ /var/lib/docker /etc/default/docker
CentOS:
yum remove -y docker-engine
,rm -fr /etc/docker /var/lib/docker
- Container Service nodes have special requirements for the operating system of the ECS instance. We recommend that you use Ubuntu 14.04/16.04 or CentOS 7 as the operating system. We have strictly tested the stability and compatibility of these operating systems.
- If you have already installed Docker on your ECS instance, the ECS instance may fail
to be added. We recommend that you uninstall Docker and remove the Docker folders
before adding the ECS instance by running the following command:
Procedure
- Log on to the Container Service console.
- Click Swarm > Clusters in the left-side navigation pane.
- Click More at the right of the cluster that you want to add ECS instances and then select Add Existing Instances from the drop-down list.
- Add ECS instances.
The ECS instances displayed are filtered and synchronized from your ECS instance list according to the region and network type defined by the cluster.
Add the ECS instances in the following ways:
- Add ECS instances automatically.
Note As this method will reset the image and system disk of the ECS instance, proceed with caution. Create a snapshot to back up your data before adding the ECS instance. For information about how to create a snapshot, see Create a snapshot for a disk.
- Select the ECS instances you want to add to the cluster and click Next Step.
You can add one or more ECS instances at a time.
- Configure the instance information. Click Next Step and then click Confirm in the confirmation dialog box.
- Click Finish.
- Select the ECS instances you want to add to the cluster and click Next Step.
-
Manually add the ECS instance by running scripts on the ECS instance.
- Select Manually Add. Select an ECS instance, and then click Next Step.
You can only add one ECS instance at a time.
- Confirm the instance information and click Next Step.
- The scripts unique to this ECS instance are displayed. Click log on to the ECS instance xxxxxx.
- The VNC connection password is displayed in the dialog box. Copy the password and
click Close.
- In the dialog box, enter the VNC connection password and click OK.
- Enter the logon account (root) and password of the ECS instance, and press Enter to
log on to the ECS instance.
- Click Input Commands. Paste the preceding scripts into the dialog box, click OK and press Enter.
The system runs the scripts. Wait until the scripts are successfully run. A success message is displayed. The ECS instance is successfully added.
- Select Manually Add. Select an ECS instance, and then click Next Step.
- Add ECS instances automatically.
Related operation
