Redis 部署 与 开机自启脚本的使用(Ubuntu16.04 & CentOS7)

highly recommended 

https://redis.io/topics/quickstart

#Ubuntu 16.04
#下载压缩包,并解压
make
make install

cp src/redis-server /usr/local/bin/
cp src/redis-cli /usr/local/bin/

mkdir /etc/redis
mkdir /var/redis

cp utils/redis_init_script /etc/init.d/redis_6379

vi /etc/init.d/redis_6379  #修改开机自启脚本,如有必要,修改端口信息
mkdir /var/redis/6379

#修改配置文件
cp redis.conf /etc/redis/6379.conf
vi /etc/redis/6379.conf  
    #Set daemonize to yes (by default it is set to no).
    #Set the pidfile to /var/run/redis_6379.pid (modify the port if needed).
    #Change the port accordingly. In our example it is not needed as the default port is already 6379.
    #Set your preferred loglevel.
    #Set the logfile to /var/log/redis_6379.log
    #Set the dir to /var/redis/6379 (very important step!)

#启动开机自启脚本
service redis_6379 start

#CentOS7
chkconfig --add /etc/init.d/redis_6379
chkconfig redis_6379 on

#Ubuntu16.04
service redis_6379 start

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值