How can I stop redis-server?

前端 未结 26 1574
清歌不尽
清歌不尽 2020-12-07 06:51

I apparently have a redis-server instance running because when I try to start a new server by entering redis-server, I\'m greeted with the followin

相关标签:
26条回答
  • 2020-12-07 07:22

    Either connect to node instance and use shutdown command or if you are on ubuntu you can try to restart redis server through init.d:

    /etc/init.d/redis-server restart
    

    or stop/start it:

    /etc/init.d/redis-server stop
    /etc/init.d/redis-server start
    

    On Mac

    redis-cli shutdown
    
    0 讨论(0)
  • 2020-12-07 07:22

    A cleaner, more reliable way is to go into redis-cli and then type shutdown

    In redis-cli, type help @server and you will see this near the bottom of the list:

    SHUTDOWN - summary: Synchronously save the dataset to disk and then shut down the server since: 0.07

    And if you have a redis-server instance running in a terminal, you'll see this:

    User requested shutdown...
    [6716] 02 Aug 15:48:44 * Saving the final RDB snapshot before exiting.
    [6716] 02 Aug 15:48:44 * DB saved on disk
    [6716] 02 Aug 15:48:44 # Redis is now ready to exit, bye bye...
    
    0 讨论(0)
  • 2020-12-07 07:24

    Another way could be:

    ps -ef | grep -i 'redis-server'
    kill -9 PID owned by redis
    

    Works on *NIX & OSX

    0 讨论(0)
  • 2020-12-07 07:24

    MacOSX - It Worked :)

    Step 1 : Find the previously Running Redis Server

    ps auxx | grep redis-server
    

    Step 2 : Kill the specific process by finding PID (Process ID) - Redis Sever

    kill -9 PID
    
    0 讨论(0)
  • 2020-12-07 07:24

    Following worked for me on MAC

     ps aux | grep 'redis-server' | awk '{print $2}' | xargs sudo kill -9
    
    0 讨论(0)
  • 2020-12-07 07:27

    In my case it was:

    /etc/init.d/redismaster stop
    /etc/init.d/redismaster start
    

    To find out what is your service name, you can run:

    sudo updatedb
    locate redis
    

    And it will show you every Redis files in your system.

    0 讨论(0)
提交回复
热议问题