[转帖]PD Config Learn the PD configuration file

pd,config,learn,the,configuration,file · 浏览次数 : 0

小编点评

**排版指令:** * 使用缩进符号缩短字符串。 * 使用空格缩进字符串。 * 使用行缩进缩进字符串。 **排版示例:** ``` # region score formula version region-score-formula-version = v2 # enable joint consensus enable-joint-consensus = true # allow placement rules allow-placement-rules = true # enable placement rules allow-placement-rules = false # enable synchronous replication in PD enable-synchronous-replication = true ``` **注意:** * 以上指令仅供示例,可能需要根据您的实际配置进行调整。 * 使用上述指令时,需要确保您的代码块格式正确。 * 使用排版指令时,请确保代码块格式正确。

正文

The PD configuration file supports more options than command-line parameters. You can find the default configuration file here.

This document only describes parameters that are not included in command-line parameters. Check here for the command line parameters.

name

  • The unique name of a PD node
  • Default value: "pd"
  • To start multiply PD nodes, use a unique name for each node.

data-dir

  • The directory in which PD stores data
  • Default value: default.${name}"

client-urls

  • The list of client URLs to be listened to by PD
  • Default value: "http://127.0.0.1:2379"
  • When you deploy a cluster, you must specify the IP address of the current host as client-urls (for example, "http://192.168.100.113:2379"). If the cluster runs on Docker, specify the IP address of Docker as "http://0.0.0.0:2379".
  • The list of advertise URLs for the client to access PD
  • Default value: "${client-urls}"
  • In some situations such as in the Docker or NAT network environment, if a client cannot access PD through the default client URLs listened to by PD, you must manually set the advertise client URLs.
  • For example, the internal IP address of Docker is 172.17.0.1, while the IP address of the host is 192.168.100.113 and the port mapping is set to -p 2380:2380. In this case, you can set advertise-client-urls to "http://192.168.100.113:2380". The client can find this service through "http://192.168.100.113:2380".

peer-urls

  • The list of peer URLs to be listened to by a PD node
  • Default value: "http://127.0.0.1:2380"
  • When you deploy a cluster, you must specify peer-urls as the IP address of the current host, such as "http://192.168.100.113:2380". If the cluster runs on Docker, specify the IP address of Docker as "http://0.0.0.0:2380".
  • The list of advertise URLs for other PD nodes (peers) to access a PD node
  • Default: "${peer-urls}"
  • In some situations such as in the Docker or NAT network environment, if the other nodes (peers) cannot access the PD node through the default peer URLs listened to by this PD node, you must manually set the advertise peer URLs.
  • For example, the internal IP address of Docker is 172.17.0.1, while the IP address of the host is 192.168.100.113 and the port mapping is set to -p 2380:2380. In this case, you can set advertise-peer-urls to "http://192.168.100.113:2380". The other PD nodes can find this service through "http://192.168.100.113:2380".

initial-cluster

  • The initial cluster configuration for bootstrapping

  • Default value: "{name}=http://{advertise-peer-url}"

  • For example, if name is “pd”, and advertise-peer-urls is "http://192.168.100.113:2380", the initial-cluster is "pd=http://192.168.100.113:2380".

  • If you need to start three PD servers, the initial-cluster might be:

    pd1=http://192.168.100.113:2380, pd2=http://192.168.100.114:2380, pd3=192.168.100.115:2380
    

initial-cluster-state

  • The initial state of the cluster
  • Default value: "new"

initial-cluster-token

  • Identifies different clusters during the bootstrap phase.
  • Default value: "pd-cluster"
  • If multiple clusters that have nodes with same configurations are deployed successively, you must specify different tokens to isolate different cluster nodes.

lease

  • The timeout of the PD Leader Key lease. After the timeout, the system re-elects a Leader.
  • Default value: 3
  • Unit: second

tso-save-interval

  • The interval for PD to allocate TSOs for persistent storage in etcd
  • Default value: 3
  • Unit: second

enable-prevote

  • Enables or disables raft prevote
  • Default value: true

quota-backend-bytes

  • The storage size of the meta-information database, which is 8GiB by default
  • Default value: 8589934592

auto-compaction-mod

  • The automatic compaction modes of the meta-information database
  • Available options: periodic (by cycle) and revision (by version number).
  • Default value: periodic

auto-compaction-retention

  • The time interval for automatic compaction of the meta-information database when auto-compaction-retention is periodic. When the compaction mode is set to revision, this parameter indicates the version number for the automatic compaction.
  • Default value: 1h

force-new-cluster

  • Determines whether to force PD to start as a new cluster and modify the number of Raft members to 1
  • Default value: false

tick-interval

  • The tick period of etcd Raft
  • Default value: 100ms

election-interval

  • The timeout for the etcd leader election
  • Default value: 3s

use-region-storage

  • Enables or disables independent Region storage
  • Default value: false

security

Configuration items related to security

cacert-path

  • The path of the CA file
  • Default value: "”

cert-path

  • The path of the Privacy Enhanced Mail (PEM) file that contains the X509 certificate
  • Default value: "”

key-path

  • The path of the PEM file that contains the X509 key
  • Default value: "”

redact-info-log

  • Controls whether to enable log redaction in the PD log.
  • When you set the configuration value to true, user data is redacted in the PD log.
  • Default value: false

log

Configuration items related to log

format

  • The log format, which can be specified as “text”, “json”, or “console”
  • Default value: text

disable-timestamp

  • Whether to disable the automatically generated timestamp in the log
  • Default value: false

log.file

Configuration items related to the log file

max-size

  • The maximum size of a single log file. When this value is exceeded, the system automatically splits the log into several files.
  • Default value: 300
  • Unit: MiB
  • Minimum value: 1

max-days

  • The maximum number of days in which a log is kept
  • Default value: 28
  • Minimum value: 1

max-backups

  • The maximum number of log files to keep
  • Default value: 7
  • Minimum value: 1

metric

Configuration items related to monitoring

interval

  • The interval at which monitoring metric data is pushed to Prometheus
  • Default value: 15s

schedule

Configuration items related to scheduling

max-merge-region-size

  • Controls the size limit of Region Merge. When the Region size is greater than the specified value, PD does not merge the Region with the adjacent Regions.
  • Default value: 20

max-merge-region-keys

  • Specifies the upper limit of the Region Merge key. When the Region key is greater than the specified value, the PD does not merge the Region with its adjacent Regions.
  • Default value: 200000

patrol-region-interval

  • Controls the running frequency at which replicaChecker checks the health state of a Region. The smaller this value is, the faster replicaChecker runs. Normally, you do not need to adjust this parameter.
  • Default value: 100ms

split-merge-interval

  • Controls the time interval between the split and merge operations on the same Region. That means a newly split Region will not be merged for a while.
  • Default value: 1h

max-snapshot-count

  • Control the maximum number of snapshots that a single store receives or sends at the same time. PD schedulers depend on this configuration to prevent the resources used for normal traffic from being preempted.
  • Default value value: 3

max-pending-peer-count

  • Controls the maximum number of pending peers in a single store. PD schedulers depend on this configuration to prevent too many Regions with outdated logs from being generated on some nodes.
  • Default value: 16

max-store-down-time

  • The downtime after which PD judges that the disconnected store can not be recovered. When PD fails to receive the heartbeat from a store after the specified period of time, it adds replicas at other nodes.
  • Default value: 30m

leader-schedule-limit

  • The number of Leader scheduling tasks performed at the same time
  • Default value: 4

region-schedule-limit

  • The number of Region scheduling tasks performed at the same time
  • Default value: 2048

hot-region-schedule-limit

  • Controls the hot Region scheduling tasks that are running at the same time. It is independent of the Region scheduling.
  • Default value: 4

hot-region-cache-hits-threshold

  • The threshold used to set the number of minutes required to identify a hot Region. PD can participate in the hotspot scheduling only after the Region is in the hotspot state for more than this number of minutes.
  • Default value: 3

replica-schedule-limit

  • The number of Replica scheduling tasks performed at the same time
  • Default value: 64

merge-schedule-limit

  • The number of the Region Merge scheduling tasks performed at the same time. Set this parameter to 0 to disable Region Merge.
  • Default value: 8

high-space-ratio

  • The threshold ratio below which the capacity of the store is sufficient. If the space occupancy ratio of the store is smaller than this threshold value, PD ignores the remaining space of the store when performing scheduling, and balances load mainly based on the Region size. This configuration takes effect only when region-score-formula-version is set to v1.
  • Default value: 0.7
  • Minimum value: greater than 0
  • Maximum value: less than 1

low-space-ratio

  • The threshold ratio above which the capacity of the store is insufficient. If the space occupancy ratio of a store exceeds this threshold value, PD avoids migrating data to this store as much as possible. Meanwhile, to avoid the disk space of the corresponding store being exhausted, PD performs scheduling mainly based on the remaining space of the store.
  • Default value: 0.8
  • Minimum value: greater than 0
  • Maximum value: less than 1

tolerant-size-ratio

  • Controls the balance buffer size
  • Default value: 0 (automatically adjusts the buffer size)
  • Minimum value: 0

enable-cross-table-merge

  • Determines whether to enable the merging of cross-table Regions
  • Default value: true

region-score-formula-version

  • Controls the version of the Region score formula
  • Default value: v2
  • Optional values: v1 and v2

disable-remove-down-replica

  • Determines whether to disable the feature that automatically removes DownReplica. When this parameter is set to true, PD does not automatically clean up the copy in the down state.
  • Default value: false

disable-replace-offline-replica

  • Determines whether to disable the feature that migrates OfflineReplica. When this parameter is set to true, PD does not migrate the replicas in the offline state.
  • Default value: false

disable-make-up-replica

  • Determines whether to disable the feature that automatically supplements replicas. When this parameter is set to true, PD does not supplement replicas for the Region with insufficient replicas.
  • Default value: false

disable-remove-extra-replica

  • Determines whether to disable the feature that removes extra replicas. When this parameter is set to true, PD does not remove the extra replicas from the Region with excessive replicas.
  • Default value: false

disable-location-replacement

  • Determines whether to disable isolation level check. When this parameter is set to true, PD does not increase the isolation level of the Region replicas through scheduling.
  • Default value: false

store-balance-rate

  • Determines the maximum number of operations related to adding peers within a minute
  • Type: Integer
  • Default value: 15
  • Minimum value: 0
  • Maximum value: 200

enable-joint-consensus

  • Controls whether to use Joint Consensus for replica scheduling. If this configuration is disabled, PD schedules one replica at a time.
  • Default value: true

replication

Configuration items related to replicas

max-replicas

  • The number of replicas
  • Default value: 3

location-labels

isolation-level

strictly-match-label

  • Enables the strict check for whether the TiKV label matches PD’s location-labels.
  • Default value: false

enable-placement-rules

  • Enables placement-rules.
  • Default value: false
  • See Placement Rules.
  • An experimental feature of TiKV 4.0.

label-property

Configuration items related to labels

key

  • The label key for the store that rejected the Leader
  • Default value: ""

value

  • The label value for the store that rejected the Leader
  • Default value: ""

replication-mode

Configuration items related to the replication mode of all Regions. See Enable synchronous replication in PD configuration file for details.

与[转帖]PD Config Learn the PD configuration file相似的内容:

[转帖]PD Config Learn the PD configuration file

The PD configuration file supports more options than command-line parameters. You can find the default configuration file here. This document only des

[转帖]PD 配置文件描述

https://docs.pingcap.com/zh/tidb/stable/pd-configuration-file PD 配置文件比命令行参数支持更多的选项。你可以在 conf/config.toml 找到默认的配置文件。 本文档只阐述未包含在命令行参数中的参数,命令行参数参见 PD 配置参

[转帖]TiDB-merge region相关问题

一、开启region merge # 控制 Region Merge 的 size 上限,当 Region Size 大于指定值时 PD 不会将其与相邻的 Region 合并 pd-ctl config set max-merge-region-size 20 # 控制 Region Merge 的

[转帖]在线修改集群配置

https://docs.pingcap.com/zh/tidb/stable/dynamic-config 在线配置变更主要是通过利用 SQL 对包括 TiDB、TiKV 以及 PD 在内的各组件的配置进行在线更新。用户可以通过在线配置变更对各组件进行性能调优而无需重启集群组件。但目前在线修改 T

[转帖]在线修改集群配置

https://docs.pingcap.com/zh/tidb/stable/dynamic-config 在线配置变更主要是通过利用 SQL 对包括 TiDB、TiKV 以及 PD 在内的各组件的配置进行在线更新。用户可以通过在线配置变更对各组件进行性能调优而无需重启集群组件。但目前在线修改 T

[转帖]在线修改集群配置

https://docs.pingcap.com/zh/tidb/stable/dynamic-config 在线配置变更主要是通过利用 SQL 对包括 TiDB、TiKV 以及 PD 在内的各组件的配置进行在线更新。用户可以通过在线配置变更对各组件进行性能调优而无需重启集群组件。但目前在线修改 T

[转帖]PD Control 使用说明

https://docs.pingcap.com/zh/tidb/stable/pd-control PD Control 是 PD 的命令行工具,用于获取集群状态信息和调整集群。 安装方式 注意 建议使用的 Control 工具版本与集群版本保持一致。 使用 TiUP 可直接通过 tiup ctl

[转帖]PD Control 使用说明

https://docs.pingcap.com/zh/tidb/stable/pd-control PD Control 是 PD 的命令行工具,用于获取集群状态信息和调整集群。 安装方式 注意 建议使用的 Control 工具版本与集群版本保持一致。 使用 TiUP 可直接通过 tiup ctl

[转帖]PD Control 使用说明

https://docs.pingcap.com/zh/tidb/stable/pd-control PD Control 是 PD 的命令行工具,用于获取集群状态信息和调整集群。 安装方式 注意 建议使用的 Control 工具版本与集群版本保持一致。 使用 TiUP 可直接通过 tiup ctl

[转帖]058、集群优化之PD

PD调度基本概念 调度流程 调度中还有这还缺来了merge,例如合并空region。 store: 基本信息,容量,剩余空间,读写流量等 region: 范围,副本分布,副本状态,数据量,读写流量等 相关调度说明 balance-leader-scheduler: 保持不同节点的leader均衡ba