Ask Your Question
0

How to configure memcache in OpenStack HA ?

asked 2017-02-12 20:32:08 -0500

ZDgdtc gravatar image

To simulate OpenStack HA environment, I have configured mariadb-galera, RabbitMQ cluster and HAProxy on controller1, controller2 and controller3. After I configured /etc/keystone/keystone.conf, some mistakes occured. When I tried to get token through admin with password, it said:

An unexpected error prevented the server from fulfilling your request. (HTTP 500) (Request-ID: req-00e4b4d6-cccb-4aa9-be3d-62ee41f907d6)

Here is the configuration in /etc/keystone/keystone.conf

[DEFAULT]
admin_token = 41a80ce6f0550cc93455
verbose = True
debug = True
[catalog]
driver = keystone.catalog.backends.sql.Catalog
[database]
connection = mysql://keystone:000000@controller/keystone
[eventlet_server]
public_bind_host = 192.168.10.110
admin_bind_host = 192.168.10.110
[identity]
driver = keystone.identity.backends.sql.Identity
[memcache]
servers = controller1:11211,controller2:11211,controller3:11211
dead_retry = 300
socket_timeout = 3
pool_maxsize = 10
pool_unused_timeout = 60
pool_connection_get_timeout = 10
[oslo_messaging_rabbit]
rabbit_hosts = controller1:5672,controller2:5672,controller3:5672
rabbit_retry_interval=1
rabbit_retry_backoff=2
rabbit_max_retries=0
rabbit_durable_queues=true
rabbit_ha_queues=true
[revoke]
driver = sql
caching = true
[token]
provider = uuid
driver = memcache
caching = true

After I changed servers = controller1:11211,controller2:11211,controller3:11211 to servers:localhost:11211, it worked. So I want to know how to configure keystone.conf if I want to construct a memcache cluster?

edit retag flag offensive close merge delete

Comments

Have you resolved this issue? I have only one control node, but I learned that [memcache] section is deprecated, use oslo.cache instead, it's [cache] section and 'memcache_servers' value. I'm preparing the requirements for a HA environment and stumbled upon the same issue:

eblock gravatar imageeblock ( 2018-03-06 08:45:24 -0500 )edit

Authentication fails if I use the management IP address instead of localhost. Now I'm debugging how to resolve this, because I'll need a list of servers for HA so localhost can't be an option, right? Can anyone shed some light on this?

eblock gravatar imageeblock ( 2018-03-06 08:47:36 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-03-06 09:27:27 -0500

eblock gravatar image

Almost immediately after I commented your question I found an answer for one part of my problem.

First, there's the deprecated [memcache] section. Mitaka already reported the deprecation warning as from Pike so we assumed our setup should still work, but it didn't. As soon as we switched to oslo.cache - [cache] section in keystone.conf - memcached worked as expected. We upgraded to Ocata in the meantime.

Second, the HA setup. I'm currently gathering information for a HA setup where I tried to identify necessary steps. I'll have to configure the clients to use multiple servers, so configuring memcached to use localhost has to be changed, but into what? I tried to use the management ip address as suggested by the install guide, which seems reasonable, but configuring the dashboard and keystone.conf accordingly lead to errors in /var/log/apache2/openstack-dashboard-error_log:

[wsgi:error] [pid 12265] Login successful for user "admin", remote address <MY_IP>.
[wsgi:error] [pid 12265] Internal Server Error: /auth/login/
[wsgi:error] [pid 12265] Traceback (most recent call last):
[...]
[wsgi:error] [pid 12265]     "Unable to create a new session key. "
[wsgi:error] [pid 12265] RuntimeError: Unable to create a new session key. It is likely that the cache is unavailable.

I found [1] and simpy tried both, localhost AND management ip, and it worked!

control:~ # grep MEMCACHED_PARAMS /etc/sysconfig/memcached
MEMCACHED_PARAMS="-l 127.0.0.1,<MANAGEMENT_IP>"

Of course, I don't know yet if this is the solution for the to-be-HA setup, but this actually both enabled caching and significantly improved the horizon dashboard performance. I had a bug reported for the poor performance two years ago [2]. It turned out to be both a documentation and a configuration issue.

[1] https://ask.openstack.org/en/question...

[2] https://bugs.launchpad.net/keystone/+...

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

2 followers

Stats

Asked: 2017-02-12 20:32:08 -0500

Seen: 1,158 times

Last updated: Mar 06 '18