编译安装redis4.0

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

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

解压缩spa

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

查看,会生成redis-4.0.11code

[root@67 ~]# ls
    redis-4.0.11

移动程序包server

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

建立文件保存目录blog

[root@67 ~]# mkdir /redis

建立用户get

[root@67 ~]# useradd redis

生成配置文件io

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

修改配置文件class

[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                                     :::*  
相关文章
相关标签/搜索