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

安装redis-4.0.11

时间:2018-09-15 15:24:46      阅读:284      评论:0      收藏:0      [点我收藏+]

标签:desc   utils   lease   script   not run   file   mon   moni   database   

  • 安装
cd /download
wget wget http://download.redis.io/releases/redis-4.0.11.tar.gz
tar xvf redis-4.0.11.tar.gz
cd redis-4.0.11
make
make install

mkdir -p /var/redis/6379 # Redis的PID文件位置
mkdir -p /etc/redis # 配置文件
  • 配置文件
cp /download/redis-4.0.11/redis.conf /etc/redis/6379.conf
cd /etc/redis
vim 6379.conf

# 修改以下内容
daemonize = yes
port = 6379
pidfile = /var/run/redis_6379.pid
dir= /var/redis/6379
  • 启动脚本
cd /etc/init.d/
cp /download/redis-4.0.11/utils/redis_init_script /etc/init.d/redis_6379
vim /etc/init.d/redis_6379

# 加入以下内容
# chkconfig: 2345 90 10 
# description: Redis is a persistent key-value database

/etc/init.d/redis_6379 start
/etc/init.d/redis_6379 stop

# 设置开机执行redis脚本
chkconfig redis_6379 on

# 杀掉以前的redis进程。否则执行stop时,可能会报[/var/run/redis_6379.pid does not exist, process is not running]的错误
ps -ef | grep "redis"
kill 5013

service redis_6379 start
service redis_6379 stop

 



安装redis-4.0.11

标签:desc   utils   lease   script   not run   file   mon   moni   database   

原文地址:https://www.cnblogs.com/gelu/p/9650845.html

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