这是Folsom的再次发布,我将继续阅读这本书。我已经到了我试图验证一瞥安装的地步,但我无法通过任何命令。在 glance-api.conf 中,我有:
[keystone_authtoken]
auth_host = localhost
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = glance
[paste_deploy]
config_file = /etc/glance/glance-api-paste.ini
flavor=keystone
在 glance-registry.conf 文件中我非常相似:
[keystone_authtoken]
auth_host = localhost
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = glance
[paste_deploy]
config_file = /etc/glance/glance-registry-paste.ini
flavor=keystone
一个背景问题:一眼应该根据上面的conf文件中的用户名/密码进行身份验证,还是应该要求 keystone 进行身份验证?我确实在 keystone 数据库中有一个“浏览”用户使用相同的密码,但我无法判断它是否被使用。
我得到的失败看起来像这样:
root@osdemo:~# glance --debug --os_user=glance --os_password=glance index
Traceback (most recent call last):
File "/usr/bin/glance", line 1048, in <module>
result = command(options, args)
File "/usr/bin/glance", line 63, in wrapper
ret = func(*args, **kwargs)
File "/usr/bin/glance", line 559, in images_index
print_header=True)
File "/usr/bin/glance", line 501, in _images_index
images = client.get_images(**parameters)
File "/usr/lib/python2.7/dist-packages/glance/client.py", line 60, in get_images
res = self.do_request("GET", "/images", params=params)
File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 61, in wrapped
return func(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 420, in do_request
headers=headers)
File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 75, in wrapped
return func(self, method, url, body, headers)
File "/usr/lib/python2.7/dist-packages/glance/common/client.py", line 539, in _do_request
raise exception.NotAuthenticated(res.read())
glance.common.exception.NotAuthenticated: You are not authenticated.
Details: 401 Unauthorized
This server could not verify that you are authorized to access the document
you requested. Either you supplied the wrong credentials (e.g., bad password),
or your browser does not understand how to supply the credentials required.
Authentication required
root@osdemo:~#
我正在尝试查看配置文件,但是我被卡住了。任何帮助表示赞赏
答案 0 :(得分:0)
最好使用类似下面的bash rc文件并将其提供给您当前的shell。
示例文件(adminrc)如下所示
#!/bin/bash
# With the addition of Keystone, to use an openstack cloud you should
# authenticate against keystone, which returns a **Token** and **Service
# Catalog**. The catalog contains the endpoint for all services the
# user/tenant has access to - including nova, glance, keystone, swift.
#
# *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We
# will use the 1.1 *compute api*
export OS_AUTH_URL=http://keystone_server:5000/v2.0
# With the addition of Keystone we have standardized on the term **tenant**
# as the entity that owns the resources.
export OS_TENANT_ID=UUID_OF_THE_TENANT
export OS_TENANT_NAME=MY_TEST_TENANT
# In addition to the owning entity (tenant), openstack stores the entity
# performing the action as the **user**.
export OS_USERNAME=admin
# With Keystone you pass the keystone password.
echo "Please enter your OpenStack Password: "
read -s OS_PASSWORD_INPUT
export OS_PASSWORD=$OS_PASSWORD_INPUT
然后可以通过
将其提供给当前的shellsource adminrc
可以从水平仪表板中的设置选项下载特定项目的此文件。