su -s /bin/sh -c "glance-manage db_sync" glance 报错!
根据官方文档操作,执行到
Populate the Image Service database:
# su -s /bin/sh -c "glance-manage db_sync" glance
报错如下:
root@ada-ubuntu:/var/log/mysql# su -s /bin/sh -c "glance-manage db_sync" glance
Option "verbose" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future.
/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py:1056: OsloDBDeprecationWarning: EngineFacade is deprecated; please use oslo_db.sqlalchemy.enginefacade
expire_on_commit=expire_on_commit, _conf=conf)
2017-09-24 23:52:57.171 9538 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 10 attempts left.
2017-09-24 23:53:07.183 9538 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 9 attempts left.
2017-09-24 23:53:17.194 9538 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 8 attempts left.
2017-09-24 23:53:27.206 9538 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 7 attempts left.
2017-09-24 23:53:37.218 9538 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 6 attempts left.
2017-09-24 23:53:47.222 9538 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 5 attempts left.
2017-09-24 23:53:57.234 9538 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 4 attempts left.
2017-09-24 23:54:07.245 9538 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 3 attempts left.
2017-09-24 23:54:17.255 9538 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 2 attempts left.
2017-09-24 23:54:27.268 9538 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 1 attempts left.
2017-09-24 23:54:37.277 9538 CRITICAL glance [-] DBConnectionError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'controller' ([Errno 111] Connection refused)")
2017-09-24 23:54:37.277 9538 ERROR glance Traceback (most recent call last):
2017-09-24 23:54:37.277 9538 ERROR glance File "/usr/bin/glance-manage", line 10, in <module>
2017-09-24 23:54:37.277 9538 ERROR glance sys.exit(main())
2017-09-24 23:54:37.277 9538 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/cmd/manage.py", line 341, in main
2017-09-24 23:54:37.277 9538 ERROR glance return CONF.command.action_fn()
2017-09-24 23:54:37.277 9538 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/cmd/manage.py", line 196, in sync
2017-09-24 23:54:37.277 9538 ERROR glance CONF.command.current_version)
2017-09-24 23:54:37.277 9538 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/cmd/manage.py", line 118, in sync
2017-09-24 23:54:37.277 9538 ERROR glance migration.db_sync(db_api.get_engine(),
2017-09-24 23:54:37.277 9538 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/db/sqlalchemy/api.py", line 98, in get_engine
2017-09-24 23:54:37.277 9538 ERROR glance facade = _create_facade_lazily()
2017-09-24 23:54:37.277 9538 ERROR glance File "/usr/lib/python2.7/dist-packages/glance/db/sqlalchemy/api.py", line 88, in _create_facade_lazily
2017-09-24 23:54:37.277 9538 ERROR glance _FACADE = session.EngineFacade.from_config(CONF)
2017-09-24 23:54:37.277 9538 ERROR glance File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 1056, in from_config
2017-09-24 23:54:37.277 9538 ERROR glance expire_on_commit=expire_on_commit, _conf=conf)
2017-09-24 23:54:37.277 9538 ERROR glance File "/usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 977, in __init__
2017-09-24 23:54:37.277 9538 ERROR glance slave_connection