一、利用kolla-ansible安装完成后openstack各个docker容器后,想利用openstackclient管理相关服务
首先安装openstackclient服务
[root@controller ~]# yum install -y centos-release-openstack-train -y
[root@controller ~]# yum install python-openstackclient openstack-selinux -y 安装完成后需要配置adminopenrc.sh 的相关参数,具体参考
256term.sh colorgrep.csh colorls.csh csh.local lang.sh less.sh vim.csh which2.csh
[root@controller ~]# cat /etc/profile.d/admin-openrc.sh
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=XXXXXX
export OS_AUTH_URL=http://172.16.78.11:5000
安装完成后利用openstackclient查看相关命令, 出现以下报错
[root@controller ~]# openstack --help
Traceback (most recent call last):File "/usr/bin/openstack", line 6, in <module>from openstackclient.shell import mainFile "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 22, in <module>from osc_lib.api import authFile "/usr/lib/python2.7/site-packages/osc_lib/api/auth.py", line 18, in <module>from keystoneauth1.identity.v3 import k2kFile "/usr/lib/python2.7/site-packages/keystoneauth1/identity/__init__.py", line 14, in <module>from keystoneauth1.identity import genericFile "/usr/lib/python2.7/site-packages/keystoneauth1/identity/generic/__init__.py", line 14, in <module>from keystoneauth1.identity.generic.password import Password # noqaFile "/usr/lib/python2.7/site-packages/keystoneauth1/identity/generic/password.py", line 16, in <module>from keystoneauth1.identity import v3File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/v3/__init__.py", line 17, in <module>from keystoneauth1.identity.v3.multi_factor import * # noqaFile "/usr/lib/python2.7/site-packages/keystoneauth1/identity/v3/multi_factor.py", line 14, in <module>from keystoneauth1 import loadingFile "/usr/lib/python2.7/site-packages/keystoneauth1/loading/__init__.py", line 13, in <module>from keystoneauth1.loading import adapterFile "/usr/lib/python2.7/site-packages/keystoneauth1/loading/adapter.py", line 13, in <module>from keystoneauth1 import adapterFile "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 17, in <module>from keystoneauth1 import sessionFile "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 25, in <module>import requestsFile "/usr/lib/python2.7/site-packages/requests/__init__.py", line 43, in <module>import urllib3File "/usr/lib/python2.7/site-packages/urllib3/__init__.py", line 8, in <module>from .connectionpool import (File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 29, in <module>from .connection import (File "/usr/lib/python2.7/site-packages/urllib3/connection.py", line 38, in <module>from .util.ssl_ import (File "/usr/lib/python2.7/site-packages/urllib3/util/__init__.py", line 8, in <module>from .ssl_ import (File "/usr/lib/python2.7/site-packages/urllib3/util/ssl_.py", line 10, in <module>from ..exceptions import (
ImportError: cannot import name ProxySchemeUnsupported
二、解决办法
细看了安装openstackclient的记录发现有一个报错:
有个一个python2-urllib3没有安装成功,train版本依赖于1.24.1版本,利用pip查看现在的版本是1.26,所以之前用kolla-ansible部署的时候安装的相关服务是最新版本的,此时需要降低版本。
[root@controller ~]# pip uninstall urllib3
Found existing installation: urllib3 1.26.6
Uninstalling urllib3-1.26.6:Would remove:/usr/lib/python2.7/site-packages/urllib3-1.26.6.dist-info/*/usr/lib/python2.7/site-packages/urllib3/*
Proceed (y/n)? ySuccessfully uninstalled urllib3-1.26.6
[root@controller ~]# yum install python2-urllib3 -y
此时在用openstackclient查看相关参数即可。
[root@controller ~]# openstack networl ls
openstack: 'networl ls' is not an openstack command. See 'openstack --help'.
Did you mean one of these?network agent add networknetwork agent add routernetwork agent deletenetwork agent listnetwork agent remove networknetwork agent remove routernetwork agent set