openstack glance连接认证keystone出现错误的一个解决思路

搭建好了keystone服务后,对自己本身的认证是成功的 说明keystone配置是正确的。


之后开始配置glance服务,配置好了,出现了如下报错。


[ root@linux-node1 ~]# glance  image-list

503 Service Unavailable: The server is currently unavailable. Please try again at a later time. (HTTP 503)


开始以为是环境变量设置的问题。然后如下操作:


echo"export OS_IMAGE_API_VERSION=2"|tee-a admin-openrc.sh demo-openrc.sh


source admin-openrc.sh


然后执行 glance image-list


还是出现上面的这个报错。



然后我就看了下日志,出现了如下报错:


 4-21 09:44:12.712 29975 ERROR keystonemiddleware.auth_token [-] Bad response code while validating token: 400
2017-04-21 09:44:12.714 29975 WARNING keystonemiddleware.auth_token [-] Identity response: {"error": {"message": "Expecting to find domain in user - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.", "code": 400, "title": "Bad Request"}}
2017-04-21 09:44:12.716 29975 CRITICAL keystonemiddleware.auth_token [-] Unable to validate token: Failed to fetch token data from identity server
2017-04-21 09:44:12.720 29975 INFO eventlet.wsgi.server [-] 10.20.23.232 - - [21/Apr/2017 09:44:12] "GET /v2/images?limit=20&sort_key=name&sort_dir=asc HTTP/1.1" 503 370 0.091461



意思貌似是glance认证keystone出现了问题。 Unable to validate token: Failed to fetch token data from identity server
之后比对了下/etc/glance/glance-registry.conf 和 /etc/glance/glance-api.conf 文件
发现了 /etc/glance/glance-api.conf 文件缺少了
user_domain_id = default
project_name = service
导致glance链接keystone失败。所以添加了.
重启下服务:
[root@linux-node1 ~]#  systemctl restart openstack-glance-api
[root@linux-node1 ~]# systemctl restart openstack-glance-registry
最后就是见证奇迹的时刻。。
[root@linux-node1 ~]# glance  image-list
+----+------+
| ID | Name |
+----+------+
+----+------+
这只是一个思路,openstack这个虚拟化操作是非常繁琐的 ,所以部署的过程中要注意些配置文件。不然出了错误 都不知道怎么去解决。


你可能感兴趣的:(openstack)