具体看报错信息

[root@controller ~]# openstack token issue
An unexpected error prevented the server from fulfilling your request. (HTTP 500) (Request-ID: req-9c8de1e5-15bc-4ddf-b5b9-155ff7343bf2)

请求服务错误,去看keystone的日志

2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     return self._create_connection()
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/pool.py", line 323, in _create_connection
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     return _ConnectionRecord(self)
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/pool.py", line 449, in __init__
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     self.connection = self.__connect()
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/pool.py", line 607, in __connect
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     connection = self.__pool._invoke_creator(self)
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 97, in connect
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     return dialect.connect(*cargs, **cparams)
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 385, in connect
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     return self.dbapi.connect(*cargs, **cparams)
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/site-packages/pymysql/__init__.py", line 88, in Connect
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     return Connection(*args, **kwargs)
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 657, in __init__
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     self.connect()
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 851, in connect
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     self._request_authentication()
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1034, in _request_authentication
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     auth_packet = self._read_packet()
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 906, in _read_packet
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     packet.check_error()
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 367, in check_error
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     err.raise_mysql_exception(self._data)
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 120, in raise_mysql_exception
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     _check_mysql_exception(errinfo)
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi   File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 112, in _check_mysql_exception
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi     raise errorclass(errno, errorvalue)
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi OperationalError: (pymysql.err.OperationalError) (1040, u'Too many connections')
2019-04-22 12:22:35.934 3675 ERROR keystone.common.wsgi 

too many connections 连接达到上限

[root@controller ~]# vi /etc/my.cnf
max_connections=1000 //将manx_connections改为1000或者注释掉都可以
//重启mysql:
[root@controller ~]# systemctl restart mariadb.service

再次获取token

[root@controller ~]# openstack token issue
+------------+------------------------------------------------------------------------------------------+
| Field      | Value                                                                                    |
+------------+------------------------------------------------------------------------------------------+
| expires    | 2019-04-22T13:31:45.393205Z                                                              |
| id         | gAAAAABcvbQxhMPOc99W72vVywVCTQKkQdCv8XsnYVgVXPn7wHKHvz_xEsK6MjrslM6SwAPIa2ejcRq41qSzFsEL |
|            | gPwNfOLSwMoIsznDapooamz3HhQT2V8KBM02v8gWV2-biuvAUBip1PSfRVnE9A9B8IvGD2vtzteA2yIfjUrQE3y8 |
|            | WuhOKDg                                                                                  |
| project_id | 0ab2dbde4f754b699e22461426cd0774                                                         |
| user_id    | 53a1cf0ad2924532aa4b7b0750dec282                                                         |
+------------+------------------------------------------------------------------------------------------+

注意报错信息要去看日志具体报错,然后根据报错信息去定位错误点,比如这个报错mysql连接的问题,应该还要去看keystone.conf配置文件中的[database]字段下的connection = mysql + pymysql://keystone:密码@controller/keystone 有没有写错