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