最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

redis如何重启

来源:动视网 责编:小采 时间:2020-11-09 06:57:17
文档

redis如何重启

redis如何重启:redis如何重启正常启动命令: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 r
推荐度:
导读redis如何重启:redis如何重启正常启动命令: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 r


redis如何重启?

正常启动命令:

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)  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客户端

redis-cli 
127.0.0.1:6379>

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

/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

redis-cli -h 127.0.0.1 -p 6379 shutdown

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

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

文档

redis如何重启

redis如何重启:redis如何重启正常启动命令: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 r
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top