版本
etcd Version: 3.5.1
单机版本安装
下载安装包解压到服务器
https://github.com/etcd-io/etcd/releases
解压到 /soyuan/k8s/etcd
命令移动到:mv /soyuan/k8s/etcd/etcd-v3.5.1-linux-amd64/etcd* /usr/local/bin/
安装到系统服务
vi /usr/lib/systemd/system/etcd.service
1 2 3 4 5 6 7 8 9 10 11 12 13
| [Unit] Description=Etcd service After=network.target
[Service] Type=simple WorkingDirectory=/soyuan/k8s/etcd EnvironmentFile=-/soyuan/k8s/etcd/etcd.conf ExecStart=/usr/local/bin/etcd
[Install] WantedBy=multi-user.target
|
增加环境变量配置文件
vi etcd.conf
1 2 3 4
| ETCD_NAME=default ETCD_DATA_DIR="/soyuan/k8s/etcd/default.etcd" ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379" ETCD_ADVERTISE_CLIENT_URLS="http://0.0.0.0:2379"
|
启动服务
1 2 3 4 5 6 7 8 9
| # 启动服务 $ systemctl daemon-reload $ systemctl start etcd
# 添加到开机运行 $ systemctl enable etcd
# 查看运行状态 $ etcdctl endpoint health
|