CentOS 7 安装Redis 2.8.7
1、下载软件:wget wget http://download.redis.io/releases/redis-2.8.7.tar.gz
2、解压软件并编译安装:
tar -zxvf redis-2.8.7.tar.gz
mv redis-2.8.7.tar.gz redis
cd redis
make&&make install
等待编译一端时间即可(如果您的机器上没有c++编译环境,可以通过yum安装 gcc ,命令:yum -y install gcc)
cd src
启动redis-server:./redis-server../redis.conf
启动会发送警告:
12 Dec 21:55:32.830 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
安装提示,解决上述问题。默认的情况下,redis监听6379端口。
3、测试使用redis#使用 telnet
$ telnet localhost 6379
Trying ::1...
Connected to localhost.
Escape character is '^]'.
set likehua likehua
+OK
get likehua
$7
likehua
4、使用redis-benchmark对redis可以进行简单的性能测试。
1 $ ./redis-benchmark -h localhost -p 6379 -c 1000 -n 100000
2 ====== PING_INLINE ======
3 100000 requests completed in 2.03 seconds
4 1000 parallel clients
5 3 bytes payload
6 keep alive: 1
7
8 0.00%
页:
[1]