阿里云服务器安装redis启动失败问题排查

问题描述

安装redis后, 启动失败

排查步骤记录

0/查看启动日志

13519:M 02 Jun 2020 16:47:53.070 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
13519:M 02 Jun 2020 16:47:53.070 # Server initialized
13519:M 02 Jun 2020 16:47:53.070 # 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.
13519:M 02 Jun 2020 16:47:53.070 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
13519:M 02 Jun 2020 16:47:53.070 * DB loaded from disk: 0.000 seconds
13519:M 02 Jun 2020 16:47:53.070 * Ready to accept connections
13519:signal-handler (1591088608) Received SIGTERM scheduling shutdown...
13519:M 02 Jun 2020 17:03:28.561 # User requested shutdown...
13519:M 02 Jun 2020 17:03:28.561 * Saving the final RDB snapshot before exiting.
13519:M 02 Jun 2020 17:03:28.563 * DB saved on disk
13519:M 02 Jun 2020 17:03:28.563 * Removing the pid file.
13519:M 02 Jun 2020 17:03:28.563 # Redis is now ready to exit, bye bye...
13585:C 02 Jun 2020 17:04:00.422 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
13585:C 02 Jun 2020 17:04:00.422 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=13585, just started
13585:C 02 Jun 2020 17:04:00.422 # Configuration loaded
13586:M 02 Jun 2020 17:04:00.425 # Could not create server TCP listening socket 47.244.127.184:6379: bind: Cannot assign requested address
13586:M 02 Jun 2020 17:04:00.425 # Configured to not listen anywhere, exiting.

 

1/修改redis.conf

bind 127.0.0.1

bind 外网ip

启动失败, 忽然想起6379端口没开

2/修改阿里云服务器安全组, 开放6379端口

启动依然失败

3/再次修改redis.conf

经运维朋友提醒, 云服务器有内网ip和外网ip, 然后再次修改redis.conf

bind 127.0.0.1
bind 云服务器外网ip
bind 云服务器内网ip

启动成功, 远程连接成功

4/最终测试结果

三个都得放开, 或者都注释才实现远程连接redis

 

至此结束, 有问题拍砖.

 

posted @ 2020-06-04 10:19  习惯沉淀  阅读(2688)  评论(0编辑  收藏  举报