Download and Installation
从官方网站下载pre build package
解开压缩包
Run
1 | ./etcd |
说明
默认的端口:
2379 For client request
2380 For peer communicate
组建多机cluster
需要解决的主要问题是机器发现(Discovery)
Static
在启动参数里指定所有的机器
For example:
cluster name:
etcd_cluster_1
nodes:
yhxa5 9.111.255.120
yhvm1 9.111.255.51
1 | ./etcd --name yhxa5 --initial-advertise-peer-urls http://9.111.255.120:2380 --listen-peer-urls http://9.111.255.120:2380 --listen-client-urls http://9.111.255.120:2379,http://127.0.0.1:2379 --advertise-client-urls http://9.111.255.120:2379 --initial-cluster-token etcd-cluster-1 --initial-cluster yhxa5=http://9.111.255.120:2380,yhvm1=http://9.111.255.51:2380 --initial-cluster-state new |