tidb-v5.4 caused by: yaml: line 4: did not find expected key

# Global variables are applied to all deployments and used as the default value of

# the deployments if a specific deployment value is missing.

global:
user: “tidb”
ssh_port: 22
deploy_dir: “/data/tidb-deploy”
data_dir: “/data/tidb-data”

server_configs:
tidb:
log.slow-threshold: 300
tikv:
readpool.storage.use-unified-pool: false
readpool.coprocessor.use-unified-pool: true
pd:
replication.enable-placement-rules: true
tiflash:
profiles.default.max_memory_usage: 0
profiles.default.max_memory_usage_for_all_queries: 0
pd_servers:

  • host: 10.72.32.101
  • host: 10.72.32.102
  • host: 10.72.32.103
    tidb_servers:
  • host: 10.72.32.101
  • host: 10.72.32.102
  • host: 10.72.32.103
    tikv_servers:
  • host: 10.72.32.104
  • host: 10.72.32.105
  • host: 10.72.32.106
  • host: 10.72.32.107
  • host: 10.72.32.108
    tiflash_servers:
  • host: 10.72.32.109
    data_dir: /data/tiflash/data
    deploy_dir: /data/tiflash/deploy
    monitoring_servers:
  • host: 10.72.32.110

grafana_servers:

  • host: 10.72.32.110

alertmanager_servers:

  • host: 10.72.32.111

[tidb@test11 ~]$ vi topology.yaml
[tidb@test11 ~]$ tiup cluster check ./topology.yaml --apply --user tidb
tiup is checking updates for component cluster …
Starting component cluster: /home/tidb/.tiup/components/cluster/v1.9.0/tiup-cluster /home/tidb/.tiup/components/cluster/v1.9.0/tiup-cluster check ./topology.yaml --apply --user tidb

Error: Failed to parse topology file ./topology.yaml (topology.parse_failed)
caused by: yaml: line 4: did not find expected key

Please check the syntax of your topology file ./topology.yaml and try again.

[tidb@test11 ~]$

Error: Failed to parse topology file ./topology.yaml (topology.parse_failed)
caused by: yaml: line 4: did not find expected key

第四行是啥?

你贴出来的格式都不对了,没发看

第四行是user: "tidb"吧,看起来没什么问题,注意下是不是有特殊字符之类导致的

是的

这是啥格式?这个换行不对吧?缩进类似这样的:
image

1 个赞

这缩进明显不对,先set paste下在粘贴

1 个赞

到官网重新生成一下,可以检测通过了

好的,之前是复制粘贴进去的吧,Vim 有自动缩进,应该是这个导致的。

重新生成一下把

cpu-governor Warn Unable to determine current CPU frequency governor policy
disk Warn mount point / does not have ‘noatime’ option set, auto fixing not supported
这两个warn,如何解决?

这个是系统参数配置的警告,cpufreq和IO调度器参数设置,参考下这里
https://docs.pingcap.com/zh/tidb/stable/check-before-deployment#%E6%A3%80%E6%9F%A5%E5%92%8C%E9%85%8D%E7%BD%AE%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E4%BC%98%E5%8C%96%E5%8F%82%E6%95%B0

[tidb@test11 ~]$ tiup cluster display tidb-test
tiup is checking updates for component cluster …
Starting component cluster: /home/tidb/.tiup/components/cluster/v1.9.0/tiup-cluster /home/tidb/.tiup/components/cluster/v1.9.0/tiup-cluster display tidb-test
Cluster type: tidb
Cluster name: tidb-test
Cluster version: v5.4.0
Deploy user: tidb
SSH type: builtin
Dashboard URL: http://10.72.32.102:2379/dashboard
ID Role Host Ports OS/Arch Status Data Dir Deploy Dir


10.82.32.111:9093 alertmanager 10.72.32.111 9093/9094 linux/x86_64 Up /data/tidb-data/alertmanager-9093 /date/tidb-deploy/alertmanager-9093
10.82.32.110:3000 grafana 10.72.32.110 3000 linux/x86_64 Up - /date/tidb-deploy/grafana-3000
10.82.32.101:2379 pd 10.72.32.101 2379/2380 linux/x86_64 Up /data/tidb-data/pd-2379 /date/tidb-deploy/pd-2379
10.82.32.102:2379 pd 10.72.32.102 2379/2380 linux/x86_64 Up|UI /data/tidb-data/pd-2379 /date/tidb-deploy/pd-2379
10.82.32.103:2379 pd 10.72.32.103 2379/2380 linux/x86_64 Up|L /data/tidb-data/pd-2379 /date/tidb-deploy/pd-2379
10.82.32.109:9090 prometheus 10.72.32.109 9090/12020 linux/x86_64 Up /data/tidb-data/prometheus-9090 /date/tidb-deploy/prometheus-9090
10.82.32.101:4000 tidb 10.72.32.101 4000/10080 linux/x86_64 Up - /date/tidb-deploy/tidb-4000
10.82.32.102:4000 tidb 10.72.32.102 4000/10080 linux/x86_64 Up - /date/tidb-deploy/tidb-4000
10.82.32.103:4000 tidb 10.72.32.103 4000/10080 linux/x86_64 Up - /date/tidb-deploy/tidb-4000
10.82.32.107:9000 tiflash 10.72.32.107 9000/8123/3930/20170/20292/8234 linux/x86_64 Up /data/tidb-data/tiflash-9000 /date/tidb-deploy/tiflash-9000
10.82.32.108:9000 tiflash 10.72.32.108 9000/8123/3930/20170/20292/8234 linux/x86_64 Up /data/tidb-data/tiflash-9000 /date/tidb-deploy/tiflash-9000
10.82.32.104:20160 tikv 10.72.32.104 20160/20180 linux/x86_64 Up /data/tidb-data/tikv-20160 /date/tidb-deploy/tikv-20160
10.82.32.105:20160 tikv 10.72.32.105 20160/20180 linux/x86_64 Up /data/tidb-data/tikv-20160 /date/tidb-deploy/tikv-20160
10.82.32.106:20160 tikv 10.72.32.106 20160/20180 linux/x86_64 Up /data/tidb-data/tikv-20160 /date/tidb-deploy/tikv-20160
Total nodes: 14
[tidb@test11 ~]$

部署完成之后,需要上传一个mysql client ,进行连接Mysql shell ??

直接yum一个也行

[tidb@test11 ~]$ mysql -u root -h 10.72.32.101 -P 4000 -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.7.25-TiDB-v5.4.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible

Copyright © 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MySQL [(none)]> show databases;
±-------------------+
| Database |
±-------------------+
| INFORMATION_SCHEMA |
| METRICS_SCHEMA |
| PERFORMANCE_SCHEMA |
| mysql |
| test |
±-------------------+
5 rows in set (0.00 sec)

MySQL [(none)]>
MySQL [(none)]> select “多谢!”;
±--------+
| 多谢! |
±--------+
| 多谢! |
±--------+
1 row in set (0.00 sec)

如何清理环境。
重新执行部署?
tiup cluster deploy tidb-qas v5.4.0 ./topology.yaml --user tidb

先销毁集群, 注意销毁集群操作会关闭服务,清空数据目录和部署目录,并且无法恢复,需要 谨慎操作

tiup cluster destroy ${cluster-name}
1 个赞

tiup cluster start tidb-xx --init 已解决

用的是普通启动方式还是安全方式,不加
--init的话默认没密码

1 个赞

好的:+1:

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。