feat: create redisha module
- manage redis/sentinel clusters - ensure ulimit_managed is false - dynamically find servers in role to identify master - add redisadm and sentineladm commands - add script to check if the current host in the master
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/bash
|
||||
sudo /usr/local/sbin/sentineladm info | grep -q <%= @facts['networking']['fqdn'] %>
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/bash
|
||||
REDIS_HOST=<%= @redis_host %>
|
||||
REDIS_PORT=<%= @redis_port %>
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
REDISCLI_AUTH=<%= @requirepass %> redis-cli -h "$REDIS_HOST" -p "$REDIS_PORT" "$@"
|
||||
else
|
||||
REDISCLI_AUTH=<%= @requirepass %> redis-cli -h "$REDIS_HOST" -p "$REDIS_PORT"
|
||||
fi
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/bash
|
||||
REDIS_HOST=<%= @redis_host %>
|
||||
SENTINEL_PORT=<%= @sentinel_port %>
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
REDISCLI_AUTH=<%= @requirepass %> redis-cli -h "$REDIS_HOST" -p "$SENTINEL_PORT" "$@"
|
||||
else
|
||||
REDISCLI_AUTH=<%= @requirepass %> redis-cli -h "$REDIS_HOST" -p "$SENTINEL_PORT"
|
||||
fi
|
||||
Reference in New Issue
Block a user