news 2026/5/25 14:28:59

外部连接 redis-server 相关配置

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
外部连接 redis-server 相关配置

1,修改绑定ip

redis默认绑定本地环回ip127.0.0.1:6379
能看出:Redis 仅绑定本机回环 IP(127.0.0.1),只能在 CentOS 虚拟机内部访问,外部(比如你的主机、其他设备)无法连接。

cd/usr/local/src/redis-6.2.14viredis.conf


bind 127.0.0.1 -::1# 绑定IPv4 本地回环(127.0.0.1) 和IPv6 本地回环
改为
bind 0.0.0.0 -::0# 绑定所有IPv4(0.0.0.0)+ 所有IPv6(::0)

2,关闭 Redis 保护模式(必做)
cd /usr/local/src/redis-6.2.14
vi redis.conf

# 搜索protected-mode,# 找到这行:protected-mode yes# 修改为:protected-mode no

3,CentOS 系统防火墙开放 6379 端口

# 永久开放6379/tcp端口sudo firewall-cmd--permanent--add-port=6379/tcp# 重启防火墙生效sudo firewall-cmd--reload# 验证端口是否开放sudo firewall-cmd--list-ports|grep 6379

再次连接,成功!

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/5/21 12:59:02

可以把 Windows 从 C盘迁移到 SSD 吗?

可以把 Windows 从 C盘迁移到 SSD 吗?yes, you can move windows from the c: drive to an ssd, and doing so can make your computer faster. the process usually means copying the operating system, programs, and settings from an old hard drive to a new …

作者头像 李华
网站建设 2026/5/16 8:02:39

突破浏览器壁垒:CSS框架跨平台兼容性完全解决方案

突破浏览器壁垒:CSS框架跨平台兼容性完全解决方案 【免费下载链接】OSWorld [NeurIPS 2024] OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments 项目地址: https://gitcode.com/GitHub_Trending/os/OSWorld 在现…

作者头像 李华
网站建设 2026/5/25 1:02:21

5个核心技巧:PicView图片管理专业使用完全指南

5个核心技巧:PicView图片管理专业使用完全指南 【免费下载链接】PicView Fast, free and customizable image viewer for Windows 10 and 11. 项目地址: https://gitcode.com/gh_mirrors/pi/PicView PicView作为Windows平台上备受好评的免费图片查看器&#…

作者头像 李华
网站建设 2026/5/12 6:52:50

deepseek技术总结待续

Identify the entity: DeepSeek (月之暗面). Identify the core task: Summarize its core technical advantages in ~1000 characters. Recall/Search information about DeepSeek: What is it known for? What are its stated goals or technical focuses? What it is: A p…

作者头像 李华