centos服务器ssh连接被拒绝,Connection refused
排查
- 检测服务是否正常启动
ps -ef | grep rabbit
如果服务未启动,则启动服务
然后,查看服务是否正确监听了端口
netstat -anp | grep pid - 检查服务端防火墙是否开启
systemctl status firewalld
为了服务器安全,强烈建议打开防火墙 - 检查服务器端口是否开放
firewall-cmd —query-port=5672/tcp
如上,端口没有开放,使用如下命令打开端口
firewall-cmd —permanent —add-port=5672/tcp
然后,reload 端口开放规则
firewall-cmd —reload
再次检测端口是否开放 - 使用 nc 检测端口是否可连接成功
参考文档
- nc : https://linux.cn/article-8186-1.html
- firewall-cmd : https://www.jianshu.com/p/dd663cb4affa
- rabbitmq : https://www.rabbitmq.com/documentation.html
还没有评论,来说两句吧...