使用tidb-ansible部署v4.0.0 ARM64平台【Get systemd version】模块报错

错误信息如下:

TASK [check_system_static : Get systemd version] ****************************************************************************
fatal: [10.10.50.233]: FAILED! => changed=false
  module_stderr: |-
    Shared connection to 10.10.50.233 closed.
  module_stdout: |-
    Traceback (most recent call last):
      File "/home/tidb/.ansible/tmp/ansible-tmp-1590731369.1-185594839585333/AnsiballZ_yum.py", line 113, in <module>
        _ansiballz_main()
      File "/home/tidb/.ansible/tmp/ansible-tmp-1590731369.1-185594839585333/AnsiballZ_yum.py", line 105, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/tidb/.ansible/tmp/ansible-tmp-1590731369.1-185594839585333/AnsiballZ_yum.py", line 48, in invoke_module
        imp.load_module('__main__', mod, module, MOD_DESC)
      File "/tmp/ansible_yum_payload_c2WMr6/__main__.py", line 1588, in <module>
      File "/tmp/ansible_yum_payload_c2WMr6/__main__.py", line 1584, in main
      File "/tmp/ansible_yum_payload_c2WMr6/__main__.py", line 1516, in run
      File "/tmp/ansible_yum_payload_c2WMr6/__main__.py", line 815, in list_stuff
      File "/tmp/ansible_yum_payload_c2WMr6/__main__.py", line 756, in pkg_to_dict
    ValueError: need more than 1 value to unpack
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

您好,请确认下 inventory.ini 文件中的已经设置了 arm64

cpu_architecture = arm64

如果还有报错,麻烦上传下 inventory.ini 文件

另外在执行部署操作时,加上 -vvvv 选项,并上传具体的报错日志

inventory.ini

## Group variables
[pd_servers:vars]
# location_labels = ["zone","rack","host"]

## Global variables
[all:vars]
deploy_dir = /home/tidb/deploy

## Connection
# ssh via normal user
ansible_user = tidb

cluster_name = test-cluster

# CPU architecture: amd64, arm64
cpu_architecture = arm64

tidb_version = v4.0.0-rc

# process supervision, [systemd, supervise]
process_supervision = systemd

timezone = Asia/Shanghai

enable_firewalld = False
# check NTP service
enable_ntpd = True
set_hostname = False

## binlog trigger
enable_binlog = False

# kafka cluster address for monitoring, example:
# kafka_addrs = "192.168.0.11:9092,192.168.0.12:9092,192.168.0.13:9092"
kafka_addrs = ""

# zookeeper address of kafka cluster for monitoring, example:
# zookeeper_addrs = "192.168.0.11:2181,192.168.0.12:2181,192.168.0.13:2181"
zookeeper_addrs = ""

# enable TLS authentication in the TiDB cluster
enable_tls = False

# KV mode
deploy_without_tidb = False

# wait for region replication complete before start tidb-server.
wait_replication = True

# Optional: Set if you already have a alertmanager server.
# Format: alertmanager_host:alertmanager_port
alertmanager_target = ""

确认cpu_architecture = arm64

下面是-vvvv的具体报错信息:

TASK [check_system_static : Get systemd version] *****************************************************************************************************************************************************************************************
task path: /opt/tidb-ansible-v4.0.0-rc-arm64/roles/check_system_static/tasks/main.yml:22
<10.10.50.233> ESTABLISH SSH CONNECTION FOR USER: tidb
<10.10.50.233> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=tidb -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/4d08168bb5 10.10.50.233 '/bin/sh -c '"'"'echo ~tidb && sleep 0'"'"''
<10.10.50.233> (0, '/home/tidb\
', '')
<10.10.50.233> ESTABLISH SSH CONNECTION FOR USER: tidb
<10.10.50.233> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=tidb -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/4d08168bb5 10.10.50.233 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220 `" && echo ansible-tmp-1590732488.6-159448594352220="` echo /home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220 `" ) && sleep 0'"'"''
<10.10.50.233> (0, 'ansible-tmp-1590732488.6-159448594352220=/home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220\
', '')
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/os/yum.py
<10.10.50.233> PUT /root/.ansible/tmp/ansible-local-16812uXmQZM/tmpUGfbYa TO /home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/AnsiballZ_yum.py
<10.10.50.233> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=tidb -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/4d08168bb5 '[10.10.50.233]'
<10.10.50.233> (0, 'sftp> put /root/.ansible/tmp/ansible-local-16812uXmQZM/tmpUGfbYa /home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/AnsiballZ_yum.py\
', '')
<10.10.50.233> ESTABLISH SSH CONNECTION FOR USER: tidb
<10.10.50.233> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=tidb -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/4d08168bb5 10.10.50.233 '/bin/sh -c '"'"'chmod u+x /home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/ /home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/AnsiballZ_yum.py && sleep 0'"'"''
<10.10.50.233> (0, '', '')
<10.10.50.233> ESTABLISH SSH CONNECTION FOR USER: tidb
<10.10.50.233> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=tidb -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/4d08168bb5 -tt 10.10.50.233 '/bin/sh -c '"'"'/usr/bin/python /home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/AnsiballZ_yum.py && sleep 0'"'"''
<10.10.50.233> (1, 'Traceback (most recent call last):\r\
  File "/home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/AnsiballZ_yum.py", line 113, in <module>\r\
    _ansiballz_main()\r\
  File "/home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/AnsiballZ_yum.py", line 105, in _ansiballz_main\r\
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\
  File "/home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/AnsiballZ_yum.py", line 48, in invoke_module\r\
    imp.load_module(\'__main__\', mod, module, MOD_DESC)\r\
  File "/tmp/ansible_yum_payload_fXUTxD/__main__.py", line 1588, in <module>\r\
  File "/tmp/ansible_yum_payload_fXUTxD/__main__.py", line 1584, in main\r\
  File "/tmp/ansible_yum_payload_fXUTxD/__main__.py", line 1516, in run\r\
  File "/tmp/ansible_yum_payload_fXUTxD/__main__.py", line 815, in list_stuff\r\
  File "/tmp/ansible_yum_payload_fXUTxD/__main__.py", line 756, in pkg_to_dict\r\
ValueError: need more than 1 value to unpack\r\
', 'Shared connection to 10.10.50.233 closed.\r\
')
<10.10.50.233> Failed to connect to the host via ssh: Shared connection to 10.10.50.233 closed.
<10.10.50.233> ESTABLISH SSH CONNECTION FOR USER: tidb
<10.10.50.233> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=tidb -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/4d08168bb5 10.10.50.233 '/bin/sh -c '"'"'rm -f -r /home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/ > /dev/null 2>&1 && sleep 0'"'"''
<10.10.50.233> (0, '', '')
fatal: [10.10.50.233]: FAILED! => changed=false
  module_stderr: |-
    Shared connection to 10.10.50.233 closed.
  module_stdout: |-
    Traceback (most recent call last):
      File "/home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/AnsiballZ_yum.py", line 113, in <module>
        _ansiballz_main()
      File "/home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/AnsiballZ_yum.py", line 105, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/tidb/.ansible/tmp/ansible-tmp-1590732488.6-159448594352220/AnsiballZ_yum.py", line 48, in invoke_module
        imp.load_module('__main__', mod, module, MOD_DESC)
      File "/tmp/ansible_yum_payload_fXUTxD/__main__.py", line 1588, in <module>
      File "/tmp/ansible_yum_payload_fXUTxD/__main__.py", line 1584, in main
      File "/tmp/ansible_yum_payload_fXUTxD/__main__.py", line 1516, in run
      File "/tmp/ansible_yum_payload_fXUTxD/__main__.py", line 815, in list_stuff
      File "/tmp/ansible_yum_payload_fXUTxD/__main__.py", line 756, in pkg_to_dict
    ValueError: need more than 1 value to unpack
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

除了 10.10.50.233 其他节点是否正常

报错可能跟系统环境有关,麻烦检查并提供具体的系统、内核以及 ansible 版本信息

Centos 7.7 for AArch64

[tidb@phytium ansible-tmp-1590733465.68-19276100508857]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (AltArch)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (AltArch)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

Kernel:

[tidb@phytium ansible-tmp-1590733465.68-19276100508857]$ uname -a
Linux phytium 4.19.105-phytium-centos #1 SMP Fri Mar 13 16:10:37 CST 2020 aarch64 aarch64 aarch64 GNU/Linux

ansible

[tidb@phytium ansible-tmp-1590733465.68-19276100508857]$ ansible --version
ansible 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/tidb/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.5 (default, Aug  7 2019, 00:57:09) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
[tidb@phytium ansible-tmp-1590733465.68-19276100508857]$

收到,稍后回复。

您好,问题原因暂未查明,推测跟 Ansible 版本有关

目前 TiDB 4.0 兼容的 Ansible 版本是 Ansible 2.5 ~ 2.7.11 (2.5 ≤ Ansible ≤ 2.7.11)

建议升级 Ansible 版本,并安装相关依赖

cd /home/tidb/tidb-ansible && \
sudo pip install -r ./requirements.txt

如果仍然存在 Get systemd version报错,可以参考 tidb-ansible/roles/check_system_static/tasks/main.yml 文件中的步骤
登录到机器上执行 yum list systemd ,检查 systemd 版本是否满足要求

systemd_version[0] < ‘219’ or (systemd_version[0] == ‘219’ and systemd_release[0] < ‘52.el7’

如果确认满足部署要求,可以注释掉下面的检查步骤,跳过这项检查