https://etcd.io/
etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster of machines. It gracefully handles leader elections during network partitions and can tolerate machine failure, even in the leader node.
etcd 是一个强一致性的分布式键值仓库,提供了一种可靠的方法来存储分布式系统或机器集群需要访问的数据。可以在网络分区期间优雅地处理领导者选举,并且可以容忍机器故障,甚至在领导者节点中也是如此。
https://etcd.io/docs/v3.5/install/
采用二进制安装方式
tar -zxvf etcd-v3.5.0-linux-amd64.tar.gz
vi /home/sunshine/.bashrc
按G
跳转至文件末尾,并键入如下内容export PATH=$PATH:/home/sunshine/etcd
使得环境变量生效source /home/sunshine/.bashrc
etcd --version
# 后台启动etcd,默认监听127.0.0.1:2379
etcd &
# 写入键值对
etcd put service user
# 根据键获取键值对
etcdctl get service
# 获取某个键对应的值
etcd get name --print-value-only
# 根据键前缀获取键值对
etcdctl get --prefix service
# 删除键值对
etcdctl del service
# 监听键值对
etcdcl watch service
etcd应用场景:https://www.jianshu.com/p/372e76a27cc3