Ask Your Question
0

OperationalError: (OperationalError) (2003, "Can't connect to MySQL server on 'controller' (111)") None Nonestal [closed]

asked 2014-11-13 06:34:03 -0500

Cheng Li gravatar image

updated 2014-11-13 06:46:33 -0500

dbaxps gravatar image

Hi after install nova, run the command,i can see only nova-consoleauth is up . After check the log i can see /var/log/nova/nova-cert.log : OperationalError: (OperationalError) (2003, "Can't connect to MySQL server on 'controller' (111)")

I think it's right in Nova.conf connection=mysql://nova:openstack@controller/nova

So how can i troubleshooting ? First time to install openstack.

root@controller:~# nova service-list
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-cert        | controller | internal | enabled | down  | 2014-11-13T10:08:42.000000 | -               |
| 2  | nova-consoleauth | controller | internal | enabled | up    | 2014-11-13T12:27:42.000000 | -               |
| 3  | nova-scheduler   | controller | internal | enabled | down  | 2014-11-13T10:08:42.000000 | -               |
| 4  | nova-conductor   | controller | internal | enabled | down  | 2014-11-13T10:08:40.000000 | -               |
| 5  | nova-compute     | compute01  | nova     | enabled | down  | 2014-11-13T10:08:35.000000 | -               |
| 6  | nova-network     | controller | internal | enabled | down  | 2014-11-13T10:08:39.000000 | -               |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Cheng Li
close date 2014-11-13 07:25:36.792362

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-11-13 07:33:15 -0500

yatin gravatar image

Your configuration is correct in nova.conf, It seems mysql server is not running, Check MySql server is running on "controller" using sudo service mysql status if it is not running, start it using sudo service mysql start Then start all nova services...

edit flag offensive delete link more

Comments

Yes, seems something is wrong with mysql. I reboot the node and i thought this can restart mysql. But only after restart mysql service , all things back to normal. Thanks for your suggestion.

Cheng Li gravatar imageCheng Li ( 2014-11-13 07:37:36 -0500 )edit
0

answered 2014-11-13 07:16:46 -0500

dbaxps gravatar image

Actually when you did nova set up password for user nova should be assigned. If this password is lost
Connect to mysql database as root ( just in case, you may consult mysql docs how root password may be reset )

[root@juno1 ~(keystone_admin)]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 992
Server version: 5.5.39-MariaDB-wsrep MariaDB Server, wsrep_25.10.r4014

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cinder             |
| glance             |
| keystone           |
| mysql              |
| neutron            |
| nova               |
| performance_schema |
| test               |
+--------------------+
9 rows in set (0.01 sec)

MariaDB [(none)]> SELECT User, Host, Password FROM mysql.user;
+----------------+-----------+-------------------------------------------+
| User           | Host      | Password                                  |
+----------------+-----------+-------------------------------------------+
| root           | localhost | *4CA2CA63CD8C78AB6905E3B9AC2FDF6C214BDA07 |
| cinder         | %         | *BFC671F5B705FEBA5A0D3E8398D79B19B8E4D1E4 |
| nova           | %         | *E7548B04C2DCF23DDB2FEA6AE9999395544ECE93 |
| glance         | %         | *734862901428E2280672DA6DDF20E28ED012A82D |
| keystone_admin | 127.0.0.1 | *82CFF63948F8E1496DFEDF05FAC27DCA05B1BFA1 |
| neutron        | %         | *2908F3DC64E9243C42B285A9F442ABF27DD65820 |
| keystone_admin | %         | *82CFF63948F8E1496DFEDF05FAC27DCA05B1BFA1 |
+----------------+-----------+-------------------------------------------+
7 rows in set (0.00 sec)

Now set up nova password as you like :-

 MariaDB [(none)]> UPDATE mysql.user SET Password = PASSWORD('abcd0101')
            -> WHERE User = 'nova';
   MariaDB [(none)]> FLUSH PRIVILEGES ;

Connection string for nova.conf would be :-

connection=mysql://nova:abcd0101@controller/nova
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-11-13 06:34:03 -0500

Seen: 6,932 times

Last updated: Nov 13 '14