centos redis安装及配置

安装命令 yum install redis
修改配置 vim /etc/redis.conf

需要修改的地方:
1、pidfile 指定自己的位置
   pidfile /data/redis/6379/redis.pid
2、bind 如果需要外网访问 将bind 127.0.0.1 注释掉
   或者bind为允许访问的ip
3、dir 目录 修改默认路径
   dir /data/redis/6379
4、rename-command CONFIG "" 取消注释
5、daemonize 选项 控制是否后台运行,改为no
6、可选密码 requirepass asd123

启动命令 redis-server /etc/redis.conf
连接客户端 redis-cli -h xxx.xxx.xxx.xxx -p xxxx -a asd123
关闭redis redis-cli shutdown

猜你喜欢

转载自sunmit1024.iteye.com/blog/2373566