redis从2.9.9以后版本及以后开始支持cluster,而当前稳定版本2.8.5还不支持集群,故本次使用最新开发版本redis测试验证
1.redis安装使用
(1)下在redis,https://github.com/antirez/redis/tree/unstable,可以用git下载,也可以直接点右下方的DownloadZip
(2)解压unzip redis-unstable.zip
(3)编译,进入redis目录cdredis-unstable ,make, make完成后可以执行maketest查看编译是否成功,可makeinstall安装,或者将redis-unstable/src目录添加到path
如:exportredis=/home/nohack/software/redis-unstable
exportPATH=$PATH:${redis}/src
(4)测试验证是否安装成功
开启一个终端:输入redis-server
本次使用默认端口6379,正常显示如下:
[2939] 08 Feb 16:41:33.207 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf [2939] 08 Feb 16:41:33.208 * Max number of open files set to 10032 _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 2.9.11 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in stand alone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | `-._ `._ / _.-' | PID: 2939 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-' [2939] 08 Feb 16:41:33.210 # Server started, Redis version 2.9.11 [2939] 08 Feb 16:41:33.210 # 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. [2939] 08 Feb 16:41:33.219 * DB loaded from disk: 0.009 seconds [2939] 08 Feb 16:41:33.219 * The server is now ready to accept connections on port 6379
开启一个终端:输入redis-cli 127.0.0.1:6379>