Get the App
SLTechnology News&Howtos  ›  Database  › 

The method of restart in redis

Shulou Source: shulou.com Published: 2022-06-01 04:33:11 09月27日 Update

This article mainly introduces the method of restart in redis, which has certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

How does redis restart?

Start the command normally:

Redis-server # starts the redis server [1709] 28 Feb 06 Feb 45 Feb 08.346 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server / path/to/redis.conf [1709] 28 Feb 06VR 4515 08.348 * Max number of open files set to 10032 _. _ _.-`. `_. '' -. _ Redis 2.8.4 (00000 0000Universe 0) 64 bit.-``.- ```. ```\ / _., _'-. _ (.-`|` ) Running in stand alone mode | `-. _` -.-`_ _...-.`` -. _ |'` _. -'| Port: 6379 | `-. _`. _ / _. -'| PID: 1709 `-. _` -. _ `-. _. -'| |` -. _ `-. _ _. -'_. -'| http://redis.io` -. _ `-. _. -'. | | `-. _` -. _ `. -'_. -'| |` -. _ `-. -'_. -'. _. -'`-. _`. -'. [1709] 28 Feb 06:45:08.349 # Server started Redis version 2.8.4 [1709] 28 Feb 06:45:08.349 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory=1' to / etc/sysctl.conf and then reboot or run the command' sysctl vm.overcommit_memory=1' for this to take effect. [1709] 28 Feb 06 etc/sysctl.conf and then reboot or run the command 45 purl 08.349 * The server is now ready to accept connections on port 6379

Start the redis client

Redis-cli 127.0.0.1 purl 6379 >

If you installed redis with apt-get or yum install, you can stop / start / restart redis directly with the following command

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

Note: start redis using the / etc/init.d/redis-server start method, then start redis in that directory, and the backup files for redis are in that directory.

If you enter the command / etc/init.d/redis-server start in the / user/bin/redis/ directory, the redis backup file is located in / user/bin/redis/dump.rdb

If redis is installed through source code, you can restart redis through the shutdown command of redis's client program redis-cli

Redis-cli-h 127.0.0.1-p 6379 shutdown

If none of the above methods successfully stops redis, the ultimate weapon kill-9 can be used.

Thank you for reading this article carefully. I hope it will be helpful for everyone to share the contents of the restart method in redis. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!

Tags: Methods commands directories articles backups clients clients files success value content can be passed at the same time ways friends weapons source code programs ultimate tape Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple NVidia vpn Shulou Technology macOS