Ask Your Question
0

why is keystone-manage db_sync (juno) database failing? [closed]

asked 2015-01-15 16:02:03 -0600

tarawa1943 gravatar image

updated 2015-01-16 11:36:04 -0600

Followed each step precisely as in Juno install up to p32 o

QUESTION: Is 127.0.0.1 embedded in the python code of openstack?
====================
FROM openstack JUNO install doc as of 15jan15
o
page 29
OpenStack Identity concepts
o
page 30
Install and configure

a. mysql -u root -p
b. Create the keystone database:
    CREATE DATABASE keystone;
c. Grant proper access to the keystone database:
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
IDENTIFIED BY 'KEYSTONE_DBPASS';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
IDENTIFIED BY 'KEYSTONE_DBPASS';
o
************* all the above completed successfully
o
then
page 32
To install and configure the components
o
apt-get install keystone python-keystoneclient
***** successful
o
2. Edit the /etc/keystone/keystone.conf
[DEFAULT]
...
admin_token = ADMIN_TOKEN
...
[database]
...
connection = mysql://keystone:KEYSTONE_DBPASS@controller/keystone
...
[token]
...
provider = keystone.token.providers.uuid.Provider
driver = keystone.token.persistence.backends.sql.Token
...
[DEFAULT]
...
verbose = True
o
********** ALL VALUES ARE AS THIS EXCEPT THE KEYSTONE_DBPASS AND ADMIN-TOKEN
********** keystone_dbpass matches the one in "IDENTIFIED BY 'KEYSTONE_DBPASS';"
o 
netstat -anutp
** shows 0.0.0.0:35357    ... listen
** shows 127.0.0.1:35357  ...  time-wait 
o
nmap -PNO controller
port
----
22/tcp  open ssh
5000/tcp
o
o
telnet 0 
*** works
telnet 0 35357
*** works

Thoughts and assistance solicited.

wm
==============================
stat("/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", {st_mode=S_IFREG|0644, st_size=10930, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3519, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3519, ...}) = 0
write(2, "2015-01-15 12:59:56.105 2864 CRI"..., 72622015-01-15 12:59:56.105 2864 CRITICAL keystone [-] OperationalError: (OperationalError) (1184, "Aborted connection 33 to db: 'keystone' user: 'keystone' host: 'controller' (init_connect command failed)") None None
2015-01-15 12:59:56.105 2864 TRACE keystone Traceback (most recent call last):
2015-01-15 12:59:56.105 2864 TRACE keystone   File "/usr/bin/keystone-manage", line 44, in <module>
2015-01-15 12:59:56.105 2864 TRACE keystone     cli.main(argv=sys.argv, config_files=config_files)
2015-01-15 12:59:56.105 2864 TRACE keystone   File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 307, in main
2015-01-15 12:59:56.105 2864 TRACE keystone     CONF.command.cmd_class.main()
2015-01-15 12:59:56.105 2864 TRACE keystone   File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 74, in main
2015-01-15 12:59:56.105 2864 TRACE keystone     migration_helpers.sync_database_to_version(extension, version)
2015-01-15 12:59:56.105 2864 TRACE keystone   File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration_helpers.py", line 204, in sync_database_to_version
2015-01-15 12:59:56.105 2864 TRACE keystone     _sync_common_repo(version)
2015-01-15 12:59:56.105 2864 TRACE keystone   File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration_helpers.py", line 157, in _sync_common_repo
2015-01-15 12:59:56.105 2864 TRACE keystone     engine = sql.get_engine()
2015-01-15 12:59:56.105 2864 TRACE keystone   File "/usr/lib/python2.7/dist-packages/keystone/common/sql/core.py", line 188, in get_engine
2015-01-15 12:59:56.105 2864 TRACE keystone     return _get_engine_facade().get_engine()
2015-01-15 12:59:56.105 2864 TRACE keystone   File "/usr/lib/python2.7/dist-packages/keystone/common ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason too localized by tarawa1943
close date 2015-01-30 18:21:03.628515

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-01-16 01:22:26 -0600

First keystone service should not be running when you do db sync. Db sync will read the SQL connection string from keystone.conf and then use that to create schema in the db.

edit flag offensive delete link more

Comments

Thank you for the reply, will try that and post back here.

tarawa1943 gravatar imagetarawa1943 ( 2015-01-16 07:58:36 -0600 )edit

More results, stopped keystone service but the same result, any help appreciated. Note: exact coding as in install manual. Up to : su -s /bin/sh -c "keystone-manage db_sync" keystone

tarawa1943 gravatar imagetarawa1943 ( 2015-01-16 08:36:38 -0600 )edit

Is there a functional difference in the

[database] ...

connection = mysql://keystone:KEYSTONE_DBPASS@controller/keystone

versus

GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \

IDENTIFIED BY 'KEYSTONE_DBPASS';

????????

tarawa1943 gravatar imagetarawa1943 ( 2015-01-16 08:39:19 -0600 )edit

You need run the grant on the db before db sync will succeed. Is localhost = controller in your setup?

sfcloudman gravatar imagesfcloudman ( 2015-01-16 10:01:01 -0600 )edit

Posted the results (see original posting) and necessary documents of my.cnf and keystone.conf, along with nmap and netstat, YES, grant was changed to controller in mysql (testedLOCALHOST) . Trace shows same results. Is there a special port I am missing to connect to the mysql keystone database?

tarawa1943 gravatar imagetarawa1943 ( 2015-01-16 11:49:04 -0600 )edit
0

answered 2015-01-30 14:59:20 -0600

tarawa1943 gravatar image

Problem solved when the hostname "controller" or one of your choosing is appropriately defined in the DNS that is in your provider domain. In my case I have to ensure DNS forwarding request and the problem was solved. Please close this one.

edit flag offensive delete link more

Comments

What are the steps you executed here? I am facing similar issue and I am newbie to openstack

santhoshbachu gravatar imagesanthoshbachu ( 2018-05-23 23:52:21 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-01-15 16:02:03 -0600

Seen: 2,502 times

Last updated: Jan 30 '15