首先在你指定的文件夹下面创建启动与停止的脚本
touch start-all.sh
touch stop-all.sh
然后授权
chmod 777 start-all.sh
chmod 777 stop-all.sh
编辑启动命令
vim ./start-all.sh
redis-server /usr/local/etc/redis6379.conf
redis-server /usr/local/etc/redis6380.conf
redis-server /usr/local/etc/redis6381.conf
redis-sentinel /usr/local/etc/redis-sentinel26379.conf
redis-sentinel /usr/local/etc/redis-sentinel26380.conf
redis-sentinel /usr/local/etc/redis-sentinel26381.conf
编辑停止命令
vim ./stop-all.sh
/usr/local/Cellar/redis/6.2.6/bin/redis-cli -p 6379 shutdown
/usr/local/Cellar/redis/6.2.6/bin/redis-cli -p 26379 shutdown
/usr/local/Cellar/redis/6.2.6/bin/redis-cli -p 6380 shutdown
/usr/local/Cellar/redis/6.2.6/bin/redis-cli -p 26380 shutdown
/usr/local/Cellar/redis/6.2.6/bin/redis-cli -p 6381 shutdown
/usr/local/Cellar/redis/6.2.6/bin/redis-cli -p 26381 shutdown
配置完毕,看效果
|