Ask Your Question
1

HA MySQL Galera -- Keystone failed to connect [closed]

asked 2014-02-14 08:16:23 -0600

dheeru gravatar image

updated 2014-02-14 19:32:53 -0600

smaffulli gravatar image

Summary : Not able to connect to mysql using virtual IP address with keystone

HA setup with MySQL and Galera. Havan Ubuntu 12.04 LTS

  1. LB1 - HAproxy and KeepAlive - 192.168.2.61
  2. LB2 - HAProxy and KeepAlive - 192.168.2.84

  3. Controller1 - 192.168.2.161

  4. Controller2 - 192.168.2.90
  5. Controller3 - 192.168.2.118

Virtual IP address is 192.168.2.40 keepalive configuration. I'm able to ping this Ip address. I'm able to do 'telnet 192.168.2.40 3306" to mysql.

However through keystone I'm facing issue to connect mysql through Virtual IP address.

Setting up keystone now. When I run the command 'keystone-manage db_sync', it throws lot of errors. At the end I see the following

return Connection(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__
super(Connection, self).__init__(*args, **kwargs2)
sqlalchemy.exc.OperationalError: (OperationalError) (2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 0") None None

I tried to login using virtul IP address

root@controller1:/etc/ssh# mysql -h192.168.2.40 -uroot ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

Here is the info.

mysql -e "SET wsrep_on=OFF; GRANT ALL ON *.* TO wsrep_sst@'%' IDENTIFIED BY 'wspass'"; GRANT ALL ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'welcome123'; GRANT ALL ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'welcome123'; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \ IDENTIFIED BY 'welcome123'; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'welcome123';

Any gurus in this list who can help me ?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by dheeru
close date 2014-02-18 10:11:21.136793

Comments

Hi, Can you tell what rights did you give on the keystone database?

gabriel_staicu gravatar imagegabriel_staicu ( 2014-02-14 08:35:06 -0600 )edit

my virtual ip is 192.168.2.40. Did you add this as well ?

dheeru gravatar imagedheeru ( 2014-02-14 10:30:28 -0600 )edit

no I did not

gabriel_staicu gravatar imagegabriel_staicu ( 2014-02-14 11:02:15 -0600 )edit

thank Grabriel.No luck with above configuration also. I see packets flow to load balancer. I don't see the packet getting from load balancer back to controller node.

dheeru gravatar imagedheeru ( 2014-02-14 11:26:35 -0600 )edit

can you also paste haproxy.cfg?

gabriel_staicu gravatar imagegabriel_staicu ( 2014-02-14 11:32:58 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-02-14 09:28:35 -0600

gabriel_staicu gravatar image

I had a similar issue and I add in the grant permissions also the IP addresses of the load balancers like: GRANT ALL ON keystone.* TO 'keystone'@'192.168.2.61' IDENTIFIED BY 'welcome123'; GRANT ALL ON keystone.* TO 'keystone'@'192.168.2.84' IDENTIFIED BY 'welcome123'; Also the same for the access of the root user.

edit flag offensive delete link more
0

answered 2014-02-18 10:10:57 -0600

dheeru gravatar image

MySQL Galera with HA and VirtualIP address did not work. I spent good amount of time to trouble shoot and was not able to make it work using virtual IP. I just disabled the HA configuration in HAProxy. I have just setup MySQL galera cluster. I used the IP address controller1 in where ever SQL configuration is required(e.g keystone, glance, nova etc). It is working fine. If you need help in setting do contact me. I can help you.

edit flag offensive delete link more

Comments

I encounted this problem as well. Same error message as you. I was able to fix it and it is working well currently. Send me a message if you would like to have this answered.

SamYaple gravatar imageSamYaple ( 2014-02-19 13:22:22 -0600 )edit

Thanks Sam. I would like to make it work with VirtualIP.

dheeru gravatar imagedheeru ( 2014-02-19 20:30:04 -0600 )edit

I had "Lost connection to MySQL server at 'reading initial communication packet" due to the "bind-address" statement. Commenting it out solved this (so it listens on every interface). You can set it again after it works the first time.

SamYaple gravatar imageSamYaple ( 2014-02-21 13:13:57 -0600 )edit

The other cause for this was the HAProxy configuration. Youll need to add an "haproxy" user to mysql with read permissions and add this option "option mysql-check user haproxy" to the haproxy config. Don't use httpchk. tcpka is ok.

SamYaple gravatar imageSamYaple ( 2014-02-21 13:15:45 -0600 )edit

Thank you Sam. I will check this and revert. Right now I have progressed without VIP for MySQL. I will complete the setup and then apply your suggestion.

dheeru gravatar imagedheeru ( 2014-02-24 19:42:16 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-02-14 08:16:23 -0600

Seen: 2,094 times

Last updated: Feb 18 '14