This commit is contained in:
2025-07-17 14:32:38 +02:00
parent b5160ecee7
commit b3ef66d84e
5 changed files with 16 additions and 10 deletions

View File

@ -9,12 +9,13 @@
{{- $fqdn := printf "%s.%s" $hostname $domain }}
{{- $hostid := sha1sum $hostname }}
{{- $quorum := env "VALKEY_QUORUM" }}
{{- $master_name := env "VALKEY_MASTER_NAME" }}
#-REPLICAS:{{ $replicas }}
dir "/tmp"
port {{ $sentinel_port }}
sentinel monitor mymaster SENTINEL_MASTER {{ $port }} {{ $quorum }}
sentinel down-after-milliseconds mymaster 60000
sentinel monitor {{ $master_name }} SENTINEL_MASTER {{ $port }} {{ $quorum }}
sentinel down-after-milliseconds {{ $master_name }} 60000
# User-supplied sentinel configuration:
# End of sentinel configuration
@ -32,8 +33,8 @@ protected-mode no
# gotemplate-pause!
user default on nopass sanitize-payload ~* &* +@all
# gotemplate-resume!
sentinel config-epoch mymaster 0
sentinel leader-epoch mymaster 0
sentinel config-epoch {{ $master_name }} 0
sentinel leader-epoch {{ $master_name }} 0
sentinel current-epoch 0
{{- range $i, $e := until ( int $replicas ) }}
@ -41,7 +42,7 @@ sentinel current-epoch 0
{{- $ndeFQDN := printf "%s.%s" $ndeHostname $domain }}
{{- $nodeID := sha1sum $ndeHostname }}
{{- if (ne $fqdn $ndeFQDN) }}
sentinel {{ printf "known-sentinel mymaster %s %s %s" $ndeFQDN $sentinel_port $nodeID }}
sentinel {{ printf "known-replica mymaster %s %s" $ndeFQDN $port }}
sentinel {{ printf "known-sentinel {{ $master_name }} %s %s %s" $ndeFQDN $sentinel_port $nodeID }}
sentinel {{ printf "known-replica {{ $master_name }} %s %s" $ndeFQDN $port }}
{{- end}}
{{- end}}