#存数据 etcdctl put keyName "I am value" #获取数据 etcdctl get keyName #kk安装的etcd环境变量文件 cat /etc/etcd.env #临时设置别名,简化命令,endpoints要设置所有集群ip才能检测健康状态,不然只检查填写的ip的 alias etcdctl='etcdctl --endpoints=https://192.168.14.16:2379,https://192.168.14.17:2379,https://192.168.14.18:2379 --cacert=/etc/ssl/etcd/ssl/ca.pem --cert=/etc/ssl/etcd/ssl/admin-node1.pem --key=/etc/ssl/etcd/ssl/admin-node1-key.pem' #查看成员 etcdctl member list #移除成员 /usr/local/bin/etcdctl --endpoints=https://192.168.14.16:2379,https://192.168.14.17:2379 member list /usr/local/bin/etcdctl --endpoints=https://192.168.14.16:2379,https://192.168.14.17:2379 member remove cab52e8fded2eefe #查看集群健康状态 etcdctl endpoint health #kk查看集群状态命令 export ETCDCTL_API=2; export ETCDCTL_CERT_FILE='/etc/ssl/etcd/ssl/admin-node1.pem'; export ETCDCTL_KEY_FILE='/etc/ssl/etcd/ssl/admin-node1-key.pem'; export ETCDCTL_CA_FILE='/etc/ssl/etcd/ssl/ca.pem'; /usr/local/bin/etcdctl --endpoints=https://192.168.14.16:2379,https://192.168.14.17:2379 cluster-health