码迷,mamicode.com
首页 > 其他好文 > 详细

centos redis 3.2.11 安装与配置

时间:2018-05-04 21:33:58      阅读:871      评论:0      收藏:0      [点我收藏+]

标签:自启动服务   key   daemonize   远程访问   ase   boot   art   chkconfig   执行   

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端口已经启动

 

centos redis 3.2.11 安装与配置

标签:自启动服务   key   daemonize   远程访问   ase   boot   art   chkconfig   执行   

原文地址:https://www.cnblogs.com/huhuixin/p/8992351.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!