ETCD three ways to deploy a cluster

Source: Internet
Author: User
Tags etcd

    1. Static start

Requires three physical machines or virtual machines

$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380    --listen-peer-urls http://10.0.1.10:2380   --listen-client-urls http:// 10.0.1.10:2379,http://127.0.0.1:2379   --advertise-client-urls http://10.0.1.10:2379    --initial-cluster-token etcd-cluster-1   --initial-cluster infra0=http:// 10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380   -- Initial-cluster-state new$ etcd --name infra1 --initial-advertise-peer-urls http ://10.0.1.11:2380   --listen-peer-urls http://10.0.1.11:2380   -- Listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379   --advertise-client-urls  http://10.0.1.11:2379   --initial-cluster-token etcd-cluster-1   -- Initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380   --initial-cluster-state new$  etcd --name infra2 --initial-advertise-peer-urls http://10.0.1.12:2380    --listen-peer-urls http://10.0.1.12:2380   --listen-client-urls http:// 10.0.1.12:2379,http://127.0.0.1:2379   --advertise-client-urls http://10.0.1.12:2379    --initial-cluster-token etcd-cluster-1   --initial-cluster infra0=http:// 10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380   -- Initial-cluster-state new


2. ETCD Service Discovery

Executes on any device, and if no size is added, the default is 3$ curl-w "\ n" https://discovery.etcd.io/new?size=3
$ etcd --name infra0 --initial-advertise-peer-urls http://10.0.1.10:2380    --listen-peer-urls http://10.0.1.10:2380   --listen-client-urls http:// 10.0.1.10:2379,http://127.0.0.1:2379   --advertise-client-urls http://10.0.1.10:2379    --discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de$ etcd  --name infra1 --initial-advertise-peer-urls http://10.0.1.11:2380   -- listen-peer-urls http://10.0.1.11:2380   --listen-client-urls http://10.0.1.11:2379, http://127.0.0.1:2379   --advertise-client-urls http://10.0.1.11:2379   -- discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de$ etcd --name  infra2 --initial-advertise-peer-urls http://10.0.1.12:2380   --listen-peer-urls  Http://10.0.1.12:2380   --listen-client-urls http://10.0.1.12:2379,http://127.0.0.1:2379   -- advertise-client-urls http://10.0.1.12:2379   --discovery https://discovery.etcd.io/ 3e86b59982e49066c5d813af1c2e2579cbf573de

3. DNS Service discovery

This method has not been tried, so do not post it, interested can go to the official website to view!


Note: The IP address needs to be modified according to its own situation, 127.0.0.1:2379 does not need to be modified, otherwise it will error: Bind:address already in use


This article is from the "Linux related" blog, so be sure to keep this source http://diadia.blog.51cto.com/5440926/1766678

ETCD three ways to deploy a cluster

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.