pwd="$1"
if [ "$pwd" == "" ]; then
  pwd="defaultRedisPassword123#"
fi

cluster_ips=(
115.28.229.158
114.215.66.191
121.42.168.231
)

for ((i=0; i<${#cluster_ips[@]}; ++i))
do
cluster_ip=${cluster_ips[i]}
#echo $cluster_ip

    for n in {1..2}; do
	echo "$cluster_ip:638$n"
	#./redis-cli -a $pwd -h $cluster_ip -p 638$n config set requirepass ""
	./redis-cli -h $cluster_ip -p 638$n config set masterauth $pwd
	./redis-cli -h $cluster_ip -p 638$n config set requirepass $pwd
    done

done

