Redis introduction and Installation

Source: Internet
Author: User
Tags benchmark install redis

Redis is a key-value storage system. Similar to memcached, memcached supports more storage value types, including string, list, set, and zset) and hash (hash type ). These data types support push/pop, Add/Remove, Intersection Set and difference set, and more abundant operations, and these operations are atomic. On this basis, redis supports sorting in different ways. Like memcached, data is cached in the memory to ensure efficiency. The difference is that redis periodically writes the updated data to the disk or writes the modification operation to the append record file, and on this basis implements master-slave (master-slave) synchronization.

Redis is a high-performance Key-value database. The emergence of redis largely compensates for the shortage of key/value storage such as memcached, and can play a good complementary role in relational databases in some cases. It provides clients such as Java, C/C ++, C #, PHP, JavaScript, Perl, object-C, Python, Ruby, and Erlang for ease of use. [1]
Redis supports master-slave synchronization. Data can be synchronized from the master server to any number of slave servers. The slave server can be the master server associated with other slave servers. This allows redis to perform single-layer tree replication. Data can be written intentionally or unintentionally from a disk. Because the publishing/subscription mechanism is fully implemented, you can subscribe to a channel and receive the complete message publishing records of the master server when synchronizing the tree from the database anywhere. Synchronization is helpful for the scalability and data redundancy of read operations.


Taking version 2.8.3 as an example, it is very easy to install redis in Linux. The specific steps are as follows:


1. First download the source code and decompress the compressed package to compile the source code.

$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz$ tar xzf redis-2.8.3.tar.gz$ cd redis-2.8.3$ make

2. After compilation, you will find that there are four executable files in the src directory: redis-server, redis-benchmark, redis-CLI, and redis. conf, and then copy it to a directory.

mkdir /usr/rediscp redis-server  /usr/rediscp redis-benchmark /usr/rediscp redis-cli  /usr/rediscp redis.conf  /usr/rediscd /usr/redis

3. Start the redis service command.

$ redis-server   redis.conf

4. Finally, use the client to test whether the startup is successful.

$ redis-cliredis> set foo barOKredis> get foo"bar"

OK to complete the installation.

Redis introduction and Installation

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.