Redis multi-instance Configuration

Source: Internet
Author: User
Tags redis version

(The Basics of redis installation, configuration, and login are no longer mentioned. There are a lot of information on the Internet. Here I only talk about my understanding and configuration of multiple redis instances)

My own redis version is 2.8.13 and the environment is ubuntu.

My personal understanding of multiple instances is as follows:

Use QQ as an example. Double-click it to open a QQ interface. Whether or not it is logged in, a QQ process is started. If you want to open another QQ, you need to double-click to open a QQ;

Similarly, in redis, a Linux port can only provide one service at a time. To open two redis instances, you must first set different ports for redis.

There are several other items that need to be listed as follows:

Copy a new configuration file

You can copy redis. conf from the redis installation directory, for example, redis_new_instance.conf.

Open redis_new_instance.conf

Modify the following configurations:

If daemonize is set to yes, redis is run in the background.

Pidfile indicates the process PID recorded by redis by default when redis is running in the background, for example,/var/run/redis_zhl.pid.

The new port must be changed to a new port, such as 6380.

Logfile refers to the redis log file path such as "/tmp/redis_zhl.log"

Dbfilename refers to the location of the persistent data file (if you do not modify this option from the previous redis instance, the data you see is the same) for example, I set it to dump_zhl.rdb

 

Okay. Set OK to open a new redis instance.

./Redis-server ../redis_new_instance.conf

Client Access

Redis-cli-H 127.0.0.1-P 6380

 

Redis multi-instance Configuration

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.