Openstack 基石問題
我遇到了 keystone 問題,keystone 配置了使用者 nova、glance 和 admin 使用者,並且還定義了它們的端點。表演時
keystone token-get
它正在顯示令牌,但是對於像這樣的命令
keystone user-list
它的顯示
No handlers could be found for logger "keystoneclient.client" Unable to communicate with identity service: 404 Not Found The resource could not be found. . (HTTP 404)
但是在設置了這些環境變數之後它就起作用了
export SERVICE_ENDPOINT=http://192.168.10.15:35357/v2.0 export SERVICE_TOKEN=token
但在那之後,對於基石令牌 - 得到它的展示
'Client' object has no attribute 'service_catalog'
為什麼會這樣?如何解決任何想法
好的,這是一個潛在的答案。可能不是答案。
但在我看來,您遇到的問題是與 keystone 的“管理員”API 的連接問題。
Keystone 客戶端通常會通過從“服務”API 獲取令牌來開始查詢。此 API 預設為埠 5000,可在 keystone conf 文件中進行配置。它還將獲取用於查找 Admin API 端點的服務目錄。
然後要執行管理功能,它將查詢“管理”API。此 API 預設為 35357,可在 keystone conf 文件中進行配置。
因此,如果“管理員”API 不可用,這將表現出您所看到的行為。
有兩種方法可以驗證您可用的“管理”API 是否存在連接問題。
最有用的方法是為 keystone 客戶端設置調試標誌。它會輸出關於它正在做的查詢的額外資訊。
範例(來自丟棄的 devstack):
stack@devstack:~/devstack$ keystone --debug user-list REQ: curl -i http://192.168.122.236:5000/v2.0/tokens -X POST -H "Content-Type: application/json" -H "User-Agent: python-keystoneclient" REQ BODY: {"auth": {"tenantName": "demo", "passwordCredentials": {"username": "admin", "password": "stack"}}} RESP: [200] {'date': 'Wed, 20 Mar 2013 23:25:09 GMT', 'content-type': 'application/json', 'content-length': '5983', 'vary': 'X-Auth-Token'} RESP BODY: {"access": {"token": {"issued_at": "2013-03-20T23:25:09.917153", "expires": "2013-03-21T23:25:09Z", "id": "MIIKjAYJKoZIhvcNAQcCoIIKfTCCCnkCAQExCTAHBgUrDgMCGjCCCWUGCSqGSIb3DQEHAaCCCVYEgglSeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxMy0w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NVBAoTBVVuc2V0MRgwFgYDVQQDEw93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEgYB1E4lLmIkSot4Yggwjs3p71EXg9vMan0wX4SM5sFgsH6GrJBwJ4LPzG7HQX8wNMYaa6qMN5EWowx6+RktGHYiBOjGxGFPpWIEUcU0loAINa8QkrPMUfDfIvJDuaXR0eTEQQsaujmgqqjD9N5KuZ+t30i324T2dowD8ihdqEjGJKQ==", "tenant": {"description": null, "enabled": true, "id": "45e7cd57b9ef4871891f53e75aeb5727", "name": "demo"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.122.236:8774/v2/45e7cd57b9ef4871891f53e75aeb5727", "region": "RegionOne", "internalURL": "http://192.168.122.236:8774/v2/45e7cd57b9ef4871891f53e75aeb5727", "id": "56f826e61af94daa88a2dbf8c9cd07cb", "publicURL": "http://192.168.122.236:8774/v2/45e7cd57b9ef4871891f53e75aeb5727"}], "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://192.168.122.236:3333", "region": "RegionOne", "internalURL": "http://192.168.122.236:3333", "id": "666e71bd93f04b1c9ac081db03750fcb", "publicURL": "http://192.168.122.236:3333"}], "endpoints_links": [], "type": "s3", "name": "s3"}, {"endpoints": [{"adminURL": "http://192.168.122.236:9292", "region": "RegionOne", "internalURL": "http://192.168.122.236:9292", "id": "5d1d026917254d5ab5b9d4d556e6800e", "publicURL": "http://192.168.122.236:9292"}], "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://192.168.122.236:8776/v1/45e7cd57b9ef4871891f53e75aeb5727", "region": "RegionOne", "internalURL": "http://192.168.122.236:8776/v1/45e7cd57b9ef4871891f53e75aeb5727", "id": "02cbbdcbcea748679ffa90305ff96e19", "publicURL": "http://192.168.122.236:8776/v1/45e7cd57b9ef4871891f53e75aeb5727"}], "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": [{"adminURL": "http://192.168.122.236:8773/services/Admin", "region": "RegionOne", "internalURL": "http://192.168.122.236:8773/services/Cloud", "id": "6234f3763c5f48eaa0f41156ace90ea2", "publicURL": "http://192.168.122.236:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "ec2"}, {"endpoints": [{"adminURL": "http://192.168.122.236:35357/v2.0", "region": "RegionOne", "internalURL": "http://192.168.122.236:5000/v2.0", "id": "0831b45f2f4b4a80ada0782372258b8c", "publicURL": "http://192.168.122.236:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username": "admin", "roles_links": [], "id": "71b6e3604b744b90bdbb948b80a3e678", "roles": [{"name": "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["07ac476e82904c5dbe1dd82f1987f019"]}}} REQ: curl -i http://192.168.122.236:35357/v2.0/users -X GET -H "User-Agent: python-keystoneclient" -H "X-Auth-Token: MIIKjAYJKoZIhvcNAQcCoIIKfTCCCnkCAQExCTAHBgUrDgMCGjCCCWUGCSqGSIb3DQEHAaCCCVYEgglSeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxMy0wMy0yMFQyMzoyNTowOS45MTcxNTMiLCAiZXhwaXJlcyI6ICIyMDEzLTAzLTIxVDIzOjI1OjA5WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImRlc2NyaXB0aW9uIjogbnVsbCwgImVuYWJsZWQiOiB0cnVlLCAiaWQiOiAiNDVlN2NkNTdiOWVmNDg3MTg5MWY1M2U3NWFlYjU3MjciLCAibmFtZSI6ICJkZW1vIn19LCAic2VydmljZUNhdGFsb2ciOiBbeyJlbmRwb2ludHMiOiBbeyJhZG1pblVSTCI6ICJodHRwOi8vMTkyLjE2OC4xMjIuMjM2Ojg3NzQvdjIvNDVlN2NkNTdiOWVmNDg3MTg5MWY1M2U3NWFlYjU3MjciLCAicmVnaW9uIjogIlJlZ2lvbk9uZSIsICJpbnRlcm5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6Ly8xOTIuMTY4LjEyMi4yMzY6NTAwMC92Mi4wIiwgImlkIjogIjA4MzFiNDVmMmY0YjRhODBhZGEwNzgyMzcyMjU4YjhjIiwgInB1YmxpY1VSTCI6ICJodHRwOi8vMTkyLjE2OC4xMjIuMjM2OjUwMDAvdjIuMCJ9XSwgImVuZHBvaW50c19saW5rcyI6IFtdLCAidHlwZSI6ICJpZGVudGl0eSIsICJuYW1lIjogImtleXN0b25lIn1dLCAidXNlciI6IHsidXNlcm5hbWUiOiAiYWRtaW4iLCAicm9sZXNfbGlua3MiOiBbXSwgImlkIjogIjcxYjZlMzYwNGI3NDRiOTBiZGJiOTQ4YjgwYTNlNjc4IiwgInJvbGVzIjogW3sibmFtZSI6ICJhZG1pbiJ9XSwgIm5hbWUiOiAiYWRtaW4ifSwgIm1ldGFkYXRhIjogeyJpc19hZG1pbiI6IDAsICJyb2xlcyI6IFsiMDdhYzQ3NmU4MjkwNGM1ZGJlMWRkODJmMTk4N2YwMTkiXX19fTGB-zCB-AIBATBcMFcxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIEwVVbnNldDEOMAwGA1UEBxMFVW5zZXQxDjAMBgNVBAoTBVVuc2V0MRgwFgYDVQQDEw93d3cuZXhhbXBsZS5jb20CAQEwBwYFKw4DAhowDQYJKoZIhvcNAQEBBQAEgYB1E4lLmIkSot4Yggwjs3p71EXg9vMan0wX4SM5sFgsH6GrJBwJ4LPzG7HQX8wNMYaa6qMN5EWowx6+RktGHYiBOjGxGFPpWIEUcU0loAINa8QkrPMUfDfIvJDuaXR0eTEQQsaujmgqqjD9N5KuZ+t30i324T2dowD8ihdqEjGJKQ==" RESP: [200] {'date': 'Wed, 20 Mar 2013 23:25:09 GMT', 'content-type': 'application/json', 'content-length': '863', 'vary': 'X-Auth-Token'} RESP BODY: {"users": [{"name": "alt_demo", "id": "00f1ffdaa14f448da11630edc3503e92", "tenantId": null, "enabled": true, "email": "alt_demo@example.com"}, {"name": "demo", "id": "445391568d1d4b619e7919462deeab63", "tenantId": null, "enabled": true, "email": "demo@example.com"}, {"name": "admin", "id": "71b6e3604b744b90bdbb948b80a3e678", "tenantId": null, "enabled": true, "email": "admin@example.com"}, {"name": "glance", "id": "7971cdee1ac0496499ea87828a24309b", "tenantId": "a5c7110f23ac495e805d4ebeefeff0b6", "enabled": true, "email": "glance@example.com"}, {"name": "nova", "id": "a2dda6286156444fa44308b43c934c89", "tenantId": "a5c7110f23ac495e805d4ebeefeff0b6", "enabled": true, "email": "nova@example.com"}, {"name": "cinder", "id": "c5340dffe39d4ae4b17e2441bf1392d5", "tenantId": "a5c7110f23ac495e805d4ebeefeff0b6", "enabled": true, "email": "cinder@example.com"}]} +----------------------------------+----------+---------+----------------------+ | id | name | enabled | email | +----------------------------------+----------+---------+----------------------+ | 71b6e3604b744b90bdbb948b80a3e678 | admin | True | admin@example.com | | 00f1ffdaa14f448da11630edc3503e92 | alt_demo | True | alt_demo@example.com | | c5340dffe39d4ae4b17e2441bf1392d5 | cinder | True | cinder@example.com | | 445391568d1d4b619e7919462deeab63 | demo | True | demo@example.com | | 7971cdee1ac0496499ea87828a24309b | glance | True | glance@example.com | | a2dda6286156444fa44308b43c934c89 | nova | True | nova@example.com | +----------------------------------+----------+---------+----------------------+
這裡的好處是您將看到它嘗試連接到 Admin API 的位置。在為 Admin API 選擇 API 端點時,它將查詢服務 API 以獲取服務目錄。因此,請確保您的服務目錄將人們引導到 keystone 管理 API 的正確 API 端點。
或者,您可以簡單地 strace keystone 客戶端查詢。
有關 Keystone 可用的服務和管理 API 之間的功能差異的更多資訊:
http://docs.openstack.org/developer/keystone/api_curl_examples.html