ansible 部署 4.0.0-beta.1 "config file ./tidb.toml contained unknown configuration options: max-index-length"

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

  • 【TiDB 版本】:4.0.0-beta.1
  • 【问题描述】:ansible 部署 4.0.0-beta.1 “config file ./tidb.toml contained unknown configuration options: max-index-length”

TASK [check_config_tidb : Check TiDB config] ************************************************************************************************************************************************************* fatal: [192.168.4.4]: FAILED! => changed=true cmd: cd /tmp/tidb_check_config && ./tidb-server -config ./tidb.toml -config-check delta: ‘0:00:00.102048’ end: ‘2020-03-08 17:35:37.155881’ msg: non-zero return code rc: 1 start: ‘2020-03-08 17:35:37.053833’ stderr: ‘’ stderr_lines: [] stdout: ‘[2020/03/08 17:35:37.154 +08:00] [FATAL] [terror.go:348] [“unexpected error”] [error=“config file ./tidb.toml contained unknown configuration options: max-index-length”] [stack=“github.com/pingcap/log.Fatal\n\t/home/jenkins/agent/workspace/tidb_v4.0.0-beta.1/go/pkg/mod/github.com/pingcap/log@v0.0.0-20200117041106-d28c14d3b1cd/global.go:59\ngithub.com/pingcap/parser/terror.MustNil\n\t/home/jenkins/agent/workspace/tidb_v4.0.0-beta.1/go/pkg/mod/github.com/pingcap/parser@v0.0.0-20200218113622-517beb2e39c2/terror/terror.go:348\ngithub.com/pingcap/tidb/config.InitializeConfig\n\t/home/jenkins/agent/workspace/tidb_v4.0.0-beta.1/go/src/github.com/pingcap/tidb/config/config.go:692\nmain.main\n\t/home/jenkins/agent/workspace/tidb_v4.0.0-beta.1/go/src/github.com/pingcap/tidb/tidb-server/main.go:160\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203”]’ stdout_lines: to retry, use: --limit @/home/tidb/tidb-ansible/retry_files/deploy.retry

若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

自己回复下,屏蔽了该参数 /home/tidb/tidb-ansible/roles/check_config_tidb/tasks/main.yml 中

  • name: Create configuration file template: src={{ playbook_dir }}/roles/tidb/templates/tidb.toml.j2 dest={{ tidb_check_dir }}/tidb.toml mode=0644 backup=yes

然后到 /home/tidb/tidb-ansible/roles/tidb/templates/tidb.toml.j2 中顶部看到

TiDB Configuration.

{% for item, value in tidb_conf.global | dictsort -%} {{ item }} = {{ value | to_json }} {% endfor %}

那么找到tidb_conf.global变量

到 /home/tidb/tidb-ansible/roles/tidb/vars/default.yml 注释掉max-index-length

:+1: