update
This commit is contained in:
@@ -52,8 +52,8 @@ function Quit {
|
||||
function ModifyConf {
|
||||
local kv=
|
||||
local clusterEnabled=
|
||||
[ -e /etc/redis.conf ] && Print /etc/redis.conf already exists && return 0
|
||||
Print Modify conf ...
|
||||
[ -e /etc/redis.conf ] && Print /etc/redis.conf already exists. && return 0
|
||||
Print Modifying conf ...
|
||||
echo "bind 0.0.0.0
|
||||
protected-mode no
|
||||
maxmemory 6442450944
|
||||
@@ -69,7 +69,7 @@ maxmemory-policy volatile-random
|
||||
}
|
||||
|
||||
function DeployCluster {
|
||||
Print Deploy redis cluster ...
|
||||
Print Deploying redis cluster ...
|
||||
local i=
|
||||
local node=
|
||||
local nodesId=
|
||||
@@ -91,11 +91,11 @@ function DeployCluster {
|
||||
Print $node not enable cluster mode! && exit 100
|
||||
done
|
||||
done
|
||||
Print Create redis cluster with master nodes: ${MASTER_NODES[@]}
|
||||
Print Creating redis cluster with master nodes: ${MASTER_NODES[@]}
|
||||
$redisCliCmd --cluster-yes --cluster create ${MASTER_NODES[@]}
|
||||
nodesId="$($redisCliCmd -s $SOCK_FILE cluster nodes | cut -d@ -f1)"
|
||||
for i in ${!SLAVE_NODES[@]}; do
|
||||
Print Add slave node ${SLAVE_NODES[$i]} with master: ${MASTER_NODES[$i]}
|
||||
Print Adding slave node ${SLAVE_NODES[$i]} with master: ${MASTER_NODES[$i]}
|
||||
$redisCliCmd --cluster-yes --cluster add-node ${SLAVE_NODES[$i]} \
|
||||
${MASTER_NODES[0]} --cluster-slave \
|
||||
--cluster-master-id $(echo "$nodesId" \
|
||||
@@ -112,7 +112,7 @@ function Init {
|
||||
}
|
||||
|
||||
function StartProc {
|
||||
Print Start Redis ...
|
||||
Print Starting Redis ...
|
||||
redis-server /etc/redis.conf \
|
||||
--daemonize no \
|
||||
--dir $DATA_DIR \
|
||||
|
@@ -3,8 +3,9 @@ FROM harbor.colben.cn/general/alpine$ARCH
|
||||
MAINTAINER Colben colbenlee@gmail.com
|
||||
ADD --chown=root:root /ADD/ /opt/
|
||||
RUN apk update \
|
||||
&& apk add --no-cache redis \
|
||||
&& curl -sSLO https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.15/main/x86_64/redis-6.2.9-r0.apk \
|
||||
&& apk add --allow-untrusted redis-6.2.9-r0.apk \
|
||||
&& mv /etc/redis.conf /etc/redis.conf.origin \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
&& rm -rf /var/cache/apk/* redis-6.2.9-r0.apk
|
||||
CMD ["/opt/ccmd"]
|
||||
|
||||
|
Reference in New Issue
Block a user