Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: Tiup 报错
When deploying with tiup, an error occurs:
The error is at line 38:
Delete the value at line 38:
Then execute tiup:
No problem.
Check if the settings of location-labels correspond to the keys of TiKV labels.
You need to check the configuration file and see if the indentation in the modified yml file is correct. If the error still exists, you can use a command to regenerate it.
Both the location-labels
parameter in PD and the labels
parameter in TiKV must be configured simultaneously; otherwise, PD will not schedule based on the topology.
The configuration on PD is called location-labels
, which is an array of strings. Each item in this configuration corresponds to the key in TiKV labels
, and the order of each key represents the hierarchical relationship of different labels (from left to right, the isolation level decreases sequentially).
location-labels
has no default value, and you can set it according to specific needs, including zone
, rack
, host
, etc. Additionally, there is no limit on the number of label levels for location-labels
(i.e., it is not limited to 3). As long as the levels match the labels of the TiKV servers, the configuration can be successful.
Reference: 通过拓扑 label 进行副本调度 | PingCAP 文档中心
Correct configuration:
server_configs:
pd:
replication.location-labels: [“az”, “replication zone”, “rack”, “host”]
I compared the situations of deleting the value and not deleting the value. After deleting it, there is no problem, but if I don’t delete it, an error occurs. There are no other modifications involved either.
I keep getting syntax errors.
It seems that there is always an error reporting a YAML syntax error. It’s really strange, and the error message is quite ridiculous.
The format requirements for this configuration file are quite strict; even an extra or missing space won’t work. Send your parameter file as an attachment so I can take a look.
I deleted the “- host” in this place, and it worked. The deployment is successful now. Thank you.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.