Ask Your Question
0

nova cannot connect to the database, No address found

asked 2018-10-30 12:40:39 -0600

yasharne gravatar image

I'm following tutorials https://docs.openstack.org/nova/rocky/install/controller-install-ubuntu.html (here) to install nova, the problem is when I run the command su -s /bin/sh -c "nova-manage api_db sync" nova as root, I get this error:

2018-10-30 20:38:20.637 27542 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 10 attempts left.: DBConnectionError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'controller' ([Errno -2] No address found)") (Background on this error at: http://sqlalche.me/e/e3q8)

the output of ping controller:

PING controller (192.168.7.135) 56(84) bytes of data.
64 bytes from controller (192.168.7.135): icmp_seq=1 ttl=64 time=0.016 ms

The output of netstat -tunap| grep 3306:

tcp        0      0 192.168.7.135:3306      0.0.0.0:*               LISTEN      1658/mysqld

the output of select Host,User from user in mysql:

+-----------+-----------+
| Host      | User      |
+-----------+-----------+
| %         | glance    |
| %         | keystone  |
| %         | nova      |
| %         | placement |
| localhost | glance    |
| localhost | keystone  |
| localhost | nova      |
| localhost | placement |
| localhost | root      |
+-----------+-----------+

relevant configurations on /etc/nova/nova.conf:

[api_database]
connection = mysql+pymysql://nova:password@controller/nova_api
[database]
connection = mysql+pymysql://nova:password@controller/nova
[placement_database]
connection = mysql+pymysql://placement:password@controller/placement

I have already used same syntax to setup glance and that works fine.

I'm using ubuntu 18.04 and trying to install openstack rocky.How can I fix this?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2018-10-31 02:16:53 -0600

Are you changed bind-IP in MySQL configuration file? If you changed bind IP in MySQL configuration you need to make a change in /etc/hosts also.try this it will work, otherwise, flush the privileges and give privileges again for a database.

edit flag offensive delete link more
0

answered 2018-11-02 12:07:00 -0600

novainfinite gravatar image

updated 2018-11-02 12:33:46 -0600

i see this error hundreds of time.

1-can you open your mysql by

mysql -u nova -h controller -p?

2-[placement_database] connection = mysql+pymysql://placement:password@controller/placement i think you should delete this line

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: 2018-10-30 12:40:39 -0600

Seen: 29 times

Last updated: Nov 02