Redis multi-instance startup

Source: Internet
Author: User

By default, the redis program is installed in the/usr/local/redis directory;

Configuration File:/usr/local/redis. conf. The default port configured in this configuration file is 6379;

Redis startup command path:/usr/local/bin/redis-server.

You can specify a port to start multiple redis processes.

#/Usr/local/bin/redis-server -- Port 6380 & # Start the redis instance with port 6380.


=============================== Each of the following processes corresponds to a configuration file (reprinted) ========================================================== ==============

You need to start multiple redis instances:
A redis server is divided into multiple nodes. Each node is allocated with a port ...), The default port is 6379.
Each node corresponds to a redis configuration file, such as redis6380.conf and redis6381.conf.

# Cp redis. confredis6380.conf

# Vi redis6380.conf

Pidfile: pidfile/var/run/redis/redis_6380.pid

Port 6380

Logfile: logfile/var/log/redis/redis_6380.log

Rdbfile: dbfilenamedump_6380.rdb

 

(Other configuration files are modified similarly)

Start Multiple redis instances:

# Redis-server/usr/local/redis/redis6380.conf

# Redis-server/usr/local/redis/redis6381.conf

 

Note:

Redis Data Storage

Redis storage is divided into three parts: memory storage, disk storage, and log files. The configuration file contains three parameters for configuration.

Save seconds updates: the number of update operations performed within the specified time period, the data is synchronized to the data file. This can be used with multiple conditions. For example, three conditions are set in the default configuration file.

 

Appendonly Yes/No: whether to record logs after each update operation. If not enabled, data may be lost for a period of time during power failure.

Because redis synchronizes data files according to the above save conditions, some data will only exist in the memory for a period of time.

 

Appendfsyncno/always/everysec: No indicates that the data cache is synchronized to the disk by the operating system. Always indicates that the data is written to the disk by manually calling fsync () after each update operation, and everysec indicates that the data is synchronized once per second.


Redis multi-instance startup

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.