Ask Your Question
0

HAProxy MySQL-Galera Keystone error (HTTP 500)

asked 2015-05-06 09:03:24 -0500

Janki gravatar image

updated 2015-05-06 09:05:04 -0500

I have 2 nodes configured with HAProxy and MySQL-Galera on Ubuntu 14.04 bare metal.

server1 (IP1): HAproxy + galera + keystone
server2 (IP2): HAproxy + galera + keystone
1 virtual-ip

When I run

$ keystone --debug user-create --name=admin --pass=password --email=id

It throws following error

DEBUG:keystoneclient.session:REQ: curl -i -X POST http://virtual-ip:35357/v2.0/users -H "User-Agent: python-keystoneclient" -H "Content-Type: application/json" -H "X-Auth-Token: abaef661e5e568ded5fd" -d '{"user": {"email": "id", "password": "password", "enabled": true, "name": "admin", "tenantId": null}}' 
INFO:urllib3.connectionpool:Starting new HTTP connection (1): virtual-ip 
DEBUG:urllib3.connectionpool:Setting read timeout to 600.0 
DEBUG:urllib3.connectionpool:"POST /v2.0/users HTTP/1.1" 500 143 
DEBUG:keystoneclient.session:RESP: [500] CaseInsensitiveDict({'date': 'Wed, 06 May 2015 13:33:20 GMT', 'vary': 'X-Auth-Token', 'content-length': '143', 'content-type': 'application/json', 'x-distribution': 'Ubuntu'}) 
RESP BODY: {"error": {"message": "An unexpected error prevented the server from fulfilling your request.", "code": 500, "title": "Internal Server Error"}}
DEBUG:keystoneclient.session:Request returned failure status: 500 
An unexpected error prevented the server from fulfilling your request. (HTTP 500)  

echo $OS_SERVICE_TOKEN
abaef661e5e568ded5fd 
$ echo $OS_SERVICE_ENDPOINT 
http://<virtual-ip>:35357/v2.0

/etc/keystone/keystone.conf

admin_token=abaef661e5e568ded5fd
rabbit_hosts=IP1:5672,IP2:5672
rabbit_password=guest
connection = mysql://keystone:password@<virtual-ip>/keystone

mysql -h Virtual-ip -u root -p

select user,host from mysql.user; 
+------------------+-----------+ 
| user             | host      | 
+------------------+-----------+ 
| keystone         | %         | 
| root             | %         | 
| root             | 127.0.0.1 | 
| root             | ::1       | 
| debian-sys-maint | localhost | 
| root             | localhost | 
| root             | server1   | 
+------------------+-----------+ 
7 rows in set (0.10 sec)

What could be the reason? Any help is appreciated.

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2015-05-07 07:38:50 -0500

Janki gravatar image

updated 2015-05-07 07:40:21 -0500

Adding as an answer because comment space is not sufficient:

I reinstalled keystone and then the users were added, endpoints created. Now I am getting error with below command

keystone user-list

The error message is at this paste..

Added mysql users

mysql> select user,host from mysql.user; 
+------------------+--------------+ 
| user             | host         | 
+------------------+--------------+ 
| keystone         | %            | 
| root             | %            | 
| keystone         | IP1 | 
| keystone         | IP2 | 
| keystone         | VIP | 
| root             | 127.0.0.1    | 
| root             | ::1          | 
| debian-sys-maint | localhost    | 
| keystone         | localhost    | 
| root             | localhost    | 
+------------------+--------------+ 
10 rows in set (0.00 sec)

Telnet to mysql

root@server2:/var/log/keystone# telnet VIP 3308 
Trying 10.107.0.180... 
Connected to 10.107.0.180. 
Escape character is '^]'. 
R 
5.6.23-1trustyZ#v'[wcjl#�#tMb%/\c^,^vYmysql_native_passwordConnection closed by foreign host.

I have installed mysql-galera wsrep-5.6 from its official site. After installing MySQL didnot start. I had to manually start with command

mysqld --console
edit flag offensive delete link more

Comments

Galera cluster is working fine. I have created keystone users, endpoints, tenants. These are in keystone DB as well.

Janki gravatar imageJanki ( 2015-05-07 07:47:17 -0500 )edit
0

answered 2015-05-07 10:41:57 -0500

jtopjian gravatar image

Do you have HAProxy configured to round-robin the MySQL traffic? If so, change the balance config to something where the source connection will always hit the same mysql node.

Or just make one of the mysql nodes a designated "write" node by setting the opposite node as "backup". This will then send all traffic to the writing node and resolve any deadlock errors that you might encounter:

So you'll end up killing two birds with one stone.

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: 2015-05-06 09:03:24 -0500

Seen: 672 times

Last updated: May 07 '15