creating server tcp listening socket 127.0.0.1:6379: bind No error

本文记录了一次在Windows 10环境中遇到的Redis启动失败问题及解决方案。作者分享了错误信息和排查过程,最终通过正确配置解决了问题,并强调了使用shutdown命令优雅关闭Redis的重要性。

参考链接:https://blog.youkuaiyun.com/n_fly/article/details/52692480

1、window10环境下面安装的redis,之前安装好弄了一下,过了好几天,再次使用redis-server.exe命令启动,发现报了如下所示的错误:

 1 D:\biehl\redis>redis-server.exe
 2 [16916] 28 Nov 19:43:49.684 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server.exe /path/to/redis.conf
 3 [16916] 28 Nov 19:43:49.689 # Creating Server TCP listening socket *:6379: bind: No such file or directory
 4 
 5 D:\biehl\redis>redis-cli.exe
 6 127.0.0.1:6379> shutdown
 7 (error) NOAUTH Authentication required.
 8 127.0.0.1:6379> AUTH 123456
 9 OK
10 127.0.0.1:6379> shutdown
11 not connected> exit
12 
13 D:\biehl\redis>redis-server.exe
14 [12420] 28 Nov 19:46:00.458 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server.exe /path/to/redis.conf
15                 _._
16            _.-``__ ''-._
17       _.-``    `.  `_.  ''-._           Redis 3.2.100 (00000000/0) 64 bit
18   .-`` .-```.  ```\/    _.,_ ''-._
19  (    '      ,       .-`  | `,    )     Running in standalone mode
20  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
21  |    `-._   `._    /     _.-'    |     PID: 12420
22   `-._    `-._  `-./  _.-'    _.-'
23  |`-._`-._    `-.__.-'    _.-'_.-'|
24  |    `-._`-._        _.-'_.-'    |           http://redis.io
25   `-._    `-._`-.__.-'_.-'    _.-'
26  |`-._`-._    `-.__.-'    _.-'_.-'|
27  |    `-._`-._        _.-'_.-'    |
28   `-._    `-._`-.__.-'_.-'    _.-'
29       `-._    `-.__.-'    _.-'
30           `-._        _.-'
31               `-.__.-'
32 
33 [12420] 28 Nov 19:46:00.467 # Server started, Redis version 3.2.100
34 [12420] 28 Nov 19:46:00.468 * DB loaded from disk: 0.000 seconds
35 [12420] 28 Nov 19:46:00.468 * The server is now ready to accept connections on port 6379

截图如下所示:

所以呢,自己学习完,也可以将redis进行shutdown,这样养成好的习惯。
redis-cli shutdown,这样可以避免redis正在将内存中的数据同步到硬盘中,因为强行终止redis进行可能会导致数据丢失。
执行此命令后,redis会先断开所有客户端连接,然后根据配置执行持久化,最后完成退出。
Redis可以妥善处理Sigterm信号,所以使用kill redis进行的pid也可以正常结束redis,效果与发送shutdown命令一样。

待续......

转载于:https://www.cnblogs.com/biehongli/p/10034216.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值