Introduction and installation of the Redis database

Source: Internet
Author: User
Tags memory usage redis

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.