0

I have installed redis on ubuntu, in its working nicely.

then i need to make multiple service run on same machine, some of them master, and another slave.

i then make several redis.conf, with different port assigned and run it with

sudo /usr/bin/redis-server /etc/redis/redis.conf

sudo /usr/bin/redis-server /etc/redis/redisSlave.conf

sudo /usr/bin/redis-server /etc/redis/redisSlave2.conf

everything work fine, i can even start a sentinel and it work like a charm

then i want to auto start them on startup, i already do the same with kafka from here with step that Jakub Krhovják explained.

there we make a service file, and do sudo systemctl enable redis-slave.service

here is my redis-slave.service

Unit]
Requires=redis-server.service
After=redis-server.service

[Service]
Type=simple
User=root
ExecStart=/usr/bin/redis-server /etc/redis/redisSlave.conf
Restart=on-abnormal

[Install]
WantedBy=multi-user.target

then i try to restart my vm, but when i check it with sudo systemctl status redis-slave.service i got

systemctl status

when i check it with $ss -nlt i cant find port that should be running. i even do sudo systemctl start redis-slave.service, and got same status when check it.

is there anything wrong with may redis-slave.service

ikiSiTamvaaan
  • 127
  • 1
  • 14

1 Answers1

0

i have to change my redis-slave.service to make it works

[Unit]
Description=redis resque 6380
After=network.target

[Service]
Type=notify
User=root
ExecStart=/usr/bin/redis-server /etc/redis/redisSlave.conf --supervised systemd
ExecStop=/usr/bin/redis-cli -h 192.168.56.101 -p 6380 shutdown

[Install]
WantedBy=multi-user.target

i found it from here, the article is explaining about how to make redis cluster, great to read.

ikiSiTamvaaan
  • 127
  • 1
  • 14