This resource fully supports master/slave replication. The master preference of a node is determined by the 'slave_priority' parameter of the redis config.
When taking the resource from 'unmanaged' to 'managed', the currently active master will be given a priority of 1000 (plus 1 for each active connection). The default 'slave_priority' is 100, so the master will stay master. For a slave to become master after converting the resource to managed, set a slave_priority greater than 1000.
</longdesc>
<shortdesc lang="en">Redis server</shortdesc>
<parameters>
<parameter name="bin" unique="0" required="0">
<longdesc lang="en">
Path to \`redis-server\`
</longdesc>
<shortdesc lang="en">Path to \`redis-server\`</shortdesc>
ocf_log debug "monitor: Setting master score to '$score'"
- crm_master -v "$score"
+ crm_master_reboot -v "$score"
fi
if [[ "${info[role]}" == "master" ]]; then
return $OCF_RUNNING_MASTER
fi
if [[ -n "$CHECK_SLAVE_STATE" ]]; then
if [[ "${info[master_link_status]}" != "up" ]]; then
ocf_log err "monitor: Slave mode link has failed (link=${info[master_link_status]})"
return $OCF_ERR_GENERIC
fi
if [[ "${info[master_host]}" != "${OCF_RESKEY_CRM_meta_notify_master_uname}" ]]; then
ocf_log err "monitor: Slave mode current master does not match running master. current=${info[master_host]}, running=${OCF_RESKEY_CRM_meta_notify_master_uname}"
return $OCF_ERR_GENERIC
fi
fi
fi
return $OCF_SUCCESS
}
function start() {
monitor
status=$?
if (( status == OCF_SUCCESS )) || (( status == OCF_RUNNING_MASTER )); then