Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.5k views
in Technique[技术] by (71.8m points)

docker rocketmq-console connect to <外网:10911> failed

docker run -d -p 9876:9876 --name rmqserver foxiswho/rocketmq:server-4.5.1
docker run -d -p 10911:10911 -p 10909:10909
 --name rmqbroker --link rmqserver:namesrv
 -e "NAMESRV_ADDR=namesrv:9876" -e "JAVA_OPTS=-Duser.home=/opt"
 -e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m"
 foxiswho/rocketmq:broker-4.5.1

修改配置文件: /etc/rocketmq/broker.conf

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1 = 192.168.228.130 //指定虚拟机的ip,虚拟机网络用的是NAT模式
namesrvAddr = 172.17.0.2:9876
docker run -d --name rmqconsole -p 8180:8080 --link rmqserver:namesrv -e "JAVA_OPTS=-Drocketmq.namesrv.addr=namesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -t styletang/rocketmq-console-ng 

现在的问题是,如果brokerIP1指定虚拟机的IP,那rocketmq-console无法连接,如果brokerIP1指定docker内部ip(172.17.0.3),那java客户端连不上rocketmq


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...