redis如何重启


本文摘自PHP中文网,作者藏色散人,侵删。

redis如何重启?

正常启动命令:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

redis-server  # 启动redis服务端

[1709] 28 Feb 06:45: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 06:45:08.348 * Max number of open files set to 10032

                _._                                                 

           _.-``__ ''-._                                            

      _.-``    `.  `_.  ''-._           Redis 2.8.4 (00000000/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:45:08.349 * The server is now ready to accept connections on port 6379

启动redis客户端

1

2

redis-cli

127.0.0.1:6379>

如果是用apt-get或者yum install安装的redis,可以直接通过下面的命令停止/启动/重启redis

1

2

3

/etc/init.d/redis-server stop

/etc/init.d/redis-server start

/etc/init.d/redis-server restart

注意:使用/etc/init.d/redis-server start 方法启动redis,那么在那个目录下启动redis,那么redis的备份文件就在那个目录下。

如在/user/bin/redis/目录下输入命令/etc/init.d/redis-server start ,那么redis备份文件就在/user/bin/redis/dump.rdb

如果是通过源码安装的redis,则可以通过redis的客户端程序redis-cli的shutdown命令来重启redis

1

redis-cli -h 127.0.0.1 -p 6379 shutdown

如果上述方式都没有成功停止redis,则可以使用终极武器 kill -9

更多Redis相关知识,请访问Redis使用教程栏目!

以上就是redis如何重启的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

redis如何重启

更多相关阅读请进入《redis重启》频道 >>


数据库系统概念 第6版
书籍

数据库系统概念 第6版

机械工业出版社

本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...