欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Keystone安装过程中遇到的问题及解决方法

程序员文章站 2024-02-01 18:35:46
...

安装环境:

操作系统:CentOS Linux release 7.7.1908 (Core)

openstack版本:openstack 3.14.3  Queens版

中间件:apache+mariadb+rabbitmq+memcache

安装文档:https://docs.openstack.org/install-guide/

 

废话不多说,列出一些报错及解决方法。

问题1.yum失败。

现象:

# yum list python-openstackclient   
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * centos-qemu-ev: mirrors.aliyun.com
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
http://mirror.centos.org/altarch/7/cloud/x86_64/openstack-queens/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article 

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.



 One of the configured repositories failed (CentOS-7 - OpenStack queens),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=centos-openstack-queens ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable centos-openstack-queens
        or
            subscription-manager repos --disable=centos-openstack-queens

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=centos-openstack-queens.skip_if_unavailable=true

failure: repodata/repomd.xml from centos-openstack-queens: [Errno 256] No more mirrors to try.
http://mirror.centos.org/altarch/7/cloud/x86_64/openstack-queens/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

原因:访问上面链接 http://mirror.centos.org/altarch/7/cloud/x86_64/openstack-queens/repodata/repomd.xml ,确实没有。查询/etc/yum.repos.d/CentOS-OpenStack-queens.repo,发现系统将$contentdir解析为altarch,导致yum失败。

解决方法:echo centos > /etc/yum/vars/contentdir

 

问题2:创建域失败。

现象:

# openstack domain create --description "An Example Domain" example
An unexpected error prevented the server from fulfilling your request. (HTTP 500) (Request-ID: req-c9220a5c-58b9-419c-9286-8af0db30f357)

查询keystone.log发现如下报错: 

2019-10-17 13:59:09.186 6975 ERROR keystone.common.wsgi OperationalError: (pymysql.err.OperationalError) (1045, u"Access denied for user 'keystone'@'controller' (using
password: YES)") (Background on this error at: http://sqlalche.me/e/e3q8)

原因:检查数据库权限。

 

问题3:创建域失败,keystone日志报错无数据表。

现象:

# openstack domain create --description "An Example Domain" example  
An unexpected error prevented the server from fulfilling your request. (HTTP 500) (Request-ID: req-d1a3d033-ff54-433d-8f73-9f664b0bc8ce)
2019-10-17 14:15:43.183 6973 ERROR keystone.common.wsgi [req-a3a5c527-c40b-4161-aade-2732caf0c0b7 - - - - -] (pymysql.err.ProgrammingError) (1146, u"Table 'keystone.pr
oject' doesn't exist") 

 原因:初始化数据库失败。keystone数据库中无数据表。

解决方法:重新初始化数据库。su -s /bin/sh -c "keystone-manage db_sync" keystone

 

问题4:创建域失败。

现象:

# openstack domain create --description "An Example Domain" example
The request you have made requires authentication. (HTTP 401) (Request-ID: req-c4fc974e-3e6b-4cc7-96be-adbb36d3cc09)

查询keystone日志,提示找不到默认域。

2019-10-17 14:45:21.552 8295 WARNING keystone.auth.core [req-c4fc974e-3e6b-4cc7-96be-adbb36d3cc09 - - - - -] Could not find domain: Default.: DomainNotFound: Could not
find domain: Default.
2019-10-17 14:45:21.553 8295 WARNING keystone.common.wsgi [req-c4fc974e-3e6b-4cc7-96be-adbb36d3cc09 - - - - -] Authorization failed. The request you have made requires

解决方法:重新设置默认域环境变量,,注意密码参数需要改成自己的:

# keystone-manage bootstrap --bootstrap-password 123456 \
>   --bootstrap-admin-url http://controller:5000/v3/ \
>   --bootstrap-internal-url http://controller:5000/v3/ \
>   --bootstrap-public-url http://controller:5000/v3/ \
>   --bootstrap-region-id RegionOne

 

最后,安装成功。

# openstack domain create --description "An Example Domain" example
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | An Example Domain                |
| enabled     | True                             |
| id          | 342f1051c32344ee972e6a9cfab7dfed |
| name        | example                          |
| tags        | []                               |
+-------------+----------------------------------+

安装过程过于复杂了,直接制约了OpenStack的流行。