Patrick Emer edited this page Aug 29, 2013 · 8 revisions

This is a fork of the RA with redis. The redis RA only works with redis 2.6++

following corosync/cib settings should work with the redis resource agent:

primitive redis ocf:heartbeat:redis \
        params client_binary="/usr/bin/redis-cli -a 123234" pid="/var/run/redis/redis-server.pid" \
        meta target-role="Master" \
        op monitor interval="30s" role="Slave" timeout="30s" on-fail="restart"
ms redis_ms redis \
        meta clone-max="2" target-role="Master" notify="true"

This is a Setup if you want to use a secound instance of RedisDB

primitive redis_secound ocf:heartbeat:redis \
        params client_binary="/usr/bin/redis-cli -a 123123" \
        config="/etc/redis/cache.conf" \
        pid="/var/run/redis/cache.pid" \
        socket="/var/run/redis/cache.sock" \
        port="6380" \
        meta target-role="Master" \
        op monitor interval="30s" role="Slave" timeout="30s" on-fail="restart"
ms redis_secound_ms redis_secound \
        meta clone-max="2" target-role="Master" notify="true"

Notes:

client_binary for this setting is for authentification redis-cli -a 123234 = for authentification

The master and slave definition, came from the skript. Do not use config settings in the redis.conf to define the master host.

*You must set target-role="Master" !

Serverals of redis instanzes on one note: That sould work, but not tested yet. You must define socket option and define a other port.

Timeout - in premitive the option timeout="30s" defines also the absolut timeout of syncing of a slave node from a master. Be carefull of this setting

Testing:

  1. ocf-tester -n redis -o socket /tmp/tmp.socket
  2. pkill -9 redis-server on master or on slave host.
  3. Start of min two nodes, the skript can enforce the decision strongly. ( see post-start and promote)

Parameters implemented:

socket: Imported to use the resource agent port: Master and Slave must run under the same port pid: Pid file binary: The Server binary client_binary: The client binary to control and connect to the redis db. config: the path to the config file user: username for the process group: groupname log: the stdout log file.

What not work:

  • Serverlas of redis instanzes in one Master/Slave setup with different ports.
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.