原文:http://www.javaweb1024.com/data/NoSQL/2015/06/29/785.htmlhtml
redis是當前比較熱門的NOSQL系統之一,它是一個key-value存儲系統。和Memcached相似,但很大程度補償了memcached的不足,它支持存儲的value類型相對更多,包括string、list、set、zset和hash。這些數據類型都支持push/pop、add/remove及取交集並集和差集及更豐富的操做。在此基礎上,redis支持各類不一樣方式的排序。Redis數據都是緩存在計算機內存中,而且會週期性的把更新的數據寫入磁盤或者把修改操做寫入追加的記錄文件。java
版本:3.0.2web
下載地址:http://download.redis.io/releases/redis-3.0.2.tar.gzredis
下載完之後,放在/home目錄下緩存
[root@localhost home]# tar -zxvf redis-3.0.2.tar.gzmemcached
附:我把名字默認目錄redis-3.0.2 改成redis測試
[root@localhost home]# cd redisthis
[root@localhost redis]# makeserver
啓動 redis 與以前版本不同, redis的啓動放在src下htm
[root@localhost src]# ./redis-server ../redis.conf
出現
8169:M 28 Jun 20:48:09.191 * Increased maximum number of open files to 10032 (it was originally set to 1024).
8169:M 28 Jun 20:48:09.199 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with 'noeviction' policy now.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.2 (00000000/0) 32 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 8169
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
8169:M 28 Jun 20:48:09.199 # Server started, Redis version 3.0.2
8169:M 28 Jun 20:48:09.200 # 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.
8169:M 28 Jun 20:48:09.200 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
8169:M 28 Jun 20:48:09.200 * The server is now ready to accept connections on port 6379
8169:M 28 Jun 21:03:10.091 * 1 changes in 900 seconds. Saving...
8169:M 28 Jun 21:03:10.093 * Background saving started by pid 8311
8311:C 28 Jun 21:03:10.111 * DB saved on disk
8311:C 28 Jun 21:03:10.113 * RDB: 0 MB of memory used by copy-on-write
8169:M 28 Jun 21:03:10.193 * Background saving terminated with success
測試
[root@localhost src]# ./redis-cli
127.0.0.1:6379> set foo 1
OK
127.0.0.1:6379> get foo
"1"
127.0.0.1:6379> TYPE foo
string
127.0.0.1:6379>
表示成功