解决方案:如下所示
yum install gcc-c++
wget http://download.redis.io/releases/redis-5.0.4.tar.gz
tar xzf redis-5.0.4.tar.gz
mkdir /usr/local/redis
cp -r ./redis-5.0.4 /usr/local/redis/redis-5.0.4
cd /usr/local/redis/redis-5.0.4
make
make install PREFIX=/usr/local/redis
cd
cd /usr/local/redis/redis-5.0.4
cp redis.conf /usr/local/redis/bin
vim /usr/local/redis/bin/redis.conf
修改daemonize no 为 daemonize yes 修改这个是代表允许后台启动,修改完成以后保存退出
cd /usr/local/redis/bin
./redis-server redis.conf
cd /usr/local/redis/bin/
./redis-cli
[root@hbs20190406 bin]# cd /usr/local/redis/bin/
[root@hbs20190406 bin]# ./redis-cli
127.0.0.1:6379> set foo bar
OK
127.0.0.1:6379> get foo
"bar"
127.0.0.1:6379>
5/14/2019 6:03:59 PM 已解决!