CentOS 7 安装Redis的注意事项

1 按照gcc:编译Redis必备 。

sudo yum install -y gcc*

2 安装tcl:为了执行make test

sudo yum install -y tcl

3 MALLOC=libc: zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or director
选择用libc这个模式

make MALLOC=libc
make test MALLOC=libc

4 为了以后的远程访问,需要在安全组里开启6379的端口

安全组的设置
5 为了后台运行,需要修改文件目录下的 redis.conf的文件:并且复制到src的目录下

这里写图片描述

6 编译的成功后在src的目录中有可以运行文件,服务器运行文件利用配置文件运行。

 src/redis-server src/redis.conf

运行后的结果

27031:C 23 Aug 23:38:22.068 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
27031:C 23 Aug 23:38:22.068 # Redis version=4.0.11, bits=64, commit=00000000, modified=0, pid=27031, just started
27031:C 23 Aug 23:38:22.068 # Configuration loaded

可以看到运行起来了,用客户端来进行测试这个

[root@VM_0_12_centos redis-4.0.11]# ./src/redis-cli
127.0.0.1:6379>

基本上到了这里就结束了。

猜你喜欢

转载自blog.csdn.net/RAYFUXK/article/details/81990177