docs-cn icon indicating copy to clipboard operation
docs-cn copied to clipboard

TIKV启动异常

Open dbaspace opened this issue 8 years ago • 5 comments

[root@glusterfs10 tikv]# 2018/03/02 14:45:58.132 mod.rs:344: [INFO] Welcome to TiKV. 2018/03/02 14:45:58.133 mod.rs:345: [INFO] Release Version: 1.1.0-dev 2018/03/02 14:45:58.133 mod.rs:346: [INFO] Git Commit Hash: 7e9218fd5d2d74d4e718e10fe11d47871c48933a 2018/03/02 14:45:58.133 mod.rs:347: [INFO] Git Commit Branch: master 2018/03/02 14:45:58.133 mod.rs:348: [INFO] UTC Build Time: 2018-02-08 09:36:42 2018/03/02 14:45:58.133 mod.rs:349: [INFO] Rustc Version: 1.25.0-nightly (73ac5d6a8 2018-01-11) 2018/03/02 14:45:58.133 config.rs:723: [WARN] deprecated configuration, raftstore.region-max-size has been moved to coprocessor 2018/03/02 14:45:58.133 config.rs:728: [WARN] override coprocessor.region-max-size with raftstore.region-max-size, ReadableSize(83886080) 2018/03/02 14:45:58.133 config.rs:737: [WARN] deprecated configuration, raftstore.region-split-size has been moved to coprocessor 2018/03/02 14:45:58.134 config.rs:742: [WARN] override coprocessor.region-split-size with raftstore.region-split-size, ReadableSize(67108864) 2018/03/02 14:45:58.134 config.rs:110: [INFO] no advertise-addr is specified, fall back to addr. 2018/03/02 14:45:58.134 tikv-server.rs:503: [ERROR] invalid configuration: StringError("please specify pd.endpoints.")

多种改:pd ="192.168.21.190:2379,192.168.21.189:2379,192.168.21.187:2379" pd-endpoints ="192.168.21.190:2379,192.168.21.189:2379,192.168.21.187:2379" endpoints ="192.168.21.190:2379,192.168.21.189:2379,192.168.21.187:2379" 提示这个错误: 2018/03/02 14:45:58.134 tikv-server.rs:503: [ERROR] invalid configuration: StringError("please specify pd.endpoints.")

dbaspace avatar Mar 02 '18 06:03 dbaspace

请提供 TiKV 配置文件,启动命令及对应 tikv 日志

datahoecn avatar Mar 02 '18 08:03 datahoecn

pd ="192.168.21.190:2379,192.168.21.189:2379,192.168.21.187:2379" pd-endpoints ="192.168.21.190:2379,192.168.21.189:2379,192.168.21.187:2379" endpoints ="192.168.21.190:2379,192.168.21.189:2379,192.168.21.187:2379" /usr/local/tidb/bin/tikv-server --config=/usr/local/tidb/bin/tikv.toml 这么启动报错, 配置文件里 就是修改这3种 后面实在没办法就把[pd]的注释了 /usr/local/tidb/bin/tikv-server --config=/usr/local/tidb/bin/tikv.toml --pd="192.168.21.190:2379,192.168.21.189:2379,192.168.21.187:2379" & 这么启动.... 这是启动后配置文件 现在压缩参数也无法使用:#compression-per-level = "lz4:lz4:lz4:lz4:lz4:lz4:lz4" 这个开启也报错....

# TiKV config template
#  Human-readable big numbers: 
#   File size(based on byte): KB, MB, GB, TB, PB (or lowercase)
#    e.g.: 1_048_576 = "1MB"
#   Time(based on ms): ms, s, m, h
#    e.g.: 78_000 = "1.3m"

[server]
# set listening address.
addr = "192.168.21.187:20160"
# if not set, use addr instead. set advertise listening address for client communication.
advertise-addr = ""
# set the path to rocksdb directory.
store = "/data1/tidb/tikv/data"
# log level: trace, debug, info, warn, error, off.
log-level = "info"
log-file= "/data1/tidb/tikv/logs"
# notify capacity, 40960 is suitable for about 7000 regions.
notify-capacity = 40960
# maximum number of messages can be processed in one tick.
messages-per-tick = 4096
# socket send/recv buffer size.
send-buffer-size = "128KB"
recv-buffer-size = "128KB"
# size of thread pool for endpoint task
end-point-concurrency = 8

# set store capacity, if no set, use unlimited or disk size later.
# capacity = 0 # 0 is unlimited.

[metric]
# the Prometheus client push interval. Setting the value to 0s stops Prometheus client from pushing.
interval = "15s"
# the Prometheus pushgateway address. Leaving it empty stops Prometheus client from pushing.
address = ""
# the Prometheus client push job name. Note: A node id will automatically append, e.g., "tikv_1".
job = "tikv_187"

[raftstore]
# notify capacity, 40960 is suitable for about 7000 regions.
notify-capacity = 40960

# maximum number of messages can be processed in one tick.
messages-per-tick = 4096

# Region heartbeat tick interval for reporting to pd. 
pd-heartbeat-tick-interval = "60s"
# Store heartbeat tick interval for reporting to pd.
pd-store-heartbeat-tick-interval = "10s"

# When the region's size exceeds region-max-size, we will split the region 
# into two which the left region's size will be region-split-size or a little 
# bit smaller. 
region-max-size = "80MB"
region-split-size = "64MB"
# When region size changes exceeds region-split-check-diff, we should check 
# whether the region should be split or not. 
region-split-check-diff = "8MB"

# When a peer hasn't been active for max-peer-down-duration,
# we will consider this peer to be down and report it to pd.
max-peer-down-duration = "5m"

#[pd]
# pd endpoints 
#pd-endpoints = "192.168.21.190:2379,192.168.21.189:2379,192.168.21.187:2379"
#pd-endpoints = "192.168.21.190:2379,192.168.21.189:2379,192.168.21.187:2379"

[rocksdb]
# Maximum number of concurrent background compaction jobs, submitted to
# the default LOW priority thread pool.
max-background-compactions = 6

# Number of open files that can be used by the DB.  You may need to
# increase this if your database has a large working set. Value -1 means
# files opened are always kept open. You can estimate number of files based
# on target_file_size_base and target_file_size_multiplier for level-based
# compaction.
# If max-open-files = -1, RocksDB will prefetch index and filter blocks into
# block cache at startup, so if your database has a large working set, it will
# take several minutes to open the db.
max-open-files = 40960

# Max size of rocksdb's MANIFEST file.
# For detailed explanation please refer to https://github.com/facebook/rocksdb/wiki/MANIFEST
max-manifest-file-size = "20MB"

# If true, the database will be created if it is missing.
create-if-missing = true

# rocksdb wal recovery mode
# 0 : TolerateCorruptedTailRecords, tolerate incomplete record in trailing data on all logs;
# 1 : AbsoluteConsistency, We don't expect to find any corruption in the WAL;
# 2 : PointInTimeRecovery, Recover to point-in-time consistency;
# 3 : SkipAnyCorruptedRecords, Recovery after a disaster;
wal-recovery-mode = 2

# Rocksdb Statistics provides cumulative stats over time.
# Set it ture only when debugging performance, because it will introduce overhead.
enable-statistics = false

# Dump statistics periodically in information logs.
# Same as rocksdb's default value (10 min).
stats-dump-period-sec = 600

# Column Family default used to store actual data of the database.
[rocksdb.defaultcf]
# compression method (if any) is used to compress a block.
#   no:     kNoCompression
#   snappy: kSnappyCompression
#   zlib:   kZlibCompression
#   bzip2:  kBZip2Compression
#   lz4:    kLZ4Compression
#   lz4hc:  kLZ4HCCompression

# per level compression
#compression-per-level = "lz4:lz4:lz4:lz4:lz4:lz4:lz4"

# Approximate size of user data packed per block.  Note that the
# block size specified here corresponds to uncompressed data.
block-size = "64KB"

# If you're doing point lookups you definitely want to turn bloom filters on, We use
# bloom filters to avoid unnecessary disk reads. Default bits_per_key is 10, which
# yields ~1% false positive rate. Larger bits_per_key values will reduce false positive
# rate, but increase memory usage and space amplification.
bloom-filter-bits-per-key = 10

# false means one sst file one bloom filter, true means evry block has a corresponding bloom filter
block-based-bloom-filter = false

# Soft limit on number of level-0 files. We start slowing down writes at this point.
level0-slowdown-writes-trigger = 12

# Maximum number of level-0 files.  We stop writes at this point.
level0-stop-writes-trigger = 16

# Amount of data to build up in memory (backed by an unsorted log
# on disk) before converting to a sorted on-disk file.
write-buffer-size = "64MB"

# The maximum number of write buffers that are built up in memory.
max-write-buffer-number = 5

# The minimum number of write buffers that will be merged together
# before writing to storage.
min-write-buffer-number-to-merge = 1

# Control maximum total data size for base level (level 1).
max-bytes-for-level-base = "64MB"

# Target file size for compaction.
target-file-size-base = "16MB"

# block-cache used to cache uncompressed blocks, big block-cache can speed up read
block-cache-size = "1GB"

# options for Column Family write
# Column Family write used to store commit informations in MVCC model
[rocksdb.writecf]
#compression-per-level = "lz4:lz4:lz4:lz4:lz4:lz4:lz4"
block-size = "16KB"
write-buffer-size = "64MB"
max-write-buffer-number = 5
min-write-buffer-number-to-merge = 1
max-bytes-for-level-base = "64MB"
target-file-size-base = "16MB"
block-cache-size = "256MB"

# options for Column Family raft.
# Column Family raft is used to store raft log and raft states.
[rocksdb.raftcf]
#compression-per-level = "lz4:lz4:lz4:lz4:lz4:lz4:lz4"
block-size = "16KB"
write-buffer-size = "64MB"
max-write-buffer-number = 5
min-write-buffer-number-to-merge = 1
max-bytes-for-level-base = "64MB"
target-file-size-base = "16MB"
block-cache-size = "256MB"

[storage]
# notify capacity of scheduler's channel
scheduler-notify-capacity = 10240

# maximum number of messages can be processed in one tick
scheduler-messages-per-tick = 1024

scheduler-concurrency = 10240

# scheduler's worker pool size
scheduler-worker-pool-size = 4

dbaspace avatar Mar 02 '18 08:03 dbaspace

在数据同步中,TIDB作为SLAVE,稳定性非常不好,在MYSQL操作一些操作都会出问题,,还需要加强

dbaspace avatar Mar 02 '18 08:03 dbaspace

@dbaspace tikv 启动配置文件调用和命令调用效果一样,另外 tikv 配置文件 pd endpoint 格式需要增加中括考,如下:endpoints = ["http://192.168.56.12:2379"] ,压缩参数同样方式设置,遇到类似问题可尝试先分析,代码都是开源的,可以根据报错内容反查下源码,而且整个项目都有详细的参数配置示例,tikv 配置文件可参考:https://github.com/pingcap/tikv/blob/master/tests/config/test-custom.toml;关于数据同步, syncer 同步目前线上大量客户在用,现阶段比较稳定,需要根据具体问题进行分析,sync 参数或者 集群参数配置都有可能影响

datahoecn avatar Mar 02 '18 11:03 datahoecn

Closing this issue. If there is more question, please file a new issue.

QueenyJin avatar Nov 19 '18 07:11 QueenyJin