nova cannot connect to the database, No address found
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?