TiKV默认配置下,raft节点间的Heartbeat interval是多长?

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:TiKV master分支

  • 【问题描述】:

  • 采用类似如下的命令启动TiKV三个节点: ./bin/tikv-server --pd-endpoints=“127.0.0.1:2379”
    –addr=“127.0.0.1:20161”
    –data-dir=tikv2
    –log-file=tikv2.log --log-level=debug

  • 观察到

[2019/11/19 20:15:16.310 +08:00] [DEBUG] [peer.rs:2434] [“send raft msg”] [to=5] [from=3] [msg_size=10] [msg_type=MsgHeartbeat] [peer_id=3] [region_id=2]

[2019/11/19 20:15:18.312 +08:00] [DEBUG] [peer.rs:2434] [“send raft msg”] [to=5] [from=3] [msg_size=10] [msg_type=MsgHeartbeat] [peer_id=3] [region_id=2]

[2019/11/19 20:19:36.806 +08:00] [DEBUG] [peer.rs:2434] [“send raft msg”] [to=5] [from=3] [msg_size=10] [msg_type=MsgHeartbeat] [peer_id=3] [region_id=2]

[2019/11/19 20:24:17.008 +08:00] [DEBUG] [peer.rs:2434] [“send raft msg”] [to=5] [from=3] [msg_size=10] [msg_type=MsgHeartbeat] [peer_id=3] [region_id=2]

默认配置下,MsgHeartbeat 间隔是5min?? 请问该如何调整?

附: raft相关的配置如下 [raftstore]

  • sync-log = true
  • prevote = true
  • raftdb-path = “”
  • capacity = “0KiB”
  • raft-base-tick-interval = “1s”
  • raft-heartbeat-ticks = 2
  • raft-election-timeout-ticks = 10
  • raft-min-election-timeout-ticks = 0
  • raft-max-election-timeout-ticks = 0
  • raft-max-size-per-msg = “1MiB”
  • raft-max-inflight-msgs = 256
  • raft-entry-max-size = “8MiB”
  • raft-log-gc-tick-interval = “10s”
  • raft-log-gc-threshold = 50
  • raft-log-gc-count-limit = 73728
  • raft-log-gc-size-limit = “72MiB”
  • raft-entry-cache-life-time = “30s”
  • raft-reject-transfer-leader-duration = “3s”
  • split-region-check-tick-interval = “10s”
  • region-split-check-diff = “6MiB”
  • region-compact-check-interval = “5m”
  • clean-stale-peer-delay = “10m”
  • region-compact-check-step = 100
  • region-compact-min-tombstones = 10000
  • region-compact-tombstones-percent = 30
  • pd-heartbeat-tick-interval = “1m”
  • pd-store-heartbeat-tick-interval = “10s”
  • snap-mgr-gc-tick-interval = “1m”
  • snap-gc-timeout = “4h”
  • lock-cf-compact-interval = “10m”
  • lock-cf-compact-bytes-threshold = “256MiB”
  • notify-capacity = 40960
  • messages-per-tick = 4096
  • max-peer-down-duration = “5m”
  • max-leader-missing-duration = “2h”
  • abnormal-leader-missing-duration = “10m”
  • peer-stale-state-check-interval = “5m”
  • leader-transfer-max-log-lag = 10
  • snap-apply-batch-size = “10MiB”
  • consistency-check-interval = “0s”
  • report-region-flow-interval = “1m”
  • raft-store-max-leader-lease = “9s”
  • right-derive-when-split = true
  • allow-remove-leader = false
  • merge-max-log-gap = 10
  • merge-check-tick-interval = “10s”
  • use-delete-range = false
  • cleanup-import-sst-interval = “10m”
  • local-read-batch-size = 1024
  • apply-max-batch-size = 1024
  • apply-pool-size = 2
  • store-max-batch-size = 1024
  • store-pool-size = 2
  • future-poll-size = 1
  • hibernate-regions = true

你好,这个配置我之前已经看过,因为实际运行情况和文档不符合,才提出这个问题…按照文档的意思,是2s发一次心跳,但是实际运行的日志显示是5min?

测试了下3.0.5版本,一切正常,2s一次raft心跳。master分支不知道为何是5min…

目前 master 分支是 4.0 版本代码,代码还未正式发布,可能存在不稳定的情况,如果是测试或者生产使用都建议使用官方正式发布版本