真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

etcd集群的部署-創(chuàng)新互聯(lián)

node1  192.168.56.173 node2 192.168.56.174 node3 192.168.56.200 node* 為主機(jī)名稱(chēng) [root@node1 ~]# cat /etc/redhat-release  CentOS Linux release 7.2.1511 (Core)  [root@node1 ~]#

目前成都創(chuàng)新互聯(lián)公司已為數(shù)千家的企業(yè)提供了網(wǎng)站建設(shè)、域名、雅安服務(wù)器托管、網(wǎng)站運(yùn)營(yíng)、企業(yè)網(wǎng)站設(shè)計(jì)、寬甸網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶(hù)導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶(hù)和合作伙伴齊心協(xié)力一起成長(zhǎng),共同發(fā)展。
https://github.com/coreos/etcd/releases/download/v3.0.15/etcd-v3.0.15-linux-amd64.tar.gz 
tar xf  etcd-v3.0.15-linux-amd64.tar.gz 
cd etcd-v3.0.15-linux-amd64 
cp etcd  /usr/bin/
cp etcdctl /usr/bin/

192.168.56.173(node1)

cat /etc/systemd/system/etcd2.service

[Unit] Description=etcd2.service [Service] Type=notify TimeoutStartSec=0 Restart=always ExecStartPre=-/usr/bin/mkdir -p /data/etcd2 ExecStart=/usr/bin/etcd \   --data-dir /data/etcd2 \   --name etcd0 \   --advertise-client-urls http://192.168.56.173:2379,http://192.168.56.173:4001 \   --listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \   --initial-advertise-peer-urls http://192.168.56.173:2380 \   --listen-peer-urls http://0.0.0.0:2380 \   --initial-cluster-token etcd-cluster-1 \   --initial-cluster etcd0=http://192.168.56.173:2380,etcd1=http://192.168.56.174:2380,etcd2=http://192.168.56.200:2380 [Install] WantedBy=multi-user.target# 設(shè)置服務(wù)自啟動(dòng) systemctl enable /etc/systemd/system/etcd2.service # 啟動(dòng)etcd1  (先不要做 三個(gè)節(jié)點(diǎn)都部署完畢 在分別啟動(dòng) 否則啟動(dòng)會(huì)hang) systemctl restart etcd2.service

192.168.56.174(node2)

[root@node2 ~]# cat /etc/systemd/system/etcd2.service

[Unit] Description=etcd2.service [Service] Type=notify TimeoutStartSec=0 Restart=always ExecStartPre=-/usr/bin/mkdir -p /data/etcd2 ExecStart=/usr/bin/etcd \   --data-dir /data/etcd2 \   --name etcd1 \   --advertise-client-urls http://192.168.56.174:2379,http://192.168.56.174:4001 \   --listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \   --initial-advertise-peer-urls http://192.168.56.174:2380 \   --listen-peer-urls http://0.0.0.0:2380 \   --initial-cluster-token etcd-cluster-1 \   --initial-cluster etcd0=http://192.168.56.173:2380,etcd1=http://192.168.56.174:2380,etcd2=http://192.168.56.200:2380 [Install] WantedBy=multi-user.target# 設(shè)置服務(wù)自啟動(dòng) systemctl enable /etc/systemd/system/etcd2.service # 啟動(dòng)etcd2  (先不要做 三個(gè)節(jié)點(diǎn)都部署完畢 在分別啟動(dòng) 否則啟動(dòng)會(huì)hang) systemctl restart etcd2.service

192.168.56.200(node2)

[root@node3~]# cat /etc/systemd/system/etcd2.service

[root@node3 ~]# cat  /etc/systemd/system/etcd2.service  [Unit] Description=etcd2.service [Service] Type=notify TimeoutStartSec=0 Restart=always ExecStartPre=-/usr/bin/mkdir -p /data/etcd2 ExecStart=/usr/bin/etcd \   --data-dir /data/etcd2 \   --name etcd2 \   --advertise-client-urls http://192.168.56.200:2379,http://192.168.56.200:4001 \   --listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \   --initial-advertise-peer-urls http://192.168.56.200:2380 \   --listen-peer-urls http://0.0.0.0:2380 \   --initial-cluster-token etcd-cluster-1 \   --initial-cluster etcd0=http://192.168.56.173:2380,etcd1=http://192.168.56.174:2380,etcd2=http://192.168.56.200:2380 [Install] WantedBy=multi-user.target# 設(shè)置服務(wù)自啟動(dòng) systemctl enable /etc/systemd/system/etcd2.service # 啟動(dòng)etcd3  (先不要做 三個(gè)節(jié)點(diǎn)都部署完畢 在分別啟動(dòng) 否則啟動(dòng)會(huì)hang) systemctl restart etcd2.service

備注:?jiǎn)?dòng)的方式一個(gè)一個(gè)啟動(dòng) 否則systemctl restart  etcd2.service 會(huì)hang住

查看狀態(tài)

[root@node3 ~]# systemctl  status etcd2.service  ● etcd2.service    Loaded: loaded (/etc/systemd/system/etcd2.service; enabled; vendor preset: disabled)    Active: active (running) since Sat 2017-09-02 23:43:59 CST; 10min ago   Process: 2673 ExecStartPre=/usr/bin/mkdir -p /data/etcd2 (code=exited, status=0/SUCCESS)  Main PID: 2675 (etcd)    CGroup: /system.slice/etcd2.service            └─2675 /usr/bin/etcd --data-dir /data/etcd2 --name etcd2 --advertise-client-urls http://192.168.56.200:2379,http://192.168.56.200:4001 --listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001... Sep 02 23:44:45 node3 etcd[2675]: established a TCP streaming connection with peer e37f661be0f0e44a (stream Message reader) Sep 02 23:44:45 node3 etcd[2675]: established a TCP streaming connection with peer 161efc88633d5fd4 (stream MsgApp v2 reader) Sep 02 23:44:45 node3 etcd[2675]: established a TCP streaming connection with peer 161efc88633d5fd4 (stream Message reader) Sep 02 23:44:45 node3 etcd[2675]: closed an existing TCP streaming connection with peer 161efc88633d5fd4 (stream Message writer) Sep 02 23:44:45 node3 etcd[2675]: established a TCP streaming connection with peer 161efc88633d5fd4 (stream Message writer) Sep 02 23:44:46 node3 etcd[2675]: 52aafe548d51c9ea [term: 25] received a MsgVote message with higher term from e37f661be0f0e44a [term: 26] Sep 02 23:44:46 node3 etcd[2675]: 52aafe548d51c9ea became follower at term 26 Sep 02 23:44:46 node3 etcd[2675]: 52aafe548d51c9ea [logterm: 20, index: 623, vote: 0] voted for e37f661be0f0e44a [logterm: 20, index: 623] at term 26 Sep 02 23:44:46 node3 etcd[2675]: 52aafe548d51c9ea [term: 26] ignored a MsgVote message with lower term from 161efc88633d5fd4 [term: 24] Sep 02 23:44:46 node3 etcd[2675]: raft.node: 52aafe548d51c9ea elected leader e37f661be0f0e44a at term 26 [root@node3 ~]#[root@node3 ~]# netstat  -lntup  Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      869/sshd             tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1132/master          tcp6       0      0 :::2379                 :::*                    LISTEN      2675/etcd            tcp6       0      0 :::2380                 :::*                    LISTEN      2675/etcd            tcp6       0      0 :::22                   :::*                    LISTEN      869/sshd             tcp6       0      0 ::1:25                  :::*                    LISTEN      1132/master          tcp6       0      0 :::4001                 :::*                    LISTEN      2675/etcd            [root@node3 ~]#

查看相關(guān)主體的狀態(tài)

[root@node1 etcd-v3.0.15-linux-amd64]# etcdctl member list 161efc88633d5fd4: name=etcd0 peerURLs=http://192.168.56.173:2380 clientURLs=http://192.168.56.173:2379,http://192.168.56.173:4001 isLeader=false 52aafe548d51c9ea: name=etcd2 peerURLs=http://192.168.56.200:2380 clientURLs=http://192.168.56.200:2379,http://192.168.56.200:4001 isLeader=false e37f661be0f0e44a: name=etcd1 peerURLs=http://192.168.56.174:2380 clientURLs=http://192.168.56.174:2379,http://192.168.56.174:4001 isLeader=true [root@node1 etcd-v3.0.15-linux-amd64]#

集群的狀態(tài)監(jiān)控(可以結(jié)合zabbix做監(jiān)控)

[root@node1 etcd-v3.0.15-linux-amd64]# etcdctl cluster-health member 161efc88633d5fd4 is healthy: got healthy result from http://192.168.56.173:2379 member 52aafe548d51c9ea is healthy: got healthy result from http://192.168.56.200:2379 member e37f661be0f0e44a is healthy: got healthy result from http://192.168.56.174:2379 cluster is healthy [root@node1 etcd-v3.0.15-linux-amd64]#

etcd基本操作

[root@node1 ~]# etcdctl set testkey "hello world" hello world [root@node1 ~]# etcdctl   get  testkey  hello world [root@node1 ~]# curl -L http://localhost:2379/v2/keys/testkey {"action":"get","node":{"key":"/testkey","value":"hello world","modifiedIndex":11,"createdIndex":11}} [root@node1 ~]# curl -L http://192.168.56.173:2379/v2/keys/testkey {"action":"get","node":{"key":"/testkey","value":"hello world","modifiedIndex":11,"createdIndex":11}} [root@node1 ~]#

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線(xiàn),公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿(mǎn)足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。


網(wǎng)頁(yè)標(biāo)題:etcd集群的部署-創(chuàng)新互聯(lián)
轉(zhuǎn)載源于:http://weahome.cn/article/ddcjsj.html

其他資訊

在線(xiàn)咨詢(xún)

微信咨詢(xún)

電話(huà)咨詢(xún)

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部