yum -y install gcc make
wget http://download.redis.io/releases/redis-4.0.8.tar.gz
tar xzf redis-4.0.8.tar.gz
cd redis-4.0.8
make MALLOC=libc
vim redis.conf,将里面的daemonize no改成daemonize yes
进入src目录,执行
./redis-server ../redis.conf
至此redis已经启动了。用ps -ef|grep redis查看,redis默认端口是6379
用./redis-cli客户端命令进入redis,执行redis命令
set foo bar
get foo
一切正常!