TiDB Cluster could not start
开始先用MYSQLDUM 把数据导入TIDB 导了一段时间 后面开始提示:
85, 0, X'') txnStartTS=399154573321437185 costTime=1m6.452244362s
2018/04/02 15:25:47.690 adapter.go:388: [warning] slow-query sql=INSERT IGNORE INTO mysql.gc_delete_range VALUES ("101", "35", "748000000000000023", "748000000000000024", "1522653976") database= succ=true txnStartTS=399154604084035587 connectionId=0 costTime=46.835194637s type=slow-query
2018/04/02 15:25:49.234 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = DeadlineExceeded desc = context deadline exceeded
2018/04/02 15:25:52.536 adapter.go:388: [warning] slow-query connectionId=0 costTime=6.059325278s database= sql=analyze table `db_supply_chain_basic`.`tbl_chain_costcard_relation_shop` txnStartTS=399154616037801985 type=slow-query succ=true
2018/04/02 15:25:52.536 update.go:292: [info] [stats] auto analyze table `db_supply_chain_basic`.`tbl_chain_costcard_relation_shop` now
2018/04/02 15:25:58.599 adapter.go:388: [warning] slow-query costTime=6.062937181s sql=analyze table `db_supply_chain_basic`.`tbl_chain_costcard_relation_shop` txnStartTS=399154617636880385 connectionId=0 succ=true database= type=slow-query
2018/04/02 15:25:58.599 update.go:292: [info] [stats] auto analyze table `db_supply_chain_basic`.`tbl_chain_costcard_relation_shop` now
2018/04/02 15:26:04.656 adapter.go:388: [warning] slow-query succ=true type=slow-query txnStartTS=399154619222851585 connectionId=0 costTime=6.056751625s database= sql=analyze table `db_supply_chain_basic`.`tbl_chain_costcard_relation_shop`
2018/04/02 15:26:04.657 update.go:292: [info] [stats] auto analyze table `db_supply_chain_basic`.`tbl_chain_code_rule` now
2018/04/02 15:26:07.244 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = DeadlineExceeded desc = context deadline exceeded
2018/04/02 15:26:07.690 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = DeadlineExceeded desc = context deadline exceeded
2018/04/02 15:26:07.692 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = DeadlineExceeded desc = context deadline exceeded
2018/04/02 15:26:09.624 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = DeadlineExceeded desc = context deadline exceeded
然后重启整个集群,,先关闭TIDB-SERVER ----TIKV --PD
然后启动pd-tikv-tidb
pd -tikv启动了 TIDB无法启动了
2018/04/02 15:33:57.875 printer.go:36: [info] Welcome to TiDB.
2018/04/02 15:33:57.875 printer.go:37: [info] Release Version: v1.1.0-alpha.1-98-gde9c192
2018/04/02 15:33:57.875 printer.go:38: [info] Git Commit Hash: de9c192cba5e461650dd99f654bf82d659373f15
2018/04/02 15:33:57.875 printer.go:39: [info] Git Branch: master
2018/04/02 15:33:57.875 printer.go:40: [info] UTC Build Time: 2018-02-08 03:33:14
2018/04/02 15:33:57.875 printer.go:41: [info] GoVersion: go version go1.9.2 linux/amd64
2018/04/02 15:33:57.875 printer.go:46: [info] Config: {"host":"0.0.0.0","port":4000,"store":"tikv","path":"172.16.0.46:2379,172.16.0.50:2379,172.16.1.149:2379","socket":"","binlog-socket":"","lease":"10s","run-ddl":true,"split-table":true,"token-limit":1000,"enable-chunk":true,"log":{"level":"info","format":"text","disable-timestamp":false,"file":{"filename":"/home/tidb.log","log-rotate":true,"max-size":0,"max-days":0,"max-backups":0},"slow-query-file":"","slow-threshold":300,"query-log-max-len":2048},"security":{"skip-grant-table":false,"ssl-ca":"","ssl-cert":"","ssl-key":"","cluster-ssl-ca":"","cluster-ssl-cert":"","cluster-ssl-key":""},"status":{"report-status":true,"status-port":10080,"metrics-addr":"","metrics-interval":15},"performance":{"max-procs":0,"tcp-keep-alive":true,"retry-limit":10,"join-concurrency":5,"cross-join":true,"stats-lease":"3s","run-auto-analyze":true,"stmt-count-limit":5000},"xprotocol":{"xserver":false,"xhost":"0.0.0.0","xport":14000,"xsocket":""},"plan-cache":{"enabled":false,"capacity":2560,"shards":256},"prepared-plan-cache":{"enabled":false,"capacity":100},"opentracing":{"enbale":false,"sampler":{"type":"const","param":1,"sampling-server-url":"","max-operations":0,"sampling-refresh-interval":0},"reporter":{"queue-size":0,"buffer-flush-interval":0,"log-spans":false,"local-agent-host-port":""},"rpc-metrics":false},"proxy-protocol":{"networks":"","header-timeout":5},"tikv-client":{"grpc-connection-count":16}}
2018/04/02 15:33:57.876 tidb.go:291: [info] new store
2018/04/02 15:33:57.876 client.go:114: [info] [pd] create pd client with endpoints [172.16.0.46:2379 172.16.0.50:2379 172.16.1.149:2379]
2018/04/02 15:33:57.889 client.go:212: [info] [pd] leader switches to: http://172.16.0.50:2379, previous:
2018/04/02 15:33:57.889 client.go:133: [info] [pd] init cluster id 6539674665584541979
2018/04/02 15:33:57.897 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:33:58.077 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:33:58.424 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:33:59.171 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:34:00.364 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:34:01.980 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:34:03.961 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:34:06.010 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:34:08.330 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:34:10.762 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:34:12.728 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:34:14.431 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:34:16.507 region_cache.go:470: [info] drop regions of store 1 from cache due to request fail, err: rpc error: code = Unavailable desc = grpc: the connection is unavailable
2018/04/02 15:34:18.279 backoff.go:212: [warning] backoffer.maxSleep 20000ms is exceeded, errors:
send tikv request error: rpc error: code = Unavailable desc = grpc: the connection is unavailable, ctx: &{{2 1 2} id:2 end_key:"t\200\000\000\000\000\000\000\005" region_epoch:<conf_ver:1 version:2 > peers:<id:3 store_id:1 > id:3 store_id:1 172.16.0.50:20160}, try next peer later
stale_epoch:<>
send tikv request error: rpc error: code = Unavailable desc = grpc: the connection is unavailable, ctx: &{{2 1 2} id:2 end_key:"t\200\000\000\000\000\000\000\005" region_epoch:<conf_ver:1 version:2 > peers:<id:3 store_id:1 > id:3 store_id:1 172.16.0.50:20160}, try next peer later
2018/04/02 15:34:18.279 txn.go:201: [info] [kv] Rollback txn 399154744867684354
2018/04/02 15:34:18.279 session.go:1474: [fatal] check bootstrapped err [tikv:9002]TiKV server timeout[try again later]
pd 与tikv 日志
[root@test50 bin]# tail -f /disk1/tidb/tikv/logs/tikv.log
2018/04/02 15:32:59.025 tikv-server.rs:141: [WARN] Limit("kernel parameters vm.swappiness got 60, expect 0")
2018/04/02 15:32:59.025 tikv-server.rs:146: [WARN] environment variable `TZ` is missing, use `/etc/localtime`
2018/04/02 15:32:59.025 util.rs:369: [DEBUG] connect to PD endpoint: "172.16.1.149:2379"
2018/04/02 15:32:59.033 util.rs:369: [DEBUG] connect to PD endpoint: "172.16.0.50:2379"
2018/04/02 15:32:59.038 util.rs:369: [DEBUG] connect to PD endpoint: "172.16.0.46:2379"
2018/04/02 15:32:59.043 util.rs:369: [DEBUG] connect to PD endpoint: "http://172.16.0.46:2379"
2018/04/02 15:32:59.048 util.rs:369: [DEBUG] connect to PD endpoint: "http://172.16.0.50:2379"
2018/04/02 15:32:59.052 util.rs:424: [INFO] connect to PD leader "http://172.16.0.50:2379"
2018/04/02 15:32:59.052 util.rs:357: [INFO] All PD endpoints are consistent: ["172.16.1.149:2379", "172.16.0.50:2379", "172.16.0.46:2379"]
2018/04/02 15:32:59.053 tikv-server.rs:528: [INFO] connect to PD cluster 6539674665584541979
^Z
[3]+ Stopped tail -f /disk1/tidb/tikv/logs/tikv.log
[root@test50 bin]# tail -f /disk1/tidb/pd/logs/pd.log
2018/04/02 15:41:05.716 log.go:81: [warning] rafthttp: [the clock difference against peer 682ae842439a75aa is too high [1m18.634509888s > 1s]]
2018/04/02 15:41:10.712 log.go:81: [warning] rafthttp: [the clock difference against peer 2b98db29638737b3 is too high [1m18.63421242s > 1s]]
2018/04/02 15:41:35.716 log.go:81: [warning] rafthttp: [the clock difference against peer 682ae842439a75aa is too high [1m18.634643234s > 1s]]
2018/04/02 15:41:40.712 log.go:81: [warning] rafthttp: [the clock difference against peer 2b98db29638737b3 is too high [1m18.634510813s > 1s]]
2018/04/02 15:42:05.716 log.go:81: [warning] rafthttp: [the clock difference against peer 682ae842439a75aa is too high [1m18.634767475s > 1s]]
2018/04/02 15:42:10.712 log.go:81: [warning] rafthttp: [the clock difference against peer 2b98db29638737b3 is too high [1m18.63546204s > 1s]]
2018/04/02 15:42:35.717 log.go:81: [warning] rafthttp: [the clock difference against peer 682ae842439a75aa is too high [1m18.634936168s > 1s]]
2018/04/02 15:42:40.713 log.go:81: [warning] rafthttp: [the clock difference against peer 2b98db29638737b3 is too high [1m18.634888906s > 1s]]
2018/04/02 15:43:05.717 log.go:81: [warning] rafthttp: [the clock difference against peer 682ae842439a75aa is too high [1m18.635039609s > 1s]]
2018/04/02 15:43:10.713 log.go:81: [warning] rafthttp: [the clock difference against peer 2b98db29638737b3 is too high [1m18.635122395s > 1s]]
2018/04/02 15:43:35.717 log.go:81: [warning] rafthttp: [the clock difference against peer 682ae842439a75aa is too high [1m18.635171842s > 1s]]
2018/04/02 15:43:40.713 log.go:81: [warning] rafthttp: [the clock difference against peer 2b98db29638737b3 is too high [1m18.635278769s > 1s]]
@dbaspace Thanks for your feedback. @siddontang PTAL
@dbaspace Thanks for the feedback, could you also provide how do you start pd, tikv and tidb?
Seems the clocks between PD servers are not synchronized, have you started NTP on these nodes?
系统都会有这个5 1 * * * /usr/sbin/ntpdate 192.168.21.13
2018/04/02 15:43:40.713 log.go:81: [warning] rafthttp: [the clock difference against peer 2b98db29638737b3 is too high [1m18.635278769s > 1s]]
This shows that one of the clocks on the PD servers is wrong, can you manually check the clocks on all PD servers?