export ETCDCTL_API=3
或者在`/etc/profile`文件中添加環境變量
vi /etc/profile
...
ETCDCTL_API=3
...
source /etc/profile
指定etcd集羣:
HOST_1=10.240.0.17
HOST_2=10.240.0.18
HOST_3=10.240.0.19
ENDPOINTS=$HOST_1:2379,$HOST_2:2379,$HOST_3:2379
etcdctl --endpoints=$ENDPOINTS member list
查詢集羣狀態
etcdctl endpoint status 、etcdctl endpoint health
增:etcdctl --endpoints=$ENDPOINTS put foo "Hello World!"
查:etcdctl --endpoints=$ENDPOINTS get foo
刪:etcdctl --endpoints=$ENDPOINTS del foo