You can run multiple instances of Redis with different ports on the same computer. This is true as you can follow these steps.
When installing the first instance of Redis, it listens for localhost: 6379 by default.
- For the second instance,
create a new working directory
redis /var/lib/redis , - dump.rdb, . ,
mkdir -p /var/lib/redis2/
chown redis /var/lib/redis2/
chgrp redis /var/lib/redis2/
, /etc/redis.conf
cp /etc/redis.conf /etc/redis2.conf
chown redis /etc/redis2.conf
,
logfile "/var/log/redis/redis2.log"
dir "/var/lib/redis2"
pidfile "/var/run/redis/redis2.pid"
port 6380
cp /usr/lib/systemd/system/redis.service /usr/lib/systemd/system/redis2.service
[Service]
ExecStart=/usr/bin/redis-server /etc/redis2.conf --daemonize no
ExecStop=/usr/bin/redis-shutdown redis2
systemctl enable redis2
2-
service redis2 start
check status
lsof -i:6379
lsof -i:6380
, Redis. , .