1.下载安装包 (离线下载直接ftp到服务器)
wget http://download.redis.io/releases/redis-6.0.1.tar.gz
2.解压
tar -xzvf redis-6.0.1.tar.gz
3.安装
[root@instance-6olzww4q redis-6.0.1]#cd redis-6.0.1/
[root@instance-6olzww4q redis-6.0.1]# make
[root@instance-6olzww4q redis-6.0.1]# make install
3.1错误1 .解决 如果遇到以下错误命令未找到
/bin/sh: cc: command not found
make[1]: *** [Makefile:293: adlist.o] Error 127
make[1]: Leaving directory '/root/redis-6.0.1/src'
make: *** [Makefile:6: all] Error 2
安装 yum -y install gcc gcc-c++ libstdc++-devel
3.2错误2.解决
[root@instance-6olzww4q redis-6.0.1]# make install
cd src && make install
make[1]: Entering directory '/root/redis-6.0.1/src'
CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: No such file or directory
#include <jemalloc/jemalloc.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:293: adlist.o] Error 1
make[1]: Leaving directory '/root/redis-6.0.1/src'
make: *** [Makefile:9: install] Error 2
使用 make MALLOC=libc
4.设置密码 远程登陆
vi redis.conf
#设置密码
# requirepass foobared
requirepass 123
#远程访问
#bind 127.0.0.1
protected-mode no // yes->no
#后台启动
daemonize yes // no->yes
5启动
[root@instance-6olzww4q src]# ./redis-server ../redis.conf
558:C 08 May 2020 08:56:48.711 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
558:C 08 May 2020 08:56:48.711 # Redis version=6.0.1, bits=64, commit=00000000, modified=0, pid=558, just started
558:C 08 May 2020 08:56:48.711 # Configuration loaded
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 6.0.1 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 558
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'