Redis start multiport, run multiple instances

Source: Internet
Author: User
Tags redis redis server

The default Redis program is installed in the/usr/local/redis directory;

Configuration file:/usr/local/redis/redis.conf, the port configured in this profile is the default port: 6379;

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

You can specify a port to start multiple Redis processes.

#/usr/local/bin/redis-server--port 6380 & #启动6380端口的redis实例.


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

Multiple Redis instances need to be started:
A Redis server, divided into multiple nodes, each node assigned a port (6380,6381 ...) ), the default port is 6379.
Each node corresponds to a redis configuration file, such as: redis6380.conf, 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 similar to modifications)

To start multiple Redis instances:

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

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

Supplementary Note:

Redis Data storage

The Redis storage is divided into three parts: memory storage, disk storage and log files, and three parameters are configured in the configuration file.

Save seconds Updates: Synchronizes data to a data file when the number of update operations is reached within a specified time. This can be a combination of conditions, such as the default configuration file settings, set three conditions.

AppendOnly yes/no: Whether logging after each update operation may result in loss of data for a period of time if the power is not turned on.

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

Appendfsyncno/always/everysec:no means that the operating system synchronizes the data cache to disk, always indicates that Fsync () is manually invoked after each update operation to write the data to disk, EVERYSEC is synchronized once per second.


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.