首页 > 其他 > 详细

编译安装redis4.0

时间:2018-11-15 21:59:55      阅读:169      评论:0      收藏:0      [点我收藏+]

 下载redis4.0的安装包:http://download.redis.io/releases/redis-4.0.11.tar.gz

这里用的是已经下载到电脑上,只需上传即可

解压缩

[root@67 ~]# tar xvf redis-4.0.11.tar.gz 

查看,会生成redis-4.0.11

[root@67 ~]# ls
    redis-4.0.11

移动程序包

[root@67 ~]# mv redis-4.0.11 /usr/local/redis

创建文件保存目录

[root@67 ~]# mkdir /redis

创建用户

[root@67 ~]# useradd redis

生成配置文件

[root@67 ~]# cp -a  /usr/local/redis/redis.conf /redis

修改配置文件

[root@67 ~]# vim /redis/redis.conf
 68 bind 10.220.5.67
91 port 6379 <<<默认6379
135 daemonize yes <<<是否工作在后台运行模式
157 pidfile /redis/redis_6379.pid
170 logfile /redis/redis.log
262 dir /redis

修改属主,属组

[root@67 ~]# chown -R redis.redis /redis

启动,并查看

[root@67 ~]# /usr/local/redis/src/redis-server /redis/redis.conf                                        
[root@67 ~]# ss -tnl
State       Recv-Q Send-Q          Local Address:Port                         Peer Address:Port              
LISTEN      0      128               10.220.5.67:6379                                    *:*                  
LISTEN      0      128                         *:22                                      *:*                  
LISTEN      0      128                        :::22        

为了以后启动方便,需要导出二进制文件

[root@67 ~]# vim /etc/profile.d/redis.sh

PATH=$PATH:/usr/local/redis/
export PATH

[root@67 ~]# source /etc/profile.d/redis.sh

先关闭redis,由于是在做实验,用暴力的方法关闭

[root@67 ~]# pkill redis
[root@67 ~]# ss -tnl
State       Recv-Q Send-Q          Local Address:Port                         Peer Address:Port              
LISTEN      0      128                         *:22                                      *:*                  
LISTEN      0      128                        :::22                                     :::*                

使用二进制命令启动

[root@67 ~]# redis-server /redis/redis.conf
[root@67 ~]# ss -tnl
State       Recv-Q Send-Q          Local Address:Port                         Peer Address:Port              
LISTEN      0      128               10.220.5.67:6379                                    *:*                  
LISTEN      0      128                         *:22                                      *:*                  
LISTEN      0      128               10.220.5.67:16379                                   *:*                  
LISTEN      0      128                        :::22                                     :::*  

 

编译安装redis4.0

原文:https://www.cnblogs.com/bo-ke/p/9965991.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!