Redis 单机和多实例部署 (2)

创建 redis_chkmult.cfg 用于记录上次创建 Redis 实例

$ vim /usr/local/redis/redis_chkmult.cfg PORTS="6381" SLAVE_CHK="true" 4.5 uninit 脚本 $ vim /usr/local/redis/uninit.sh #!/bin/sh # # define restricted path PATH="/bin:/usr/bin:/sbin:/usr/sbin" # adirname - return absolute dirname of given file adirname() { odir=`pwd`; cd `dirname $1`; pwd; cd "${odir}"; } # --------- # constants # --------- MYNAM=`basename "$0"` MYDIR=`adirname "$0"` MYTMP="${MYDIR}/../tmp" MYLCK="${MYTMP}/${MYNAM}.lock" PORTS=(${1//,/ }) vi /usr/local/redis/redis_chkmult.cfg for PORT in ${PORTS[@]} do /etc/init.d/redis_${PORT} stop sudo rm -rf /etc/init.d/redis_${PORT} sudo rm -rf /usr/local/redis/redis_${PORT} sudo rm -rf /etc/redis/redis_${PORT}.conf sudo rm -rf /data/redis/logs/redis_${PORT}.* sudo rm -rf /data/redis/${PORT}.* done $ chmod +x /usr/local/redis/uninit.sh 4.5 验证 init 脚本

创建一个 Redis 实例,端口为 6383

redis_init脚本

4.6 验证 uninit 脚本

删除 6383 实例

redis_uninit脚本

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wppdyf.html