Browse Source

chore(CI): fix redis ssl cluster error

zhanghongtong 4 years atrás
parent
commit
ef88b283e8

+ 1 - 0
.ci/docker-compose-file/redis/redis-tls.conf

@@ -5,6 +5,7 @@ tls-cert-file /tls/redis.crt
 tls-key-file /tls/redis.key
 tls-key-file /tls/redis.key
 tls-ca-cert-file /tls/ca.crt
 tls-ca-cert-file /tls/ca.crt
 tls-replication yes
 tls-replication yes
+tls-cluster yes
 protected-mode no
 protected-mode no
 requirepass public
 requirepass public
 masterauth public
 masterauth public

+ 5 - 1
.ci/docker-compose-file/redis/redis.sh

@@ -90,7 +90,11 @@ do
         continue;
         continue;
     fi
     fi
     if [ "${node}" = "cluster" ] ; then
     if [ "${node}" = "cluster" ] ; then
-      yes "yes" | redis-cli --cluster create "$LOCAL_IP:7000" "$LOCAL_IP:7001" "$LOCAL_IP:7002" --pass public --no-auth-warning;
+      if $tls ; then
+       yes "yes" | redis-cli --cluster create "$LOCAL_IP:8000" "$LOCAL_IP:8001" "$LOCAL_IP:8002" --pass public --no-auth-warning --tls true --cacert /tls/ca.crt --cert /tls/redis.crt --key /tls/redis.key;
+      else
+        yes "yes" | redis-cli --cluster create "$LOCAL_IP:7000" "$LOCAL_IP:7001" "$LOCAL_IP:7002" --pass public --no-auth-warning;
+      fi
     elif [ "${node}" = "sentinel" ] ; then
     elif [ "${node}" = "sentinel" ] ; then
       tee /_sentinel.conf>/dev/null << EOF
       tee /_sentinel.conf>/dev/null << EOF
 port 26379
 port 26379