Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote broker #245

Merged
merged 10 commits into from
Apr 9, 2019
Merged

Remote broker #245

merged 10 commits into from
Apr 9, 2019

Conversation

huanwei
Copy link
Contributor

@huanwei huanwei commented Apr 8, 2019

What is the purpose of the change

fix issue #238 and #185

Brief changelog

Add optional config for broker.conf, set brokerIP1 as physical broker IP so the remote client (on another machine) is able to visit broker.

Verifying this change

  1. deploy broker on test machine 10.10.101.80
[root@k8s-master 4.3.0]# ip a|grep ens32
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    inet 10.10.101.80/24 brd 10.10.101.255 scope global ens32
[root@k8s-master 4.3.0]# 
[root@k8s-master 4.3.0]# vi docker-compose/data/broker/conf/broker.conf 
[root@k8s-master 4.3.0]# cat docker-compose/data/broker/conf/broker.conf
brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
brokerIP1=10.10.101.80
[root@k8s-master 4.3.0]# ./play-docker-compose.sh 
"docker rm" requires at least 1 argument(s).
See 'docker rm --help'.

Usage:  docker rm [OPTIONS] CONTAINER [CONTAINER...]

Remove one or more containers
Creating rmqnamesrv ... done
Creating rmqbroker  ... done
[root@k8s-master 4.3.0]# docker ps|grep rocketmq
0dc2b715c259        rocketmqinc/rocketmq:4.3.0                                                                                "sh mqbroker -n na..."   8 seconds ago       Up 7 seconds        0.0.0.0:10909->10909/tcp, 9876/tcp, 0.0.0.0:10911->10911/tcp   rmqbroker
735689804c62        rocketmqinc/rocketmq:4.3.0                                                                                "sh mqnamesrv"           9 seconds ago       Up 8 seconds        10909/tcp, 0.0.0.0:9876->9876/tcp, 10911/tcp                   rmqnamesrv
[root@k8s-master 4.3.0]# 
  1. telnet the broker ports (10909 and 10911) from a remote machine (192.168.31.95)
huandeMacBook-Pro:4.3.0 huan$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
	options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
	inet 127.0.0.1 netmask 0xff000000 
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
	nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
XHC1: flags=0<> mtu 0
XHC20: flags=0<> mtu 0
XHC0: flags=0<> mtu 0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	ether 78:4f:43:78:3e:8c 
	inet6 fe80::895:65d9:c695:19b8%en0 prefixlen 64 secured scopeid 0x8 
	inet 192.168.31.95 netmask 0xffffff00 broadcast 192.168.31.255
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active
....
huandeMacBook-Pro:4.3.0 huan$ telnet 10.10.101.80 10909
Trying 10.10.101.80...
Connected to 10.10.101.80.
Escape character is '^]'.
^[[A^CConnection closed by foreign host.
huandeMacBook-Pro:4.3.0 huan$ telnet 10.10.101.80 10911
Trying 10.10.101.80...
Connected to 10.10.101.80.
Escape character is '^]'.
^CConnection closed by foreign host.
huandeMacBook-Pro:4.3.0 huan$ 

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@huanwei
Copy link
Contributor Author

huanwei commented Apr 8, 2019

@vongosling Please Kindly take a review. Thanks.

huanwei and others added 3 commits April 9, 2019 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants