【问题标题】:tidb-ansible error in ansible-playbook bootstrap.yml commandansible-playbook bootstrap.yml 命令中的 tidb-ansible 错误
【发布时间】:2020-03-29 20:41:27
【问题描述】:

我正在尝试通过 TiDB ansible 安装 TiDB。我指的是https://pingcap.com/docs/v1.0/op-guide/ansible-deployment/ 中的文档,在此过程中,我遇到了命令 ansible-playbook bootstrap.yml 的以下错误。虽然磁盘未满,但我收到磁盘已满错误。请让我知道修复错误的步骤。谢谢!

    [root@fm42cephnode005 tidb-ansible-master]# df -h
    Filesystem      Size  Used Avail Use% Mounted on
    devtmpfs         94G     0   94G   0% /dev
    tmpfs            94G     0   94G   0% /dev/shm
    tmpfs            94G   12M   94G   1% /run
    tmpfs            94G     0   94G   0% /sys/fs/cgroup
    /dev/sdg5       239G  5.2G  222G   3% /
    /dev/sdg3       123G  1.8G  115G   2% /home
    /dev/sdg2      1014M  257M  758M  26% /boot
    /dev/sdg1       200M   12M  189M   6% /boot/efi
    tmpfs            19G   20K   19G   1% /run/user/42
    tmpfs            19G     0   19G   0% /run/user/0
    /dev/nvme3n1    1.5T   77M  1.4T   1% /home/tidbdeployment

[root@fm42cephnode005 tidb-ansible-master]# ansible-playbook bootstrap.yml

PLAY [initializing deployment target] **********************************************************************************************************************************************************************

TASK [check_config_static : Ensure TiDB host exists] *******************************************************************************************************************************************************

TASK [check_config_static : Ensure PD host exists] *********************************************************************************************************************************************************

TASK [check_config_static : Ensure TiKV host exists] *******************************************************************************************************************************************************

TASK [check_config_static : Check ansible_user variable] ***************************************************************************************************************************************************

TASK [check_config_static : Ensure timezone variable is set] ***********************************************************************************************************************************************

TASK [check_config_static : Close old SSH control master processes] ****************************************************************************************************************************************
ok: [localhost]

TASK [check_config_static : Check ansible version] *********************************************************************************************************************************************************

TASK [check_config_static : Check if jmespath installed] ***************************************************************************************************************************************************
changed: [localhost]

TASK [check_config_static : Check if jinja2 installed] *****************************************************************************************************************************************************
changed: [localhost]

TASK [check_config_static : Preflight check - Fail when jmespath or jinja2 isn't installed] ****************************************************************************************************************

TASK [check_config_static : Get jmespath info] *************************************************************************************************************************************************************
changed: [localhost]

TASK [check_config_static : Get jmespath version] **********************************************************************************************************************************************************
ok: [localhost]

TASK [check_config_static : Get jinja2 info] ***************************************************************************************************************************************************************
changed: [localhost]

TASK [check_config_static : Get jinja2 version] ************************************************************************************************************************************************************
ok: [localhost]

TASK [check_config_static : Preflight check - Fail when the versions of jmespath and jinja2 doesn't meet the requirements] *********************************************************************************

TASK [check_config_static : Check inventory configuration] *************************************************************************************************************************************************
changed: [localhost]

TASK [check_config_static : Preflight check - If the inventory configuration is correct] *******************************************************************************************************************

PLAY [check node config] ***********************************************************************************************************************************************************************************

TASK [pre-ansible : disk space check - fail when disk is full] *********************************************************************************************************************************************
fatal: [localhost]: FAILED! =>
  msg: |-
    The conditional check ' '100%' in disk_space_st.stdout ' failed. The error was: error while evaluating conditional ( '100%' in disk_space_st.stdout ): Unable to look up a name or access an attribute in template string ({% if  '100%' in disk_space_st.stdout  %} True {% else %} False {% endif %}).
    Make sure your variable name does not contain invalid characters like '-': argument of type 'StrictUndefined' is not iterable
        to retry, use: --limit @/home/tidb-ansible-master/retry_files/bootstrap.retry

PLAY RECAP *************************************************************************************************************************************************************************************************
localhost                  : ok=8    changed=5    unreachable=0    failed=1


ERROR MESSAGE SUMMARY **************************************************************************************************************************************************************************************
[localhost]: Ansible Failed! ==>

  msg: |-
    The conditional check ' '100%' in disk_space_st.stdout ' failed. The error was: error while evaluating conditional ( '100%' in disk_space_st.stdout ): Unable to look up a name or access an attribute in template string ({% if  '100%' in disk_space_st.stdout  %} True {% else %} False {% endif %}).
    Make sure your variable name does not contain invalid characters like '-': argument of type 'StrictUndefined' is not iterable

【问题讨论】:

  • 嗨 pragathi,欢迎来到 SO。您没有收到“磁盘已满错误”,而是收到了 ansible 错误;在不知道确切的ansible版本的情况下,很难重现您的错误,但至少在ansible 2.9上不会发生该错误,因此如果可能,请尝试更新到最新版本
  • 你好 Daniel,我使用的是 ansible vesion 2.7.11。我一开始安装的是 2.9 版本,和这个 TiDB 版本不兼容。因此我不得不使用 2.7.11。如果您对如何解决此问题有任何想法,请告诉我。谢谢

标签: error-handling installation ansible disk tidb


【解决方案1】:

这是使用df -h. | tail -n1命令来确定inventory.ini中所有机器的ansible_user对应的主目录分区的空间使用情况。发生错误时,分区使用率可能为 100%。如果确认还有空间,请重试。

【讨论】:

  • 我正在尝试仅在 localhost 上安装 TiDB(因此 inventory.ini 仅具有 localhost)。主目录中 tidbuser 的 df -h 显示该目录的利用率仅为 2%。但是,在运行相同的命令时会返回相同的错误。你知道为什么吗?
猜你喜欢
  • 2020-03-28
  • 2019-11-21
  • 2013-12-09
  • 1970-01-01
  • 2016-08-18
  • 2017-09-18
  • 1970-01-01
  • 1970-01-01
  • 2020-09-07
相关资源
最近更新 更多