redis 单节点安装

Posted cs294639693

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了redis 单节点安装相关的知识,希望对你有一定的参考价值。

wget http://download.redis.io/releases/redis-5.0.3.tar.gz

1.下载解压

技术分享图片

2.make编译

技术分享图片

3.提示没有安装安装gcc,安装gcc

yum install gcc

4.make 提示error: jemalloc/jemalloc.h: No such file or directory

[[email protected] redis-5.0.3]# make
cd src && make all
make[1]: Entering directory `/data/apps/redis-5.0.3/src‘
    CC Makefile.dep
make[1]: Leaving directory `/data/apps/redis-5.0.3/src‘
make[1]: Entering directory `/data/apps/redis-5.0.3/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 `/data/apps/redis-5.0.3/src‘
make: *** [all] Error 2
[[email protected] redis-5.0.3]# cd src/
[[email protected] src]# make
    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: *** [adlist.o] Error 1
[[email protected] src]# make all
    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: *** [adlist.o] Error 1
解决:执行  make MALLOC=libc  

5. make test 提示 You need tcl 8.5 or newer in order to run the Redis test

解决:

wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz 
tar xzvf tcl8.6.1-src.tar.gz
./configure 
make 
make install 

6. 再次测试redis

[[email protected] src]# pwd
cd redis-5.0.3/src

make test

Executing test client: couldn‘t open socket: connection refused.  这个错不管,执行下一步。

技术分享图片

7. make install安装

技术分享图片

8. 启动redis

修改redis.conf 中绑定ip为本机ip如:bind 192.168.1.71  默认为bind 127.0.0.1 不能远程访问

技术分享图片


9.安装redis客户端

https://github.com/uglide/RedisDesktopManager/releases/download/0.9.3/redis-desktop-manager-0.9.3.817.exe

技术分享图片
























以上是关于redis 单节点安装的主要内容,如果未能解决你的问题,请参考以下文章

Redis 的安装与使用(单节点)

redis 单节点安装

Redis单节点安装主从复制java连接redis和Redis集群安装

Redis单节点安装主从复制java连接redis和Redis集群安装

Redis单节点部署

redis单节点安装及cluster的安装