开发者

win10上安装nginx的方法步骤

开发者 https://www.devze.com 2020-01-10 01:26 出处:网络 作者: 不死的鱼
这篇文章主要介绍了win10上安装nginx的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

五、安装配置etcd (三主节点)

5.1:安装etcd(01、02、03节点)

yum install etcd -y

mkdir -p /var/lib/etcd

node01的etcd.service

cat <<EOF >/etc/systemd/system/etcd.service

[Unit]

Description=Etcd Server

After=network.target

After=network-online.target

Wants=network-online.target

Documentation=https://github.com/coreos

[Service]

Type=notify

WorkingDirectory=/var/lib/etcd/

ExecStart=/usr/bin/etcd \

--name node01 \

--cert-file=/etc/etcd/ssl/etcd.pem \

--key-file=/etc/etcd/ssl/etcd-key.pem \

--peer-cert-file=/etc/etcd/ssl/etcd.pem \

--peer-key-file=/etc/etcd/ssl/etcd-key.pem \

--trusted-ca-file=/etc/etcd/ssl/ca.pem \

--peer-trusted-ca-file=/etc/etcd/ssl/ca.pem \

--initial-advertise-peer-urls https://10.8.1.101:2380 \

--listen-peer-urls https://10.8.1.101:2380 \

--listen-client-urls https://10.8.1.101:2379,http://127.0.0.1:2379 \

--advertise-client-urls https://10.8.1.101:2379 \

--initial-cluster-token etcd-cluster-0 \

--initial-cluster node01=https://10.8.1.101:2380,node02=https://10.8.1.102:2380,node03=https://10.8.1.103:2380 \

--initial-cluster-state new \

--data-dir=/var/lib/etcd

Restart=on-failure

RestartSec=5

LimitNOFILE=65536

[Install]

WantedBy=multi-user.target

EOF

node02的etcd.service

cat <<EOF >/etc/systemd/system/etcd.service

[Unit]

Description=Etcd Server

After=network.target

After=network-online.target

Wants=network-online.target

Documentation=https://github.com/coreos

[Service]

Type=notify

WorkingDirectory=/var/lib/etcd/

ExecStart=/usr/bin/etcd \

--name node02 \

--cert-file=/etc/etcd/ssl/etcd.pem \

--key-file=/etc/etcd/ssl/etcd-key.pem \

--peer-cert-file=/etc/etcd/ssl/etcd.pem \

--peer-key-file=/etc/etcd/ssl/etcd-key.pem \

--trusted-ca-file=/etc/etcd/ssl/ca.pem \

--peer-trusted-ca-file=/etc/etcd/ssl/ca.pem \

--initial-advertise-peer-urls https://10.8.1.102:2380 \

--listen-peer-urls https://10.8.1.102:2380 \

--listen-client-urls https://10.8.1.102:2379,http://127.0.0.1:2379 \

--advertise-client-urls https://10.8.1.102:2379 \

--initial-cluster-token etcd-cluster-0 \

--initial-cluster node01=https://10.8.1.101:2380,node02=https://10.8.1.102:2380,node03=https://10.8.1.103:2380 \

--initial-cluster-state new \

--data-dir=/var/lib/etcd

Restart=on-failure

RestartSec=5

LimitNOFILE=65536

[Install]

WantedBy=multi-user.target

EOF

node03的etcd.service

cat <<EOF >/etc/systemd/system/etcd.service

[Unit]

Description=Etcd Server

After=network.target

After=network-online.target

Wants=network-online.target

Documentation=https://github.com/coreos

[Service]

Type=notify

WorkingDirectory=/var/lib/etcd/

ExecStart=/usr/bin/etcd \

--name node03 \

--cert-file=/etc/etcd/ssl/etcd.pem \

--key-file=/etc/etcd/ssl/etcd-key.pem \

--peer-cert-file=/etc/etcd/ssl/etcd.pem \

--peer-key-file=/etc/etcd/ssl/etcd-key.pem \

--trusted-ca-file=/etc/etcd/ssl/ca.pem \

--peer-trusted-ca-file=/etc/etcd/ssl/ca.pem \

--initial-advertise-peer-urls https://10.8.1.103:2380 \

--listen-peer-urls https://10.8.1.103:2380 \

--listen-client-urls https://10.8.1.103:2379,http://127.0.0.1:2379 \

--advertise-client-urls https://10.8.1.103:2379 \

--initial-cluster-token etcd-cluster-0 \

--initial-cluster node01=https://10.8.1.101:2380,node02=https://10.8.1.102:2380,node03=https://10.8.1.103:2380 \

--initial-cluster-state new \

--data-dir=/var/lib/etcd

Restart=on-failure

RestartSec=5

LimitNOFILE=65536

[Install]

WantedBy=multi-user.target

EOF

5.2:添加自启动(etc集群最少2个节点才能启动,启动报错看mesages日志)

#mv etcd.service /usr/lib/systemd/system/ 不用执行?

systemctl daemon-reload

systemctl enable etcd

systemctl start etcd

systemctl status etcd

5.3:在三个etcd节点执行一下命令检查

etcdctl --endpoints=https://10.8.1.101:2379,https://10.8.1.102:2379,https://10.8.1.103:2379 \

--ca-file=/etc/etcd/ssl/ca.pem \

--cert-file=/etc/etcd/ssl/etcd.pem \

--key-file=/etc/etcd/ssl/etcd-key.pem cluster-health

win10上安装nginx的方法步骤

提示:键盘也能翻页,试试"← →"键
0

精彩评论

暂无评论...
验证码 换一张
取 消