feat(node): adding all in one node support
This commit is contained in:
26
resources/node/files/scripts/startSentinel.sh
Normal file
26
resources/node/files/scripts/startSentinel.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
PATH=${PATH}:/
|
||||
SENTINEL_MASTER=""
|
||||
|
||||
# Generate sentinel.conf file for Valkey Sentinel
|
||||
source /opt/scripts/common.sh
|
||||
|
||||
if [ -f /etc/valkey/sentinel.conf ]; then
|
||||
echo "Sentinel configuration file already exists, starting with this."
|
||||
else
|
||||
cp /etc/valkey/sentinel.conf.orig /etc/valkey/sentinel.conf
|
||||
hostname=$(hostname -f)
|
||||
|
||||
pingSentinel 1
|
||||
if [ $? -ne 0 ]; then
|
||||
SENTINEL_MASTER=$(hostname -f)
|
||||
else
|
||||
getPrimaryInfo
|
||||
SENTINEL_MASTER=$(getSentinelMasterName)
|
||||
fi
|
||||
|
||||
sed -i "s/SENTINEL_MASTER/${SENTINEL_MASTER}/g" /etc/valkey/sentinel.conf
|
||||
fi
|
||||
|
||||
valkey-sentinel /etc/valkey/sentinel.conf
|
Reference in New Issue
Block a user