安装Redis步骤:
1、下载Redis安装包 https://redis.io/download 版本:redis-5.0.3-tar-gz
2、将下载的redis-5.0.3-tar-gz 进行解压缩成 redis-5.0.3 命令:tar -zxvf redis-5.0.3-tar-gz
3、拷贝redis-5.0.3 这个到 /usr/local 这个目录下
4、进入 /usr/local/redis-5.0.3 目录下,编译安装
编译 :make
安装:make install
5、修改redis.conf
配置文件
6、启动Redis
启动时候要选择我们之前修改的配置文件才能使配置文件生效。
进入src目录
cd /usr/local/redis-3.2.5/src
启动服务
./redis-server ../redis.conf
7、登陆redis
./redis-cli -a 你的密码
参考链接:https://blog.csdn.net/qq_18661793/article/details/53719161
redis编译过程中,出现的问题解决方案:
就是需要编译安装BusyBox ,参考:https://blog.csdn.net/haofan_/article/details/78369352
编译安装BusyBox时,需要提前安装gcc 以及 gcc-arm-linux-gnueabihf
安装 gcc:参考:https://www.cnblogs.com/L-Arikes/p/3734382.html
安装 gcc-arm-linux-gnueabihf :sudo apt install gcc-arm-linux-gnueabihf
make时报如下错误:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/data0/src/redis-2.6.2/src'
make: *** [all] Error 2
原因是jemalloc重载了Linux下的ANSI C的malloc和free函数。解决办法:make时添加参数。
make MALLOC=libc
运行make test ,会有如下提示
[devnote@devnote src]$ make test
You need tcl 8.5 or newer in order to run the Redis test
make: ***[test] Error_1
解决办法是用apt安装tcl
sudo apt install tcl
参考:https://blog.csdn.net/lgh1117/article/details/48270085