Ask Your Question
2

problem with keystone-manage db_sync

asked 2014-12-01 22:29:33 -0500

djepnguyen gravatar image

updated 2014-12-02 01:05:16 -0500

Hi everyone , im deplying openstack with openstackbook for beginner. when i install keystone i have a problem like below installed mysql -> OK create database

Create a database named keystone. mysql -uroot -pmygreatsecret -e 'CREATE DATABASE keystone;' Create a user named keystonedbadmin. mysql -uroot -pmygreatsecret -e 'CREATE USER keystonedbadmin;' Grant all privileges for keystonedbadmin on the database "keystone". mysql -uroot -pmygreatsecret -e "GRANT ALL PRIVILEGES ON keystone.* TO 'keystonedbadmin'@ - '%';" Create a password for the user "keystonedbadmin". mysql -uroot -pmygreatsecret -e "SET PASSWORD FOR 'keystonedbadmin'@'%' = PASSWORD(' - keystonesecret');"

then Keystone is the identity service used by OpenStack. Install Keystone using the following command. apt-get install keystone python-keystone python-keystoneclient Open /etc/keystone/keystone.conf, uncomment and change the line #admin_token = ADMIN so that it looks like admin_token = admin (We have used ’admin’ as the token in this book.) Since MySQL database is used to store keystone configuration, edit the following line in /etc/keystone/keystone.conf from connection = sqlite:////var/lib/keystone/keystone.db to connection = mysql://keystonedbadmin:keystonesecret@10.51.177.149/keystone

then i fill out

keystone-manage db_sync

there was an error like this:

2014-12-02 10:59:24.235 6546 CRITICAL keystone [-] OperationalError: (OperationalError) (1045, "Access denied for user 'keystonedbadmin'@'10.51.177.149' (using password: YES)") None None

could you help me to fix that. thanks so much and waiting your answer.

edit retag flag offensive close merge delete

Comments

The 'keystonedbadmin' user is being denied access for the admin action db_sync. You can source an admin user's credentials and then try to db_sync.

Kashyap Kopparam gravatar imageKashyap Kopparam ( 2014-12-01 22:57:44 -0500 )edit

the root cause might be in your mysql database access side, check if you have granted the admin permission in your mysql db for both user credentials(username and password) and the remote host to access?

9lives gravatar image9lives ( 2014-12-01 23:18:29 -0500 )edit

before do this command , i created and grandted all user like this: Create a database named keystone. mysql -uroot -pmygreatsecret -e 'CREATE DATABASE keystone;' Create a user named keystonedbadmin. mysql -uroot -pmygreatsecret -e 'CREATE USER keystonedbadmin;' Grant all privileges for keystonedbad

djepnguyen gravatar imagedjepnguyen ( 2014-12-01 23:40:10 -0500 )edit

@djepnguyen the install document does not say to create a user "keystone or "keystonedbadmin" user? Is this a bug in the install document of juno but known to those who have it working?

tarawa1943 gravatar imagetarawa1943 ( 2015-01-20 08:49:49 -0500 )edit

4 answers

Sort by » oldest newest most voted
2

answered 2014-12-02 03:32:33 -0500

HELLO,

just type in terminal,

mysql -u root -p (provide root password) create database keystone; grant all privileges on keystone.* to 'keystone'@'localhost' identified by 'KEYSTONE DBPASS';

grant all privileges on keystone.* to 'glance'@'%' identified by 'GLANCE DBPASS';

type: exit (come out of the mysql prompt)

then type: su -s /bin/sh -c "keystone-manage db_sync" keystone

edit flag offensive delete link more

Comments

thanks for your help. i just followed these your command. all are run normally.but after type su -s /bin/sh -c "keystone-manage db_sync" keystone the result is same : CRITICAL keystone [-] OperationalError: (OperationalError) (1045, "Access denied for user 'keystonedbadmin'@'10.51.177.149' (using p

djepnguyen gravatar imagedjepnguyen ( 2014-12-02 04:00:43 -0500 )edit

have you configured /etc/keystone/keystone.conf for database configurations.

PradeepNaik gravatar imagePradeepNaik ( 2014-12-02 04:10:15 -0500 )edit

thanks for your reply. i configured the keystone.conf like this: connection = mysql://keystonedbadmin:keystonesecret@10.51.177.149/keystone (10.51.177.149 is brigde ip of ubuntu server to connect public internet) admin_token=admin

djepnguyen gravatar imagedjepnguyen ( 2014-12-02 18:58:54 -0500 )edit

Thanks for your help. i resolve it. i forgot restarting all service before making keystone-manage db_sync dear who has same problem.please follow this guide above.

djepnguyen gravatar imagedjepnguyen ( 2014-12-03 20:36:41 -0500 )edit
0

answered 2014-12-01 23:30:50 -0500

Had you executed following lines in mysql after creating keystone database

GRANT ALL PRIVILEGES ON keystone.* TO 'keystonedbadmin'@'localhost' \   IDENTIFIED BY 'keystonesecret'; GRANT ALL PRIVILEGES ON keystone.* TO 'keystonedbadmin'@'%' \   IDENTIFIED BY 'keystonesecret';

Error clearly shows there are problem in syncing db due to db credentials.

edit flag offensive delete link more

Comments

1

thanks for answer.

djepnguyen gravatar imagedjepnguyen ( 2014-12-01 23:38:37 -0500 )edit

Please accept the answer. If it solves you problem.

Khayam gravatar imageKhayam ( 2014-12-01 23:47:09 -0500 )edit

after type GRANT ALL PRIVILEGES ON keystone.* TO 'keystonedbadmin'@'localhost' \ IDENTIFIED BY 'keystonesecret'; as your guide. the terminal notice: GRANT: command not found

djepnguyen gravatar imagedjepnguyen ( 2014-12-02 00:45:26 -0500 )edit

That is a mysql command. You must run it in mysql.

SamYaple gravatar imageSamYaple ( 2014-12-02 02:46:15 -0500 )edit

i tried but cant get the success. could you add my skype for quick support :D my skype: diep90.nguyen

djepnguyen gravatar imagedjepnguyen ( 2014-12-02 03:08:27 -0500 )edit
0

answered 2016-11-22 06:10:29 -0500

Bharathi gravatar image

Deleting and Re-creating Keystone Database fixed the issue!

type echo $? to let yourself know if the command is run successfully

edit flag offensive delete link more
0

answered 2015-11-19 09:54:29 -0500

check you mysql log and confirm if your my.cnf is correct . example , like me . my.cnf has the chinese character '‘'

cat /var/log/mysql/error.log

151119 23:17:31 [Warning] Aborted connection 28 to db: 'unconnected' user: 'keystone' host: 'localhost' (init_connect command failed) 151119 23:17:31 [Warning] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '’SET NAMES utf8’' at line 1

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-12-01 22:29:33 -0500

Seen: 5,788 times

Last updated: Dec 02 '14