首页 > 数据库 >数据库--etcd数据不一致

数据库--etcd数据不一致

时间:2023-08-10 17:44:13浏览次数:60  
标签:etcd -- 数据库 11.0 https peer home kube

1.查看集群情况,发现db大小不一样,且差距很大

[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379,https://11.0.1.150:2379,https://11.0.1.151:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  endpoint status   --write-out="table"
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
|        ENDPOINT         |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| https://11.0.1.149:2379 | 6e45a7efe4f43e72 |   3.5.0 |   23 MB |     false |      false |         2 |         11 |                 11 |        |
| https://11.0.1.150:2379 | d0c21986d57fb7ce |   3.5.0 |  398 MB |      true |      false |         2 |         11 |                 11 |        |
| https://11.0.1.151:2379 | 83b35c880ec44a22 |   3.5.0 |   22 MB |     false |      false |         2 |         11 |                 11 |        |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+

 

2.分析差异数据情况

通过排查,文档内容对比,发现是schedule 、job、events、pod 数据。 应该属于脏数据了

[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  get / --prefix  --keys-only > 149.txt
[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.150:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  get / --prefix  --keys-only > 150.txt
[root@localhost kube_etcd]# cat 150.txt | wc -l
362726
[root@localhost kube_etcd]# cat 149.txt | wc -l
3124
[root@localhost kube_etcd]# cat 150.txt | grep "job|scheduler" | wc -l
0
[root@localhost kube_etcd]# cat 150.txt | grep "job" | wc -l
89725
[root@localhost kube_etcd]# cat 150.txt | grep "scheduler" | wc -l
179779
[root@localhost kube_etcd]# cat 149.txt | grep job | wc -l
11
[root@localhost kube_etcd]# cat 149.txt | grep scheduler | wc -l
321
[root@localhost kube_etcd]# cat 150.txt | grep -v "scheduler"  | grep -v job |  grep -v ^$ | wc -l
1576
[root@localhost kube_etcd]# cat 149.txt | grep -v "scheduler"  | grep -v job |  grep -v ^$ | wc -l
1233
View Code

 

[root@localhost kube_etcd]# cat 150.txt | grep -v "scheduler"  | grep -v job | grep -v events | grep -v pod |   grep -v ^$  | wc -l
781
[root@localhost kube_etcd]# cat 149.txt | grep -v "scheduler"  | grep -v job | grep -v events | grep -v pod |   grep -v ^$  | wc -l
781

3.尝试碎片整理,发现并不能解决此问题

[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379,https://11.0.1.150:2379,https://11.0.1.151:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  endpoint status   --write-out="table"
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
|        ENDPOINT         |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| https://11.0.1.149:2379 | 6e45a7efe4f43e72 |   3.5.0 |   23 MB |     false |      false |         2 |         11 |                 11 |        |
| https://11.0.1.150:2379 | d0c21986d57fb7ce |   3.5.0 |  398 MB |      true |      false |         2 |         11 |                 11 |        |
| https://11.0.1.151:2379 | 83b35c880ec44a22 |   3.5.0 |   22 MB |     false |      false |         2 |         11 |                 11 |        |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379,https://11.0.1.150:2379,https://11.0.1.151:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  defrag
Finished defragmenting etcd member[https://11.0.1.149:2379]
{"level":"warn","ts":"2023-08-10T17:18:05.790+0800","logger":"etcd-client","caller":"v3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc0002d8c40/#initially=[https://11.0.1.149:2379;https://11.0.1.150:2379;https://11.0.1.151:2379]","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = context deadline exceeded"}
Failed to defragment etcd member[https://11.0.1.150:2379] (context deadline exceeded)
Finished defragmenting etcd member[https://11.0.1.151:2379]
[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379,https://11.0.1.150:2379,https://11.0.1.151:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  endpoint status   --write-out="table"
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
|        ENDPOINT         |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| https://11.0.1.149:2379 | 6e45a7efe4f43e72 |   3.5.0 |   15 MB |     false |      false |         2 |         11 |                 11 |        |
| https://11.0.1.150:2379 | d0c21986d57fb7ce |   3.5.0 |  375 MB |      true |      false |         2 |         11 |                 11 |        |
| https://11.0.1.151:2379 | 83b35c880ec44a22 |   3.5.0 |   15 MB |     false |      false |         2 |         11 |                 11 |        |
View Code

4.移除150节点并重新加入

a、备份etcd数据(物理备份和snapshot,三台都备份)

cp -a /home/s/data/kube_etcd/  /home/bak/

 etcdctl snapshot save /home/bak/etcd.db

b、停服150

systemctl stop kube_etcd

c、移除150节点

etcdctl  remove name

[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379,https://11.0.1.150:2379,https://11.0.1.151:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  member list
6e45a7efe4f43e72, started, 11.0.1.149, https://11.0.1.149:2380, https://11.0.1.149:2379, false
83b35c880ec44a22, started, 11.0.1.151, https://11.0.1.151:2380, https://11.0.1.151:2379, false
d0c21986d57fb7ce, started, 11.0.1.150, https://11.0.1.150:2380, https://11.0.1.150:2379, false
[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379,https://11.0.1.150:2379,https://11.0.1.151:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  member remove d0c21986d57fb7ce
Member d0c21986d57fb7ce removed from cluster af94405c9fa143f5
[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379,https://11.0.1.150:2379,https://11.0.1.151:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  member list
6e45a7efe4f43e72, started, 11.0.1.149, https://11.0.1.149:2380, https://11.0.1.149:2379, false
83b35c880ec44a22, started, 11.0.1.151, https://11.0.1.151:2380, https://11.0.1.151:2379, false
View Code

d、删除150 member数据

rm -rf member

e、加入etcd集群

[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379,https://11.0.1.150:2379,https://11.0.1.151:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  member  add 11.0.1.150 --peer-urls=https://11.0.1.150:2380
Member 28d53d476e303d1b added to cluster af94405c9fa143f5

ETCD_NAME="11.0.1.150"
ETCD_INITIAL_CLUSTER="11.0.1.150=https://11.0.1.150:2380,11.0.1.149=https://11.0.1.149:2380,11.0.1.151=https://11.0.1.151:2380"
ETCD_INITIAL_ADVERTISE_PEER_URLS="https://11.0.1.150:2380"
ETCD_INITIAL_CLUSTER_STATE="existing"
View Code

f、启动150 etcd

注意:修改配置:kube_etcd.conf

initial-cluster-state: 'existing'

systemctl start kube_etcd

为了方便查看日志, 我是先直接 /home/s/bin/etcd --config-file /home/s/etc/kube_etcd/kube_etcd.conf 启动的

[root@localhost kube_etcd]# /home/s/bin/etcd --config-file /home/s/etc/kube_etcd/kube_etcd.conf
{"level":"info","ts":"2023-08-10T17:32:24.741+0800","caller":"etcdmain/config.go:337","msg":"loaded server configuration, other configuration command line flags and environment variables will be ignored if provided","path":"/home/s/etc/kube_etcd/kube_etcd.conf"}
{"level":"info","ts":"2023-08-10T17:32:24.741+0800","caller":"etcdmain/etcd.go:72","msg":"Running: ","args":["/home/s/bin/etcd","--config-file","/home/s/etc/kube_etcd/kube_etcd.conf"]}
{"level":"info","ts":"2023-08-10T17:32:24.741+0800","caller":"embed/etcd.go:131","msg":"configuring peer listeners","listen-peer-urls":["https://11.0.1.150:2380"]}
{"level":"info","ts":"2023-08-10T17:32:24.741+0800","caller":"embed/etcd.go:478","msg":"starting with peer TLS","tls-info":"cert = /home/s/cert/kube_etcd/peer.pem, key = /home/s/cert/kube_etcd/peer-key.pem, client-cert=, client-key=, trusted-ca = /home/s/cert/kube_etcd/ca.pem, client-cert-auth = false, crl-file = ","cipher-suites":[]}
{"level":"info","ts":"2023-08-10T17:32:24.743+0800","caller":"embed/etcd.go:139","msg":"configuring client listeners","listen-client-urls":["http://localhost:2379","https://11.0.1.150:2379"]}
{"level":"warn","ts":"2023-08-10T17:32:24.744+0800","caller":"embed/etcd.go:606","msg":"scheme is HTTP while key and cert files are present; ignoring key and cert files","client-url":"http://localhost:2379"}
{"level":"info","ts":"2023-08-10T17:32:24.745+0800","caller":"embed/etcd.go:307","msg":"starting an etcd server","etcd-version":"3.5.0","git-sha":"946a5a6f2","go-version":"go1.16.3","go-os":"linux","go-arch":"amd64","max-cpu-set":1,"max-cpu-available":1,"member-initialized":false,"name":"11.0.1.150","data-dir":"/home/s/data/kube_etcd","wal-dir":"","wal-dir-dedicated":"","member-dir":"/home/s/data/kube_etcd/member","force-new-cluster":false,"heartbeat-interval":"300ms","election-timeout":"4.8s","initial-election-tick-advance":true,"snapshot-count":50000,"snapshot-catchup-entries":5000,"initial-advertise-peer-urls":["https://11.0.1.150:2380"],"listen-peer-urls":["https://11.0.1.150:2380"],"advertise-client-urls":["https://11.0.1.150:2379"],"listen-client-urls":["http://localhost:2379","https://11.0.1.150:2379"],"listen-metrics-urls":[],"cors":["*"],"host-whitelist":["*"],"initial-cluster":"11.0.1.149=https://11.0.1.149:2380,11.0.1.150=https://11.0.1.150:2380,11.0.1.151=https://11.0.1.151:2380","initial-cluster-state":"existing","initial-cluster-token":"etcd-cluster","quota-size-bytes":5368709120,"pre-vote":true,"initial-corrupt-check":false,"corrupt-check-time-interval":"0s","auto-compaction-mode":"periodic","auto-compaction-retention":"1h0m0s","auto-compaction-interval":"1h0m0s","discovery-url":"","discovery-proxy":"","downgrade-check-interval":"5s"}
{"level":"warn","ts":1691659944.7454906,"caller":"fileutil/fileutil.go:57","msg":"check file permission","error":"directory \"/home/s/data/kube_etcd\" exist, but the permission is \"drwxr-xr-x\". The recommended permission is \"-rwx------\" to prevent possible unprivileged access to the data"}
{"level":"info","ts":"2023-08-10T17:32:24.747+0800","caller":"etcdserver/backend.go:81","msg":"opened backend db","path":"/home/s/data/kube_etcd/member/snap/db","took":"1.206798ms"}
{"level":"info","ts":"2023-08-10T17:32:24.770+0800","caller":"etcdserver/raft.go:448","msg":"starting local member","local-member-id":"28d53d476e303d1b","cluster-id":"af94405c9fa143f5"}
{"level":"info","ts":"2023-08-10T17:32:24.770+0800","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"28d53d476e303d1b switched to configuration voters=()"}
{"level":"info","ts":"2023-08-10T17:32:24.770+0800","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"28d53d476e303d1b became follower at term 0"}
{"level":"info","ts":"2023-08-10T17:32:24.770+0800","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"newRaft 28d53d476e303d1b [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]"}
{"level":"warn","ts":"2023-08-10T17:32:24.771+0800","caller":"auth/store.go:1220","msg":"simple token is not cryptographically signed"}
{"level":"info","ts":"2023-08-10T17:32:24.772+0800","caller":"mvcc/kvstore.go:415","msg":"kvstore restored","current-rev":1}
{"level":"info","ts":"2023-08-10T17:32:24.772+0800","caller":"etcdserver/quota.go:117","msg":"enabled backend quota","quota-name":"v3-applier","quota-size-bytes":5368709120,"quota-size":"5.4 GB"}
{"level":"info","ts":"2023-08-10T17:32:24.773+0800","caller":"rafthttp/pipeline.go:72","msg":"started HTTP pipelining with remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.773+0800","caller":"rafthttp/transport.go:286","msg":"added new remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"6e45a7efe4f43e72","remote-peer-urls":["https://11.0.1.149:2380"]}
{"level":"info","ts":"2023-08-10T17:32:24.773+0800","caller":"rafthttp/pipeline.go:72","msg":"started HTTP pipelining with remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.773+0800","caller":"rafthttp/transport.go:286","msg":"added new remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22","remote-peer-urls":["https://11.0.1.151:2380"]}
{"level":"info","ts":"2023-08-10T17:32:24.773+0800","caller":"rafthttp/peer.go:133","msg":"starting remote peer","remote-peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.773+0800","caller":"rafthttp/pipeline.go:72","msg":"started HTTP pipelining with remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.777+0800","caller":"rafthttp/peer.go:137","msg":"started remote peer","remote-peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.777+0800","caller":"rafthttp/transport.go:317","msg":"added remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"6e45a7efe4f43e72","remote-peer-urls":["https://11.0.1.149:2380"]}
{"level":"info","ts":"2023-08-10T17:32:24.778+0800","caller":"rafthttp/peer.go:133","msg":"starting remote peer","remote-peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.778+0800","caller":"rafthttp/pipeline.go:72","msg":"started HTTP pipelining with remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.780+0800","caller":"rafthttp/peer.go:137","msg":"started remote peer","remote-peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.781+0800","caller":"rafthttp/transport.go:317","msg":"added remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22","remote-peer-urls":["https://11.0.1.151:2380"]}
{"level":"info","ts":"2023-08-10T17:32:24.781+0800","caller":"etcdserver/server.go:843","msg":"starting etcd server","local-member-id":"28d53d476e303d1b","local-server-version":"3.5.0","cluster-version":"to_be_decided"}
{"level":"info","ts":"2023-08-10T17:32:24.784+0800","caller":"embed/etcd.go:687","msg":"starting with client TLS","tls-info":"cert = /home/s/cert/kube_etcd/peer.pem, key = /home/s/cert/kube_etcd/peer-key.pem, client-cert=, client-key=, trusted-ca = /home/s/cert/kube_etcd/ca.pem, client-cert-auth = false, crl-file = ","cipher-suites":[]}
{"level":"warn","ts":"2023-08-10T17:32:24.784+0800","caller":"embed/etcd.go:700","msg":"Flag `enable-v2` is deprecated and will get removed in etcd 3.6."}
{"level":"info","ts":"2023-08-10T17:32:24.784+0800","caller":"embed/etcd.go:580","msg":"serving peer traffic","address":"11.0.1.150:2380"}
{"level":"info","ts":"2023-08-10T17:32:24.784+0800","caller":"embed/etcd.go:552","msg":"cmux::serve","address":"11.0.1.150:2380"}
{"level":"info","ts":"2023-08-10T17:32:24.784+0800","caller":"rafthttp/stream.go:169","msg":"started stream writer with remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.784+0800","caller":"rafthttp/stream.go:169","msg":"started stream writer with remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.784+0800","caller":"embed/etcd.go:276","msg":"now serving peer/client/metrics","local-member-id":"28d53d476e303d1b","initial-advertise-peer-urls":["https://11.0.1.150:2380"],"listen-peer-urls":["https://11.0.1.150:2380"],"advertise-client-urls":["https://11.0.1.150:2379"],"listen-client-urls":["http://localhost:2379","https://11.0.1.150:2379"],"listen-metrics-urls":[]}
{"level":"info","ts":"2023-08-10T17:32:24.784+0800","caller":"rafthttp/stream.go:395","msg":"started stream reader with remote peer","stream-reader-type":"stream MsgApp v2","local-member-id":"28d53d476e303d1b","remote-peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.784+0800","caller":"rafthttp/stream.go:395","msg":"started stream reader with remote peer","stream-reader-type":"stream Message","local-member-id":"28d53d476e303d1b","remote-peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.788+0800","caller":"rafthttp/stream.go:169","msg":"started stream writer with remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.788+0800","caller":"rafthttp/stream.go:169","msg":"started stream writer with remote peer","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.788+0800","caller":"rafthttp/stream.go:395","msg":"started stream reader with remote peer","stream-reader-type":"stream MsgApp v2","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.788+0800","caller":"rafthttp/stream.go:395","msg":"started stream reader with remote peer","stream-reader-type":"stream Message","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.789+0800","caller":"etcdserver/server.go:744","msg":"starting initial election tick advance","election-ticks":16}
{"level":"info","ts":"2023-08-10T17:32:24.790+0800","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"28d53d476e303d1b [term: 0] received a MsgHeartbeat message with higher term from 83b35c880ec44a22 [term: 3]"}
{"level":"info","ts":"2023-08-10T17:32:24.790+0800","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"28d53d476e303d1b became follower at term 3"}
{"level":"info","ts":"2023-08-10T17:32:24.790+0800","logger":"raft","caller":"etcdserver/zap_raft.go:77","msg":"raft.node: 28d53d476e303d1b elected leader 83b35c880ec44a22 at term 3"}
{"level":"info","ts":"2023-08-10T17:32:24.809+0800","caller":"rafthttp/stream.go:249","msg":"set message encoder","from":"28d53d476e303d1b","to":"6e45a7efe4f43e72","stream-type":"stream MsgApp v2"}
{"level":"info","ts":"2023-08-10T17:32:24.809+0800","caller":"rafthttp/peer_status.go:53","msg":"peer became active","peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.809+0800","caller":"rafthttp/stream.go:274","msg":"established TCP streaming connection with remote peer","stream-writer-type":"stream MsgApp v2","local-member-id":"28d53d476e303d1b","remote-peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.809+0800","caller":"rafthttp/stream.go:249","msg":"set message encoder","from":"28d53d476e303d1b","to":"6e45a7efe4f43e72","stream-type":"stream Message"}
{"level":"info","ts":"2023-08-10T17:32:24.809+0800","caller":"rafthttp/stream.go:274","msg":"established TCP streaming connection with remote peer","stream-writer-type":"stream Message","local-member-id":"28d53d476e303d1b","remote-peer-id":"6e45a7efe4f43e72"}
{"level":"info","ts":"2023-08-10T17:32:24.816+0800","caller":"rafthttp/stream.go:249","msg":"set message encoder","from":"28d53d476e303d1b","to":"83b35c880ec44a22","stream-type":"stream MsgApp v2"}
{"level":"info","ts":"2023-08-10T17:32:24.816+0800","caller":"rafthttp/peer_status.go:53","msg":"peer became active","peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.816+0800","caller":"rafthttp/stream.go:274","msg":"established TCP streaming connection with remote peer","stream-writer-type":"stream MsgApp v2","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.816+0800","caller":"rafthttp/stream.go:249","msg":"set message encoder","from":"28d53d476e303d1b","to":"83b35c880ec44a22","stream-type":"stream Message"}
{"level":"info","ts":"2023-08-10T17:32:24.816+0800","caller":"rafthttp/stream.go:274","msg":"established TCP streaming connection with remote peer","stream-writer-type":"stream Message","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22"}
{"level":"info","ts":"2023-08-10T17:32:24.823+0800","caller":"rafthttp/stream.go:412","msg":"established TCP streaming connection with remote peer","stream-reader-type":"stream MsgApp v2","local-member-id":"28d53d476e303d1b","remote-peer-id":"83b35c880ec44a22"}
View Code

g、查看集群情况

[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379,https://11.0.1.150:2379,https://11.0.1.151:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  endpoint status   --write-out="table"
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
|        ENDPOINT         |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| https://11.0.1.149:2379 | 6e45a7efe4f43e72 |   3.5.0 |   15 MB |     false |      false |         3 |         22 |                 22 |        |
| https://11.0.1.150:2379 | 28d53d476e303d1b |   3.5.0 |   16 MB |     false |      false |         3 |         22 |                 22 |        |
| https://11.0.1.151:2379 | 83b35c880ec44a22 |   3.5.0 |   16 MB |      true |      false |         3 |         22 |                 22 |        |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
[root@localhost kube_etcd]#  /home/s/bin/etcdctl  --endpoints=https://11.0.1.149:2379,https://11.0.1.150:2379,https://11.0.1.151:2379  --cacert=/home/s/cert/kube_etcd/ca.pem --cert=/home/s/cert/kube_etcd/client.pem --key=/home/s/cert/kube_etcd/client-key.pem  member list
28d53d476e303d1b, started, 11.0.1.150, https://11.0.1.150:2380, https://11.0.1.150:2379, false
6e45a7efe4f43e72, started, 11.0.1.149, https://11.0.1.149:2380, https://11.0.1.149:2379, false
83b35c880ec44a22, started, 11.0.1.151, https://11.0.1.151:2380, https://11.0.1.151:2379, false
View Code

 

标签:etcd,--,数据库,11.0,https,peer,home,kube
From: https://www.cnblogs.com/aroin/p/17620965.html

相关文章

  • 家庭开关接线图【单控、双控、三控】
    1)一开单控接线图 2)二\三开连体单控接线图 3)四开连体单控接线图 4)一开五孔单控插座接线图(开关控制插座) 5)二开五孔单控插座接线图 6)一开双控接线图 以下为单开双控开关3种接法原理图,不推荐第三种接法,开关控制在零线上,存在安全隐患 7)二\三开单控接线图......
  • 多态(一)
    多态多态就是多种形态,具体点就是当不同的对象去完成时会产生不同的状态。把virtual加在一个虚函数的前面,我们叫做虚函数。虚继承和虚函数没有关系。函数名相同,参数列表相同他们叫做重写或者覆盖,这里没有重载的关系,重载必须在同一个作用域。#include<iostream>usingnamespac......
  • 分治算法C++
    1、光荣的梦想题目描述】Prince对他在这片陆上维护的秩序感到满意,于是决定启程离开艾泽拉斯。在他动身之前,Prince决定赋予King_Bette最强大的能量以守护世界、保卫这里的平衡与和谐。在那个时代,平衡是个梦想。因为有很多奇异的物种拥有各种不稳定的能量,平衡瞬间即被打破。KB决定求......
  • 无涯教程-Perl - index函数
    描述此函数返回STR中第一次出现的SUBSTR的位置,该位置从开头(从零开始)开始,或者从POSITION(如果指定)开始。语法以下是此函数的简单语法-indexSTR,SUBSTR,POSITIONindexSTR,SUBSTR返回值失败时此函数返回-1,否则返回匹配字符串的位置(第一个字符从零开始)。例......
  • 如何使用HTTP代理IP抓取数据
    在进行数据抓取时如何使用HTTP代理IP的呢?主要有以下四种方法:1、获取可用的HTTP代理IP:可以通过购买私密HTTP代理IP或使用公开的HTTP代理IP网站来获取可用的HTTP代理IP。确保获取的代理IP列表是有效且稳定的。2、设置HTTP代理IP:在爬虫程序中,使用合适的库(如requests、urllib等)发送请求......
  • 广度优先搜索C++
    1、细胞(1)题目描述一矩形阵列由数字0到9组成,数字1到9代表细胞,细胞的定义为沿细胞数字上下左右还是细胞数字则为同一细胞,求给定矩形阵列的细胞个数。如:阵列4100234500067103456050020456006710000000089有4个细胞。【输入】第一行为矩阵的行n和列m;下面为一个n×m......
  • AI模型部署&推理进阶教程:使用CSK6视觉开发套件拍照并进行物体识别
    前言在已发布的《CSK6AI模型部署教程》系列文章中,我们实现了将训练的LNN模型在CSK6芯片上运行的完整流程:将一张苹果的图片提取到的特征,并打包到了固件里面,然后在固件里去将它送给thinker模型去进行推理,得出一个苹果的一个推理结果。在以往分享的示例中我们的thinker模型是打包WAS......
  • 递归算法练习C++
    1、逆波兰表达式(1)题目描述逆波兰表达式是一种把运算符前置的算术表达式,例如普通的表达式2+3的逆波兰表示法为+23。逆波兰表达式的优点是运算符之间不必有优先级关系,也不必用括号改变运算次序,例如(2+3)*4的逆波兰表示法为*+234。本题求解逆波兰表达式的值,其中运算符包括......
  • 程序员到底该不该找副业?建议你看完这篇再做决定
    最近取关了一些公众号,因为它标题太吸引人了,什么“全包100w……”、“我如何靠副业挣了200w”,看得我心血澎湃,脑子一冲动差点买下全文末尾链接处的课程。看了眼微信余额,发昏的大脑霎那间恢复理智。原先关注这些公众号只是想碎片时间学些东西,好提升自己。谁知我把它们当作精神食粮,它......
  • 服务器租用和服务器托管各有哪些优势?
    服务器租用和服务器托管各有哪些优势?企业使用服务器时,可选择租用服务器或托管服务器。两者的相似之处在于都把服务器放在一起IDC服务提供商的机房,但两者的区别在于谁配置了服务器。例如,租赁服务器业务通常是直接租赁商的云服务器产品,服务器托管通常由客户自行购买并交给服务提供商......