2013-03-06 143 views
0

這是Folsom的再次發佈,我正在閱讀本書。我已經開始嘗試驗證瀏覽安裝,但我無法通過任何命令。在一目瞭然,api.conf,我有:Glance無法驗證管理員用戶

[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 
一目瞭然,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數據庫中有一個「glance」用戶,它有相同的密碼,但我不知道它是否被使用。

失敗我得到是這樣的:

[email protected]:~# 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 
[email protected]:~# 

我試圖查看配置文件,但我堅持。任何幫助讚賞

回答

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 

這可以再通過

source adminrc 

產生,以當前shell這個文件可以下載從設置的具體項目選項在地平線儀表板。

+0

謝謝,只要我到辦公室,我會試試這個。 – AlanObject 2013-03-06 16:37:13

+0

你的建議有幫助,但這不是我的問題的答案。我現在正在工作,但我不確定我以前的問題是什麼。我會標記你的答案,所以你得到信用。 – AlanObject 2013-03-07 19:25:59

+1

將此標記爲正確對未來的讀者沒有多大幫助,因爲它沒有解決問題中的問題。 – 2013-07-24 00:01:53

相關問題