1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| #进入redis目录 cd /opt/soft/redis #创建配置文件夹 mkdir config #拷贝原来的配置文件 cp redis.conf config #重命名 cd config mv redis.conf redis-6381.conf #去除所有注释行和空行显示 cat redis-6381.conf | grep -v "#" | grep -v "^$" #将去掉注释和空行的配置文件写入6382 cat redis-6381.conf | grep -v "#" | grep -v "^$" > redis-6382.conf #删除6381 rm -rf redis-6381.conf #编辑配置文件 vim redis-6382.conf #是否记录日志 daemonize yes #端口 port 6382 #工作路径 dir "/opt/soft/redis/data" #日志 logfile "6382.log" #保存退出 :wq #创建data文件夹 cd .. mkdir data #根据配置文件启动redis redis-server config/redis-6382.conf
|