[Openstack-keystone] Expecting an auth URL via either --os-auth-url or env[OS_AUTH_URL]

通过devstack搭建到openstack,在使用keystone到时候遇到这个问题,keystone Expecting an auth URL via either --os-auth-url or env[OS_AUTH_URL]。然后查阅了相关资料,问题得到解决,错误产产生到原因是一些变量没有指定。方法如下:

1.keystone到默认安装目录所/etc/keystone/。我在次目录下创建可一个keystonerc_admin文件,内容如下:

   $ cat keystonerc_admin
   export OS_USERNAME=admin
   export OS_TENANT_NAME=admin
  export OS_PASSWORD=000000
  export OS_AUTH_URL=http://192.168.1.107:35357/v2.0/
  export PS1='[\u@\h \W(keystone_admin)]$'
2.然后执行 source keystonerc_admin

3.keystone就可以正常的使用了。

root@yu-OptiPlex-3010:/etc/keystone# keystone user-list
+----------------------------------+----------+---------+----------------------+
|                id                |   name   | enabled |        email         |
+----------------------------------+----------+---------+----------------------+
| 94dc31f741a04eac80005139f5114a32 |  admin   |   True  |  [email protected]   |
| 204fb05a4e5f47988203f06a8c26ac9c | alt_demo |   True  | [email protected] |
| b59260a26499402baa5b844c0802472a |  cinder  |   True  |  [email protected]  |
| 3d89fa005aee427f86bf5daff8e364b8 |   demo   |   True  |   [email protected]   |
| a4792e4326354142a7791ad63bc655a8 |  glance  |   True  |  [email protected]  |
| 73f9821c320e4badbe031bb983cf85e6 |   heat   |   True  |   [email protected]   |
| b1da2ae4b188445e9f2663b3fccf28bf |   nova   |   True  |   [email protected]   |
+----------------------------------+----------+---------+----------------------+
root@yu-OptiPlex-3010:/etc/keystone# keystone role-list
+----------------------------------+------------------+
|                id                |       name       |
+----------------------------------+------------------+
| af3607994f284aa7840d1a393f78a77b |      Member      |
| b6b513fc96ae41689db98febf0f5ccc0 |  ResellerAdmin   |
| 9fe2ff9ee4384b1894a90878d3e92bab |     _member_     |
| dca835aefbfa4c1690f5f73f5b42a670 |      admin       |
| ce8a537dfce2439981788803dcb928f6 |   anotherrole    |
| deaf50bbb7a342ebb2ecf1f0aadef2ab | heat_stack_owner |
| c9b04bf8bb12492c95300a122ac9fd90 | heat_stack_user  |
| 59d4f4a7b33f4e3a97c6e3cf036b5301 |     service      |
+----------------------------------+------------------+

 
 

你可能感兴趣的:([Openstack-keystone] Expecting an auth URL via either --os-auth-url or env[OS_AUTH_URL])