Start redis-server with config file

后端 未结 3 1598
孤街浪徒
孤街浪徒 2021-02-04 03:42

I have my config file at:

root/config/redis.rb

I start redis like this: redis-server

How do I start redis so that it uses my co

3条回答
  •  误落风尘
    2021-02-04 04:17

    To start redis with a config file all you need to do is specifiy the config file as an argument:

    redis-server /root/config/redis.rb
    

    Instead of using and killing PID's I would suggest creating an init script for your service

    I would suggest taking a look at the Installing Redis more properly section of http://redis.io/topics/quickstart. It will walk you through setting up an init script with redis so you can just do something like service redis_server start and service redis_server stop to control your server.

    I am not sure exactly what distro you are using, that article describes instructions for a Debian based distro. If you are are using a RHEL/Fedora distro let me know, I can provide you with instructions for the last couple of steps, the config file and most of the other steps will be the same.

提交回复
热议问题