Start redis-server with config file

后端 未结 3 1600
孤街浪徒
孤街浪徒 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:22

    Okay, redis is pretty user friendly but there are some gotchas.

    Here are just some easy commands for working with redis on Ubuntu:

    install:

    sudo apt-get install redis-server
    

    start with conf:

    sudo redis-server 
    sudo redis-server config/redis.conf
    

    stop with conf:

    redis-ctl shutdown
    

    (not sure how this shuts down the pid specified in the conf. Redis must save the path to the pid somewhere on boot)

    log:

    tail -f /var/log/redis/redis-server.log
    

    Also, various example confs floating around online and on this site were beyond useless. The best, sure fire way to get a compatible conf is to copy-paste the one your installation is already using. You should be able to find it here:

    /etc/redis/redis.conf
    

    Then paste it at , tweak as needed and you're good to go.

提交回复
热议问题