宝塔服务器Linux环境下redis开启多端口
步骤一:
#在reids目录下,复制一份redis.conf,
cp redis.conf redis81.conf
步骤二:修改conf内容
vim redis81.conf
#93行
port 6381 #修改端口为需要的端口
#159行
pidfile /www/server/redis/redis81.pid #修改为新的pid
#172行
logfile "/www/server/redis/redis81.log" #修改为新的logfile
#254行
dbfilename dump81.rdb #修改为新的rdb文件名
#---------------------------------------------
vim:语句
按 i 进入insert模式,修改对应数据
按 esc 退出修改模式
按 :wq 保存退出
按 :q 不保存退出
步骤三:在redis目录下
/www/server/redis/src/redis-server /www/server/redis/redis81.conf
#其中redis81.conf为修改的配置文件
步骤四:redis-cli -p 6381
结果:ping ok