当前位置:网站首页>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打开端口后我们在用客户端连接

连接成功, 解决问题。
边栏推荐
- Skip table: principle introduction, advantages and disadvantages of skiplist
- Differences among bio, NiO and AIO
- My first Smartphone
- MySQL master-slave configuration
- Redis使用Lua脚本简介
- (subplots用法)matplotlib如何绘制多个子图(轴域)
- 请求数据库报错:“could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGram
- Brief introduction of realsense d435i imaging principle
- Class loading mechanism (detailed explanation of the whole process)
- Technical analysis of qianyuantong multi card aggregation router
猜你喜欢

Classification and discussion of plane grab detection methods based on learning

leetcode435. Non overlapping interval

Shanghai daoning, together with American /n software, will provide you with more powerful Internet enterprise communication and security component services

Go practice - gorilla / handlers used by gorilla web Toolkit

配置xml文件的dtd

Latest version of source insight

(完美解决)matplotlib图例(legend)如何自由设置其位置

Gan network thought

3dslam with 16 line lidar and octomap

Yolov5 network structure + code + application details | CSDN creation punch in
随机推荐
Redis expiration elimination mechanism
XML配置文件
@Autowired 导致空指针报错 解决方式
Congratulations to musk and NADELLA on their election as academicians of the American Academy of engineering, and Zhang Hongjiang and Fang daining on their election as foreign academicians
XML Configuration File
Disassembly and installation of Lenovo r7000 graphics card
Altaro o365 total backup subscription plan
Get and monitor remote server logs
酒店公共广播背景音乐-基于互联网+的酒店IP网络广播系统设计
Pan details of deep learning
Go language interface learning notes Continued
Shallow and first code
Redis Introduction et explication des types de données
Source insight License Activation
Chapter II program design of circular structure
Progressive multi grasp detection using grasp path for rgbd images
Introduction to rust Foundation (basic type)
Go language interface learning notes
Deep embedding and alignment of Google | protein sequences
Yolov5 input (I) -- mosaic data enhancement | CSDN creative punch in