System environment: Centos 6.3 x86_64
Redis Introduction
Redis essentially a key/value database, similar to the memcached NoSQL database, but his data can be persisted on disk, solve the service restart after the data is not lost, his value can be string (string), list (lists), Sets (set) or ordered sets (sorted collection), all data types have Push/pop, Add/remove, execute service-side sets, intersections, two sets sets of differences, and so on, these operations are atomic, Redis also supports a variety of different sorting capabilities
Redis 2.0 adds a number of new features, such as improved performance, new data types, and less memory usage (AOF and VM)
Redis supports most mainstream development languages, such as C, Java, C #, PHP, Perl, Python, Lua, Erlang, Ruby, etc.
Redis's function:
1, Redis Sharding:redis support the sharding function of the client, through the consistent hash algorithm implementation, the current Redis does not support fault redundancy, in the cluster can not add or delete online Redis
2, Redis master/slave replication:
1). A master supports multiple slave
2). Slave can accept other slave connections to replace him. Connect Master
3. Copying in Master is non-blocking, while the slave is blocked
4. Replication is exploited to provide scalability, providing only query functionality and data redundancy at the slave end
3, Redis virtual memory function: VM is a new Redis2.0 added a very stable and reliable function,
The VM is introduced to improve the performance of Redis, that is, to save infrequently used value to disk, while key is stored in memory. In fact, if you have 10w keys in memory, and only about 10% key is used frequently, Redis can switch to save infrequently used value by opening the VM to
4, Redis additional file (aof) function: Redis through the configured policy to save the dataset to the AOF, when the Redis can be restored through the AOF to the state before hanging off
Installation and configuration of Redis:
[Root@chen download]# wget [url=http://redis.googlecode.com/files/redis-2.0.0-rc4.tar.gz]http:// Redis.googlecode.com/files/redis-2.0.0-rc4.tar.gz[/url]
[Root@chen download]# tar zxvf redis-2.0.0-rc4.tar.gz
[Root@chen download]# CD REDIS-2.0.0-RC4
[Root@chen redis-2.0.0-rc4]# make
[Root@chen redis-2.0.0-rc4]# mkdir ~/redis
[Root@chen redis-2.0.0-rc4]# CP redis-server ~/redis
[Root@chen redis-2.0.0-rc4]# CP Redis-benchmark ~/redis
[Root@chen redis-2.0.0-rc4]# CP redis-cli ~/redis
[Root@chen redis-2.0.0-rc4]# CP redis.conf ~/redis
[Root@chen redis-2.0.0-rc4]# CD ~/redis