场景
在原有的集群上扩容PD
原有节点机地址:192.168.180.46,192.168.180.47,192.168.180.48
新节点机IP地址:192.168.181.18
我做了什么
PD扩容,根据文档进行操作
-
[tidb@test1 scripts]$ ansible-playbook bootstrap.yml -l 192.168.181.18 --extra-vars “dev_mode=True”
-
[tidb@test1 scripts]$ ansible-playbook deploy.yml -l 192.168.181.18
-
修改节点机配置, 进入节点机 test4
[tidb@test4 scripts]$ vim run_pd.sh
#!/bin/bash
set -e
ulimit -n 1000000
# WARNING: This file was auto-generated. Do not edit!
# All your edit might be overwritten!
DEPLOY_DIR=/home/tidb/deploy
cd "${DEPLOY_DIR}" || exit 1
exec bin/pd-server
--name="pd_test4"
--client-urls="http://192.168.181.18:2379"
--advertise-client-urls="http://192.168.181.18:2379"
--peer-urls="http://192.168.181.18:2380"
--advertise-peer-urls="http://192.168.181.18:2380"
--data-dir="/home/tidb/deploy/data.pd"
--join="http://192.168.180.48:2379"
--config=conf/pd.toml
--log-file="/home/tidb/deploy/log/pd.log" 2>> "/home/tidb/deploy/log/pd_stderr.log"
- 启动PD
[tidb@test4 scripts]$ ./start_pd.sh
[tidb@test4 scripts]$
- 查看PD.log
[tidb@test4 log]$ tail -1000f pd.log
......
[2019/08/27 17:08:16.247 +08:00] [WARN] [stream.go:681] ["request sent was ignored by remote peer due to cluster ID mismatch"] [remote-peer-id=fb02ae473bb0b305] [remote-peer-cluster-id=21d02ab059590cc5] [local-member-id=2029038589c20d50] [local-member-cluster-id=c7561f62a4c47cc7] [error="cluster ID mismatch"]
[2019/08/27 17:08:16.247 +08:00] [WARN] [stream.go:681] ["request sent was ignored by remote peer due to cluster ID mismatch"] [remote-peer-id=fb02ae473bb0b305] [remote-peer-cluster-id=21d02ab059590cc5] [local-member-id=2029038589c20d50] [local-member-cluster-id=c7561f62a4c47cc7] [error="cluster ID mismatch"]
[2019/08/27 17:08:16.320 +08:00] [INFO] [raft.go:922] ["2029038589c20d50 is starting a new election at term 1"]
[2019/08/27 17:08:16.320 +08:00] [INFO] [raft.go:741] ["2029038589c20d50 became pre-candidate at term 1"]
[2019/08/27 17:08:16.320 +08:00] [INFO] [raft.go:820] ["2029038589c20d50 received MsgPreVoteResp from 2029038589c20d50 at term 1"]
[2019/08/27 17:08:16.320 +08:00] [INFO] [raft.go:807] ["2029038589c20d50 [logterm: 1, index: 4] sent MsgPreVote request to fb02ae473bb0b305 at term 1"]
[2019/08/27 17:08:16.320 +08:00] [INFO] [raft.go:807] ["2029038589c20d50 [logterm: 1, index: 4] sent MsgPreVote request to 474a6e7996dd50a6 at term 1"]
[2019/08/27 17:08:16.320 +08:00] [INFO] [raft.go:807] ["2029038589c20d50 [logterm: 1, index: 4] sent MsgPreVote request to 50003c586d7591bc at term 1"]
2019/08/27 17:08:16.321 log.go:84: [error] rafthttp: [request sent was ignored (cluster ID mismatch: remote[fb02ae473bb0b305]=21d02ab059590cc5, local=c7561f62a4c47cc7)]
2019/08/27 17:08:16.321 log.go:84: [error] rafthttp: [request sent was ignored (cluster ID mismatch: remote[50003c586d7591bc]=21d02ab059590cc5, local=c7561f62a4c47cc7)]
2019/08/27 17:08:16.321 log.go:84: [error] rafthttp: [request sent was ignored (cluster ID mismatch: remote[474a6e7996dd50a6]=21d02ab059590cc5, local=c7561f62a4c47cc7)]
[2019/08/27 17:08:16.342 +08:00] [WARN] [stream.go:681] ["request sent was ignored by remote peer due to cluster ID mismatch"] [remote-peer-id=474a6e7996dd50a6] [remote-peer-cluster-id=21d02ab059590cc5] [local-member-id=2029038589c20d50] [local-member-cluster-id=c7561f62a4c47cc7] [error="cluster ID mismatch"]
[2019/08/27 17:08:16.342 +08:00] [WARN] [stream.go:681] ["request sent was ignored by remote peer due to cluster ID mismatch"] [remote-peer-id=474a6e7996dd50a6] [remote-peer-cluster-id=21d02ab059590cc5] [local-member-id=2029038589c20d50] [local-member-cluster-id=c7561f62a4c47cc7] [error="cluster ID mismatch"]
......
我尝试重新部署PD, 又出现了新的异常
1. 停止所有pd
[tidb@test1 tidb-ansible]$ ansible-playbook stop.yml --tags=pd
2. 清空pd缓存
[tidb@test1 tidb-ansible]$ ansible-playbook unsafe_cleanup_data.yml --tags=pd
3. 重新部署
[tidb@test1 tidb-ansible]$ ansible-playbook deploy.yml --tags=pd
4. 启动集群
[tidb@test1 tidb-ansible]$ ansible-playbook start.yml --tags=pd
5. 进入节点机查看PD log
[2019/08/27 17:53:09.839 +08:00] [WARN] [stream.go:681] ["request sent was ignored by remote peer due to cluster ID mismatch"] [remote-peer-id=50003c586d7591bc] [remote-peer-cluster-id=21d02ab059590cc5] [local-member-id=2029038589c20d50] [local-member-cluster-id=c7561f62a4c47cc7] [error="cluster ID mismatch"]
[2019/08/27 17:53:09.839 +08:00] [FATAL] [main.go:111] ["run server failed"] [error="Etcd cluster ID mismatch, expect 14363702570076372167, got 2436494335309057221"] [stack="github.com/pingcap/log.Fatal
/home/jenkins/workspace/release_tidb_3.0/go/pkg/mod/github.com/pingcap/log@v0.0.0-20190715063458-479153f07ebd/global.go:59
main.main
/home/jenkins/workspace/release_tidb_3.0/go/src/github.com/pingcap/pd/cmd/pd-server/main.go:111
runtime.main
/usr/local/go/src/runtime/proc.go:200"]