From 6eccdd510ecdc6abf3452e9037b71b0de92ea7cf Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Wed, 22 May 2024 03:29:01 +0800 Subject: [PATCH] update --- plugins/redis/tpl/redis_slave.conf | 1 + scripts/init.d/mw.tpl | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/plugins/redis/tpl/redis_slave.conf b/plugins/redis/tpl/redis_slave.conf index e7115bde8..42072032c 100644 --- a/plugins/redis/tpl/redis_slave.conf +++ b/plugins/redis/tpl/redis_slave.conf @@ -15,6 +15,7 @@ requirepass {$REDIS_PASS} ################################ SNAPSHOTTING ################################# save "" +stop-writes-on-bgsave-error no ################################# REPLICATION ################################# diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index f4d359047..b7b1cbdee 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -393,6 +393,19 @@ mw_connect_mysql(){ } + +mw_redis(){ + CONF="${ROOT_PATH}/redis/redis.conf" + REDISPORT=$(cat $CONF |grep port|grep -v '#'|awk '{print $2}') + REDISPASS=$(cat $CONF |grep requirepass|grep -v '#'|awk '{print $2}') + if [ "$REDISPASS" != "" ];then + REDISPASS=" -a $REDISPASS" + fi + CLIEXEC="${ROOT_PATH}/redis/bin/redis-cli -p $REDISPORT$REDISPASS" + echo $CLIEXEC + ${CLIEXEC} +} + mw_venv(){ cd ${ROOT_PATH}/mdserver-web && source bin/activate } @@ -429,6 +442,7 @@ case "$1" in 'debug') mw_debug;; 'mirror') mw_mirror;; 'db') mw_connect_mysql;; + 'redis') mw_redis;; 'venv') mw_venv;; 'clean_lib') mw_clean_lib;; 'default')