Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions addons/redis/scripts/redis-register-to-sentinel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ construct_sentinel_sub_command() {
echo "SENTINEL set $master_name auth-user $REDIS_SENTINEL_USER"
;;
"auth-pass")
if is_empty "$REDIS_SENTINEL_PASSWORD"; then
echo "SENTINEL set $master_name auth-pass \"\""
else
if ! is_empty "$REDIS_SENTINEL_PASSWORD"; then
echo "SENTINEL set $master_name auth-pass $REDIS_SENTINEL_PASSWORD"
fi
;;
Expand Down Expand Up @@ -252,7 +250,9 @@ register_to_sentinel() {
for cmd in "${sentinel_configure_commands[@]}"
do
sentinel_cli_cmd=$(construct_sentinel_sub_command "$cmd" "$master_name" "$redis_primary_host" "$redis_primary_port")
call_func_with_retry 3 5 execute_sentinel_sub_command "$sentinel_host" "$sentinel_port" "$sentinel_cli_cmd" || exit 1
if [ -n "$sentinel_cli_cmd" ]; then
call_func_with_retry 3 5 execute_sentinel_sub_command "$sentinel_host" "$sentinel_port" "$sentinel_cli_cmd" || exit 1
fi
done
set_xtrace_when_ut_mode_false
echo "redis sentinel register to $sentinel_host succeeded!"
Expand Down
4 changes: 3 additions & 1 deletion addons/redis/scripts/redis-sentinel-member-join.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,10 @@ recover_registered_redis_servers() {
echo "sentinel failover-timeout $master_name $master_failover_timeout"
echo "sentinel parallel-syncs $master_name $master_parallel_syncs"
echo "sentinel auth-user $master_name $REDIS_SENTINEL_USER"
echo "sentinel auth-pass $master_name $auth_pass"
} >> $redis_sentinel_real_conf
if ! is_empty "$auth_pass"; then
echo "sentinel auth-pass $master_name $auth_pass" >> $redis_sentinel_real_conf
fi
set_xtrace_when_ut_mode_false
sleep_when_ut_mode_false 30
master_name="" master_ip="" master_port="" master_down_after_milliseconds=""
Expand Down