- sudo /etc/init.d/redis-server start
- sudo service redis-server start
- sudo systemctl start redis-server
- sudo redis-server –daemonize yes
Advertisement
Answer
The last one is “nearest to the metal”, it directly starts the Redis server process with no special options, and is “stand-alone”. I would use this type of command when just “messing around” in the Terminal with quick tests and when trying to get an initial configuration tested and running.
The first 3 are all basically wrappers around starting the Redis server process to make it compatible with systemd or other Linux startup systems. They potentially add more layers of management, like:
- reporting to the
systemctl
logs - saving the process id so the process can be killed or restarted
- potentially specifying a different config file
- potentially waiting for other services to become available before starting Redis
I would prefer one of the first three for routine, every-day, managed starting up of Redis on a production system.