本次安装操作系统为Debian10
官方文档:https://docs.openstack.org/kolla-ansible/latest/user/quickstart.html
1. Precheck failed
执行precheck报错:
(pythonvenv) root@kolla-ansible:~# kolla-ansible -i ./multinode prechecks
····················
TASK [prechecks : Checking docker SDK version] ************************************************************************************************************************************
skipping: [localhost]
fatal: [control1]: FAILED! => {"changed": false, "cmd": ["/usr/bin/python", "-c", "import docker; print(docker.__version__)"], "delta": "0:00:00.010285", "end": "2021-02-28 09:26:09.455813", "failed_when_result": true, "msg": "non-zero return code", "rc": 1, "start": "2021-02-28 09:26:09.445528", "stderr": "Traceback (most recent call last):\n File \"<string>\", line 1, in <module>\nImportError: No module named docker", "stderr_lines": ["Traceback (most recent call last):", " File \"<string>\", line 1, in <module>", "ImportError: No module named docker"], "stdout": "", "stdout_lines": []}
fatal: [control3]: FAILED! => {"changed": false, "cmd": ["/usr/bin/python", "-c", "import docker; print(docker.__version__)"], "delta": "0:00:00.010795", "end": "2021-02-28 09:26:09.514719", "failed_when_result": true, "msg": "non-zero return code", "rc": 1, "start": "2021-02-28 09:26:09.503924", "stderr": "Traceback (most recent call last):\n File \"<string>\", line 1, in <module>\nImportError: No module named docker", "stderr_lines": ["Traceback (most recent call last):", " File \"<string>\", line 1, in <module>", "ImportError: No module named docker"], "stdout": "", "stdout_lines": []}
fatal: [compute1]: FAILED! => {"changed": false, "cmd": ["/usr/bin/python", "-c", "import docker; print(docker.__version__)"], "delta": "0:00:00.010590", "end": "2021-02-28 09:26:09.536965", "failed_when_result": true, "msg": "non-zero return code", "rc": 1, "start": "2021-02-28 09:26:09.526375", "stderr": "Traceback (most recent call last):\n File \"<string>\", line 1, in <module>\nImportError: No module named docker", "stderr_lines": ["Traceback (most recent call last):", " File \"<string>\", line 1, in <module>", "ImportError: No module named docker"], "stdout": "", "stdout_lines": []}
fatal: [control2]: FAILED! => {"changed": false, "cmd": ["/usr/bin/python", "-c", "import docker; print(docker.__version__)"], "delta": "0:00:00.017374", "end": "2021-02-28 09:26:09.548808", "failed_when_result": true, "msg": "non-zero return code", "rc": 1, "start": "2021-02-28 09:26:09.531434", "stderr": "Traceback (most recent call last):\n File \"<string>\", line 1, in <module>\nImportError: No module named docker", "stderr_lines": ["Traceback (most recent call last):", " File \"<string>\", line 1, in <module>", "ImportError: No module named docker"], "stdout": "", "stdout_lines": []}
fatal: [compute2]: FAILED! => {"changed": false, "cmd": ["/usr/bin/python", "-c", "import docker; print(docker.__version__)"], "delta": "0:00:00.015856", "end": "2021-02-28 09:26:09.607353", "failed_when_result": true, "msg": "non-zero return code", "rc": 1, "start": "2021-02-28 09:26:09.591497", "stderr": "Traceback (most recent call last):\n File \"<string>\", line 1, in <module>\nImportError: No module named docker", "stderr_lines": ["Traceback (most recent call last):", " File \"<string>\", line 1, in <module>", "ImportError: No module named docker"], "stdout": "", "stdout_lines": []}
解决办法:
将python默认版本为python2,改为python3,即可解决,没有安装python3需要手动安装一下
root@compute1:~# ln -svf /usr/bin/python3 /usr/bin/python
'/usr/bin/python' -> '/usr/bin/python3'
root@compute1:~#
使用pip安装docker,在每个节点上用pip手动安装docker或使用ansible批量安装
root@compute2:~# pip install -U docker
OR
(pythonvenv) root@kolla-ansible:~# ansible -i ./multinode all -m shell -a "pip install docker"
网友评论