1、机器信息
主机名称 | IP地址 | 操作系统 | 组件 |
---|---|---|---|
etcd1 | 192.168.81.17 | Red Hat 7.6 | etcd、cfssl |
etcd2 | 192.168.81.18 | Red Hat 7.6 | etcd |
etcd3 | 192.168.81.19 | Red Hat 7.6 | etcd |
2、安装cfssl工具集
# 地址 https://github.com/cloudflare/cfssl
# cfssl_1.5.0_linux_amd64 /cfssljson_1.5.0_linux_amd64/cfssl-certinfo_1.5.0_linux_amd64
[root@localhost ~]# rename _1.5.0_linux_amd64 '' cfssl* # 修改名字
[root@localhost ~]# ls
anaconda-ks.cfg cfssl-certinfo jdk-8u251-linux-x64.rpm original-ks.cfg
cfssl cfssljson ks-post.log
[root@localhost ~]# chmod +x cfssl* # 开放可执行权限
[root@localhost ~]# mv cfssl* /usr/local/bin # 用户可执行程序默认位置
3、安装ETCD
# 地址 https://github.com/etcd-io/etcd
[root@localhost ~]# tar -xvf etcd-v3.4.14-linux-amd64.tar.gz
[root@localhost ~]# mv etcd-v3.4.14-linux-amd64 etcd-v3.4.14
[root@localhost etcd-v3.4.14]# ls
Documentation etcd etcdctl README-etcdctl.md README.md READMEv2-etcdctl.md
[root@localhost etcd-v3.4.14]# mkdir -p /opt/etcd/{cfg,ssl,bin}
[root@localhost etcd-v3.4.14]# cp etcd etcdctl /opt/etcd/bin/
4、证书生成
[root@localhost ~]# cd /opt/etcd/ssl
# 创建(ca-config.json、ca-csr.json)ca证书配置文件
[root@localhost ssl]# vim ca-config.json
{
"signing": {
"default": {
"expiry": "87600h"
},
"profiles": {
"etcd": {
"expiry": "87600h",
"usages": [
"signing",
"key encipherment",