How to starts multiple redis instances in Ubuntu

created at 07-22-2021 views: 17

Need to start multiple Redis instances:

A Redis server is divided into multiple nodes, each node is assigned a port (6380, 6381...), the default port is 6379.

Each node corresponds to a Redis configuration file, such as: redis_6380.conf, redis_6381.conf

1 Copy a redis.conf configuration file first

cp redis.conf redis6380.conf
vim redis6380.conf

2 Modify configuration information

pidfile : pidfile/var/run/redis/redis_6380.pid
port 6380
logfile : logfile/var/log/redis/redis_6380.log
rdbfile : dbfilenamedump_6380.rdb

3 Start multiple redis instances:

redis-server /etc/redis/redis_6380.conf
created at:07-22-2021
edited at: 07-22-2021: