Keystone安裝過程出現的問題及解決方法

安裝環境:

操作系統: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的流行。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章