1. Java客户端远程连接时的三个坑
- No route info of this topic
- SENDDEFAULTIMPL CALL TIMEOUT
- connect to 172.17.42.1:10911 failed
解决:
-
配置broker.conf,添加
brokerIP1=服务器地址 namesrvAddr =服务器地址:9876
-
broker启动命令使用:
nohup sh ./mqbroker -n ip地址:9876 -c ../conf/broker.conf autoCreateTopicEnable=true &
-
关闭Linux防火墙或者开启对应端口:CentOS7
# 启动防火墙 systemctl start firewalld # 禁用防火墙 systemctl stop firewalld # 设置开机启动 systemctl enable firewalld # 禁用开机自启动 sytemctl disable firewalld
端口操作:
# 添加端口 permanent 永久开放 firewall-cmd --zone=public --add-port=端口号/tcp --permanent # 刷新规则 firewall-cmd --reload # 查看已开放得所有端口 firewall-cmd --list-ports # 关闭端口 firewall-cmd --zone=public --remove-port=端口号/tcp --permanent
-
关闭Windows防火墙或者开放对应端口