当前位置:网站首页>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
打开端口后我们在用客户端连接
连接成功, 解决问题。
边栏推荐
- Pytorch through load_ state_ Dict load weight
- Principles of BTC cryptography
- MySQL master-slave configuration
- Can altaro back up Microsoft teams?
- Webrtc M96 release notes (SDP abolishes Plan B and supports opus red redundant coding)
- Basic knowledge of reflection (detailed explanation)
- Self introduction and objectives
- JS function algorithm interview case
- study hard and make progress every day
- Source insight License Activation
猜你喜欢
How to connect the network: Chapter 2 (Part 1): a life cycle of TCP connection | CSDN creation punch in
Altaro virtual machine replication failed: "unsupported file type vmgs"
How to install and configure altaro VM backup for VMware vSphere
Deploy crawl detection network using tensorrt (I)
es7创建索引容易犯的错误
Hotel public broadcasting background music - Design of hotel IP network broadcasting system based on Internet +
Progressive multi grasp detection using grasp path for rgbd images
Skip table: principle introduction, advantages and disadvantages of skiplist
Disassembly and installation of Lenovo r7000 graphics card
(subplots用法)matplotlib如何绘制多个子图(轴域)
随机推荐
study hard and make progress every day
Obtenir et surveiller les journaux du serveur distant
Covering Safari and edge, almost all mainstream browsers have realized webgl 2.0 support
Notepad++ wrap by specified character
Configure and use Anaconda environment in pycharm
Common methods of JS array
EMD distance - example of use
DEX net 2.0 for crawl detection
(subplots usage) Matplotlib how to draw multiple subgraphs (axis field)
ROS Compilation Principle
Technical analysis of qianyuantong multi card aggregation router
JS dynamic table creation
Shanghai daoning, together with American /n software, will provide you with more powerful Internet enterprise communication and security component services
Based on RFC 3986 (unified resource descriptor (URI): general syntax)
Go practice -- use redis in golang (redis and go redis / redis)
"250000 a year is just the price of cabbage" has become a thing of the past. The annual salary of AI posts has decreased by 8.9%, and the latest salary report has been released
Altaro o365 total backup subscription plan
Detailed explanation of yolov5 training own data set
Source insight automatic installation and licensing
Go language interface learning notes Continued