Openstack RDO无法在'10 .0.3.139上连接到MySQL服务器

时间:2014-01-06 06:28:08

标签: openstack rdo

最近我的Openstack(使用RDO)出错了。管理员用户的密码是正确的。我可以通过“keystone”,“root”使用mysql。这是详细信息(/var/log/keystone/keystone.log):

(OperationalError) (2003, "Can't connect to MySQL server on '10.0.3.139' (111)") None None
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/keystone/common/wsgi.py", line 238, in __call__
    result = method(context, **params)
  File "/usr/lib/python2.6/site-packages/keystone/token/controllers.py", line 127, in authenticate
    auth_token_data, roles_ref=roles_ref, catalog_ref=catalog_ref)
  File "/usr/lib/python2.6/site-packages/keystone/common/manager.py", line 44, in _wrapper
    return f(*args, **kw)
  File "/usr/lib/python2.6/site-packages/keystone/token/providers/uuid.py", line 386, in issue_v2_token
    self.token_api.get_token(token_id)
  File "/usr/lib/python2.6/site-packages/keystone/token/core.py", line 128, in get_token
    token_ref = self._get_token(unique_id)
  File "/usr/lib/python2.6/site-packages/dogpile/cache/region.py", line 936, in decorate
    should_cache_fn)
  File "/usr/lib/python2.6/site-packages/dogpile/cache/region.py", line 588, in get_or_create
    async_creator) as value:
  File "/usr/lib/python2.6/site-packages/dogpile/core/dogpile.py", line 158, in __enter__
    return self._enter()
  File "/usr/lib/python2.6/site-packages/dogpile/core/dogpile.py", line 98, in _enter
    generated = self._enter_create(createdtime)
  File "/usr/lib/python2.6/site-packages/dogpile/core/dogpile.py", line 149, in _enter_create
    created = self.creator()
  File "/usr/lib/python2.6/site-packages/dogpile/cache/region.py", line 565, in gen_value
    created_value = creator()
  File "/usr/lib/python2.6/site-packages/dogpile/cache/region.py", line 932, in creator
    return fn(*arg, **kw)
  File "/usr/lib/python2.6/site-packages/keystone/token/core.py", line 140, in _get_token
    return self.driver.get_token(token_id)
  File "/usr/lib/python2.6/site-packages/keystone/token/backends/sql.py", line 46, in get_token
    token_ref = session.query(TokenModel).get(token_id)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 775, in get
    return self._load_on_ident(key)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2512, in _load_on_ident
    return q.one()
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2184, in one
    ret = list(self)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2227, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2240, in _execute_and_instances
close_with_result=True)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2231, in _connection_from_session
    **kw)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/session.py", line 730, in connection
    close_with_result=close_with_result)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/session.py", line 736, in _connection_for_bind
    return engine.contextual_connect(**kwargs)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2490, in contextual_connect
    self.pool.connect(),
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/pool.py", line 224, in connect
    return _ConnectionFairy(self).checkout()
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/pool.py", line 387, in __init__
    rec = self._connection_record = pool._do_get()
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/pool.py", line 741, in _do_get
    con = self._create_connection()
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/pool.py", line 188, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/pool.py", line 270, in __init__
    self.connection = self.__connect()
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/pool.py", line 330, in __connect
    connection = self.__pool._creator()
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/strategies.py", line 80, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/default.py", line 281, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (OperationalError) (2003, "Can't connect to MySQL server on '10.0.3.139' (111)") None None

MySQL出了什么问题?有人可以给我一些建议吗?

1 个答案:

答案 0 :(得分:0)

确保运行mysql服务 service mysql status 接下来确保它正在收听“10.0.3.139”。 默认情况下,mysql侦听localhost。 要更改该编辑/etc/mysql/my.cnf并将bind-address设置为0.0.0.0并重新启动该服务。这将使它能够监听所有可用的接口。 最后,您必须确保在/etc/keystone/keystone.conf中正确配置了mysql数据库,用户和密码,并且还确保在mysql中创建了用户/数据库。

使用以下链接了解更多详情。 http://docs.openstack.org/grizzly/openstack-compute/install/apt/content/install-keystone.html