当前位置:网站首页>redis 无法远程连接问题。
redis 无法远程连接问题。
2022-07-03 05:26:00 【youandme520】
CentOS9上安装了redis,并且成功启动,在主机上缺无法连接。
主要是参数设置 不正确。
首先默认安装好redis后 直接命令启动 redis-server 其实是不正确的。它会调用默认参数来启动redis。
我们要用redis.conf 文件来启动
redis-server /etc/redis/redis.conf而不能连接主要有几个方面的原因。
1. bind 参数未正确设置
redis bind参数默认是 127.0.0.1 这样就把redis绑定到本地及其了 外部设备无法连接
我们需要直接注释掉。
# bind 127.0.0.1
然后修改redis的保护模式为no,不启用
protected-mode no为了安全 需要设置下密码
requirepass root然后 就可以 远程访问了
我们在客户机上尝试连接

依然无法连接,考虑了一下 应该是 CentOS9防火墙没有将6379端口打开。
[[email protected] redis]# firewall-cmd --query-port=6379/tcp
no检查后确实没有打开
那么我们打开端口。
[[email protected] redis]# firewall-cmd --add-port=6379/tcp
success
[[email protected] redis]# firewall-cmd --query-port=6379/tcp
yes打开端口后我们在用客户端连接

连接成功, 解决问题。
边栏推荐
- Simpleitk learning notes
- Yolov5 model construction source code details | CSDN creation punch in
- 【实战项目】自主web服务器
- JS string and array methods
- Can altaro back up Microsoft teams?
- Transferring images using flask
- BTC-密码学原理
- 6.23 warehouse operation on Thursday
- Audio Focus Series: write a demo to understand audio focus and audiomananger
- (subplots用法)matplotlib如何绘制多个子图(轴域)
猜你喜欢

Export the altaro event log to a text file

Intégration profonde et alignement des séquences de protéines Google

Go practice -- design patterns in golang's singleton

Class loading mechanism (detailed explanation of the whole process)

Brief introduction of realsense d435i imaging principle

(subplots usage) Matplotlib how to draw multiple subgraphs (axis field)

音频焦点系列:手写一个demo理解音频焦点与AudioMananger

JS dynamic table creation

Notepad++ wrap by specified character

DEX net 2.0 for crawl detection
随机推荐
mysql启动报错:The server quit without updating PID file几种解决办法
Web APIs exclusivity
Obtenir et surveiller les journaux du serveur distant
Detailed explanation of the output end (head) of yolov5 | CSDN creation punch in
Go practice -- factory mode of design patterns in golang (simple factory, factory method, abstract factory)
C language program ideas and several commonly used filters
XML Configuration File
Redis 入門和數據類型講解
Best practices for setting up altaro VM backups
Map的扩容机制
es7创建索引容易犯的错误
@Solutions to null pointer error caused by Autowired
Export the altaro event log to a text file
Go practice -- generate and read QR codes in golang (skip2 / go QRcode and boombuilder / barcode)
JS dynamic table creation
Can altaro back up Microsoft teams?
Altaro virtual machine replication failed: "unsupported file type vmgs"
Technical analysis of qianyuantong multi card aggregation router
Ueditor, FCKeditor, kindeditor editor vulnerability
Source insight operation manual installation trial