TiDB兼容安装-ansible-playbook local_prepare.yml命令失败

我正在尝试使用tidb ansible在单个节点上安装tidb。我在清单.ini文件中为PD,TiDB和TiKV服务器设置了正确的IP地址。我正在按照https://pingcap.com/docs/v1.0/op-guide/ansible-deployment/中的说明进行操作。但是,我遇到以下命令错误:ansible-playbook local_prepare.yml。 Ansible抱怨旧版本,尽管是最新的Ansible版本。如果有人可以帮助我安装TiDB,那将是非常不错的

    [root@fm42cephnode005 tidb-ansible-master]# ansible --version
    ansible 2.9.1
      config file = /home/tidb-ansible-master/ansible.cfg
      configured module search path = [u'/root/.ansible/plugins/modules',u'/usr/share/ansible/plugins/modules']
      ansible python module location = /usr/lib/python2.7/site-packages/ansible
      executable location = /usr/bin/ansible
      python version = 2.7.5 (default,Aug  7 2019,00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]


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

    PLAY [do local preparation] ********************************************************************************************************************************************************************************

    TASK [local : Stop if ansible version is too low,make sure that the Ansible version is Ansible 2.4.2 or later,otherwise a compatibility issue occurs.] ***************************************************
    fatal: [localhost]: FAILED! =>
      msg: 'The conditional check ''ansible_version.full|version_compare(''2.4.2'',''>='')'' failed. The error was: template error while templating string: no filter named ''version_compare''. String: {% if ansible_version.full|version_compare(''2.4.2'',''>='') %} True {% else %} False {% endif %}'
    Traceback (most recent call last):
      File "/usr/lib64/python2.7/logging/__init__.py",line 851,in emit
        msg = self.format(record)
      File "/usr/lib64/python2.7/logging/__init__.py",line 724,in format
        return fmt.format(record)
      File "/usr/lib64/python2.7/logging/__init__.py",line 467,in format
        s = self._fmt % record.__dict__
    KeyError: 'user'
    Logged from file help.py,line 111

    PLAY RECAP *************************************************************************************************************************************************************************************************
    localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0


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

      msg: 'The conditional check ''ansible_version.full|version_compare(''2.4.2'',''>='') %} True {% else %} False {% endif %}'
liuchongjun217 回答:TiDB兼容安装-ansible-playbook local_prepare.yml命令失败

  • 这是因为ansible版本不兼容,请使用pip install -r ./requirements.txt进行安装,requirements.txt文件位于tidb-ansible目录中。

    注意:安装前,您需要先卸载现有的ansible

  • ansible_version.full|version_compare('2.4.2','>=')应该在ansible版本更新但不兼容时进行优化。

本文链接:https://www.f2er.com/2981537.html

大家都在问