centos7.5 安装 redis5.0.5

服务器环境:CentOS Linux release 7.5.1804
redis版本:5.0.5

[root@localhost ~]# tar -zxvf redis-5.0.5.tar.gz
[root@localhost ~]# cd redis-5.0.5
# 安装 Development Tools
[root@localhost redis-5.0.5]# yum groupinstall 'Development Tools' 

[root@localhost redis-5.0.5]# make

会出现如下错误

cd src && make all
make[1]: Entering directory `/root/redis-5.0.5/src'
    CC Makefile.dep
make[1]: Leaving directory `/root/redis-5.0.5/src'
make[1]: Entering directory `/root/redis-5.0.5/src'
    CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
 #include <jemalloc/jemalloc.h>
                               ^
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/root/redis-5.0.5/src'
make: *** [all] Error 2
# 解决方案
[root@localhost redis-5.0.5]# cd deps/
[root@localhost deps]# make hiredis lua jemalloc linenoise  

重新编译

[root@localhost deps]# cd ..
[root@localhost redis-5.0.5]# make

当出现如下信息,说明已经编译通过了:

Hint: It's a good idea to run 'make test' ;)

make[1]: Leaving directory `/root/redis-5.0.5/src'

安装

[root@localhost redis-5.0.5]# make install

安装成功

Hint: It's a good idea to run 'make test' ;)

    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
make[1]: Leaving directory `/root/redis-5.0.5/src'

查看安装文件以及目录

[root@localhost redis-5.0.5]# cd /usr/local/bin/
[root@localhost bin]# ls |grep redis
redis-benchmark
redis-check-aof
redis-check-rdb
redis-cli
redis-sentinel
redis-server
[root@localhost bin]# 

通常我们把官方的配置文件拷贝出来,在他基础上进行调整

[root@localhost bin]# cp ~/redis-5.0.5/redis.conf  /etc/
[root@localhost bin]# vim /etc/redis.conf 

更改如下几行

bind 127.0.0.1  	# 访问ip
protected-mode no # 关闭保护模式
daemonize yes     # 守护进程模式开启

启动

[root@localhost bin]# redis-server  /etc/redis.conf 
88005:C 28 Sep 2019 02:23:40.791 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
88005:C 28 Sep 2019 02:23:40.791 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=88005, just started
88005:C 28 Sep 2019 02:23:40.791 # Configuration loaded

查看是否启动成功

[root@localhost bin]# ps -ef | grep redis
root      88006      1  0 02:23 ?        00:00:00 redis-server 127.0.0.1:6379
# 通过redis-cli 查看相关信息
[root@localhost bin]# redis-cli
127.0.0.1:6379> INFO

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值