redis4.0.9 安装和集群配置
1、wget http://download.redis.io/releases/redis-4.0.9.tar.gz
2、需要安装编译环境
#yum -y install gcc-c++
#yum -y install gcc-c++
#yum -y install tcl
Downloading packages:
tcl-8.5.13-8.el7.x86_64.rpm | 1.9 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:tcl-8.5.13-8.el7.x86_64 1/1
Verifying : 1:tcl-8.5.13-8.el7.x86_64 1/1
Installed:
tcl.x86_64 1:8.5.13-8.el7
Complete!
3、安装redis
#tar zxvf redis-4.0.9.tar.gz
#cd redis-4.0.9
#make MALLOC=libc
cd src && make all
make[1]: Entering directory `/home/yunwei/redis/redis-4.0.9/src'
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/home/yunwei/redis/redis-4.0.9/src'
[root@localhost redis-4.0.9]# make install PREFIX=/usr/local/redis
cd src && make install
make[1]: Entering directory `/home/yunwei/redis/redis-4.0.9/src'
Hint: It's a good idea to run 'make test' ;)
INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[1]: Leaving directory `/home/yunwei/redis/redis-4.0.9/src'
运行make test, 有如下信息则说明安装成功
\o/ All tests passed without errors!
Cleanup: may take some time… OK
验证
[root@localhost src]# cd /home/yunwei/redis/redis-4.0.9/src
[root@localhost src]# ./redis-server 运行redis服务
46690:C 06 Jun 08:36:54.372 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
46690:C 06 Jun 08:36:54.373 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=46690, just started
46690:C 06 Jun 08:36:54.373 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
46690:M 06 Jun 08:36:54.373 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 4.0.9 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 46690
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
进入redis客户端
[root@localhost src]# ./redis-cli