centos redis 3.2.11 安装与配置

centos 7

下载解压

wget http://download.redis.io/releases/redis-3.2.11.tar.gz

tar xzf redis-3.2.11.tar.gz

进入解压目录make

 

修改redis.conf   

远程访问  注释掉  bind 127.0.0.0  修改 protectmode 为 no

设置密码  requirepass  设置密码

 

配置文件启动

src/redis-server redis.conf 启动  , 并测试连接是否正常

 

 

开机启动

1 . 修改redis.conf   将 daemonize 设置为yes

2. mkdir /etc/redis ; cp redis.conf /etc/redis/6379.conf ; cp src/redis-server /usr/local/bin ; cp src/redis-cli /usr/local/bin ; cp utils/redis_init_script /etc/init.d/redis

修改/etc/init.d/redis 增加 

# chkconfig: 2345 90 10
# description: Redis is a persistent key-value database

两行

 

4.#设置为开机自启动服务器 
chkconfig redis on 
#打开服务 
service redis start 
#关闭服务 
service redis stop

***
5.重启 reboot
执行ps指令,查看redis 6379端口已经启动

 

posted @ 2018-05-04 20:12  每天多帅一点点  阅读(370)  评论(0编辑  收藏  举报