在安装openstack验证keystone时执行"openstack --os-auth-url http://controller:35357/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name admin --os-username admin token issue"提示以下错误.
Expecting to find domain in project. The server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error. (HTTP 400) (Request-ID: req-7d2a33be-af6c-436c-8d86-f844fdc0f50c)
这是由于keystone服务在启动时加载了v2和v3的API,但是v3 API加了domain概念,v2和v3同时存在,当使用client时,有不同了,在CLI client里,keystone命令,只能支持V2版本API的访问,而openstack cli可以同时支持v2与v3版本.
通过配置环境变量解决
[root@controller ~]# vi admin-openrc
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=123456 #admin用户的密码
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
[root@controller ~]# source admin-openrc
再次执行
openstack --os-auth-url http://controller:35357/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name admin --os-username admin token issue
就正常了