ETCD单机部署
温馨提醒
Docker 方式部署
创建目录
创建 etcd 配置文件
vim /etc/etcd/etcd.conf启动容器
1docker run -d --name etcd -p 2379:2379 -v /data/etcd:/data -v /etc/etcd:/conf bitnami/etcd:latest etcd --config-file /conf/etcd.conf验证
1docker exec etcd sh -c "etcdctl endpoint status --cluster -w table"
二进制方式部署
下载解压文件
添加环境变量
vim /etc/profile.d/etcd.sh1export PATH=$PATH:/usr/local/etcd-v3.5.14-linux-amd64.tar.gzsource /etc/profile.d/etcd.sh
验证
创建配置文件
vim /etc/etcd/etcd.conf创建启动脚本
vim /usr/lib/systemd/system/etcd.service1 2 3 4 5 6 7 8 9 10 11 12 13 14 15[Unit] Description=Etcd Server After=network.target After=network-online.target Wants=network-online.target [Service] Type=notify EnvironmentFile=/etc/etcd/etcd.conf ExecStart=/usr/local/etcd-v3.5.14-linux-amd64/etcd --config-file=/etc/etcd/etcd.conf Restart=on-failure LimitNOFILE=65536 [Install] WantedBy=multi-user.target启动服务并验证