You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jzhang <jz...@wellington.com> on 2010/08/05 23:23:26 UTC

Can I can run two brokers as network using multicast on the same host?

I am trying to set up a simple network of brokers within the same host (Linux
VM) using multicast. It seems that I can only use 'localhost' as host name
in tcp uri. If I use IP address or DNS name, the log shows 'connection
refused' warning message. Here are some details:

My configurations:

- for broker NB-BKR-B:
...
 <networkConnectors>
            <networkConnector name="labnb1"
uri="multicast://default?group=test-lab-1" />
 </networkConnectors>

...
   <transportConnectors>
            <transportConnector name="openwire"
uri="tcp://myhost.mycompany.com:61617"
discoveryUri="multicast://default?group=test-lab-1"/>
        </transportConnectors>
...

- for broker NB-BKR-C:
...
 <networkConnectors>
            <networkConnector name="labnb1"
uri="multicast://default?group=test-lab-1" />
 </networkConnectors>

...
   <transportConnectors>
            <transportConnector name="openwire"
uri="tcp://myhost.mycompany.com:61618"
discoveryUri="multicast://default?group=test-lab-1"/>
        </transportConnectors>
...

Now when started both brokers, log shows (NB-BKR-C;s log):

2010-08-05 17:06:29,054 | WARN  | Could not start network bridge between:
vm://NB-BKR-C and: tcp://lab-2:61617 due to: java.net.ConnectException:
Connection refused | org.apache.activemq.network.DiscoveryNetworkConnector |
Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
2010-08-05 17:06:29,055 | DEBUG | Start failure exception:
java.net.ConnectException: Connection refused |
org.apache.activemq.network.DiscoveryNetworkConnector |
Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at
org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:436)
        at
org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:402)
        at
org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
        at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
        at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
        at
org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
        at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
        at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
        at
org.apache.activemq.network.DemandForwardingBridgeSupport.start(DemandForwardingBridgeSupport.java:227)
        at
org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:130)
        at
org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent$2.run(MulticastDiscoveryAgent.java:506)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)

Broker NB-BKR-B has the similar warning. I have not test message forward
yet. Just feel uncomfortable seeing these stacktraces. But when I change
'myhost.mycompany.com' to localhost' under 'tcp' uri, the log does not have
those warning and stacktrace. Also if these two brokers are hosted on two
different VMs and uses host name or IP, it works fine.

What might be the problem here?

-J
-- 
View this message in context: http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29356394.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Can I can run two brokers as network using multicast on the same host?

Posted by Gary Tully <ga...@gmail.com>.
great, thanks for closing the loop with your reply.

On 6 August 2010 22:42, jzhang <jz...@wellington.com> wrote:
>
> I figured this out. This is not the problem of running two brokers on the
> same host. It is a bug amq-2094 that the IP does not get taken correctly. I
> replaced host name with wild card address "0.0.0.0" and the warning
> disappears.
>
> -J
> --
> View this message in context: http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29356881.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: Can I can run two brokers as network using multicast on the same host?

Posted by jzhang <jz...@wellington.com>.
I figured this out. This is not the problem of running two brokers on the
same host. It is a bug amq-2094 that the IP does not get taken correctly. I
replaced host name with wild card address "0.0.0.0" and the warning
disappears.

-J 
-- 
View this message in context: http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29356881.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Can I can run two brokers as network using multicast on the same host?

Posted by jzhang <jz...@wellington.com>.
Gary,

I tested using 'useLocalHost=false' option and here is the results:

I have brokers A, B and C where B and C are running on the same Linux VM
host. I started A first and then B and followed by C. From the log, I can
see connections are established between A to B (B to A), A to C (C to A).
But none between B and C:

2010-08-09 22:29:35,469 | DEBUG | Stopping transport tcp://null:0 |
org.apache.activemq.transport.tcp.TcpTransport |
Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
2010-08-09 22:29:35,470 | WARN  | Could not start network bridge between:
vm://NB-BKR-C and: tcp://lab-2:61617 due to: java.net.ConnectException:
Connection refused | org.apache.activemq.network.DiscoveryNetworkConnector |
Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
2010-08-09 22:29:35,470 | DEBUG | Start failure exception:
java.net.ConnectException: Connection refused |
org.apache.activemq.network.DiscoveryNetworkConnector |
Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
java.net.ConnectException: Connection refused
...

When use:

<transportConnector name="openwire" uri="tcp://0.0.0.0"
discoveryUri="multicast://default?group=mygroup"/>

Then all three brokers can connect to each other.

-J


Gary Tully wrote:
> 
> discoveryUri="multicast://default?group=mygroup?useLocalHost=false" looks
> odd,
> the query string needs to use & to separate arguments,
> it should be:
>  "multicast://default?group=mygroup&useLocalHost=false
> 
> On 9 August 2010 19:17, jzhang <jz...@wellington.com> wrote:
>>
>> Thanks for the reply. I have added this property to the xml:
>>
>> transportConnectors>
>>           <transportConnector name="openwire"
>> uri="tcp://myhost.mycompany.com:61617"
>> discoveryUri="multicast://default?group=mygroup?useLocalHost=false"/>
>>        </transportConnectors>
>>
>> I have three brokers A, B and C (B and C are on the same Linux VM). I
>> started A first, and then B and then C. From log I can see A and B, A and
>> C
>> can 'see' each other. But there is no connection between B and C:
>>
>> - A log:
>> 2010-08-09 13:52:55,561 | INFO  | Network connection between
>> vm://NB-BKR-A#0
>> and tcp://lab-2/134.42.73.122:61617(NB-BKR-B) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-A#0
>> ..
>> 2010-08-09 13:53:17,161 | INFO  | Network connection between
>> vm://NB-BKR-A#2
>> and tcp://lab-2/134.42.73.122:61618(NB-BKR-C) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-A#2
>>
>> - B log:
>> 2010-08-09 13:52:55,938 | INFO  | Network connection between
>> vm://NB-BKR-B#0
>> and tcp://lab-1/134.42.73.100:61617(NB-BKR-A) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-B#0
>>
>> - C log:
>> 2010-08-09 13:53:17,810 | INFO  | Network connection between
>> vm://NB-BKR-C#0
>> and tcp://lab-1/134.42.73.100:61617(NB-BKR-A) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-C#0
>>
>> Is this expected?
>>
>> -J
>>
>>
>> Gary Tully wrote:
>>>
>>> this sounds like https://issues.apache.org/activemq/browse/AMQ-2771
>>> note the comments at the end about useLocalHost=false
>>>
>>> On 5 August 2010 22:23, jzhang <jz...@wellington.com> wrote:
>>>>
>>>> I am trying to set up a simple network of brokers within the same host
>>>> (Linux
>>>> VM) using multicast. It seems that I can only use 'localhost' as host
>>>> name
>>>> in tcp uri. If I use IP address or DNS name, the log shows 'connection
>>>> refused' warning message. Here are some details:
>>>>
>>>> My configurations:
>>>>
>>>> - for broker NB-BKR-B:
>>>> ...
>>>>  <networkConnectors>
>>>>            <networkConnector name="labnb1"
>>>> uri="multicast://default?group=test-lab-1" />
>>>>  </networkConnectors>
>>>>
>>>> ...
>>>>   <transportConnectors>
>>>>            <transportConnector name="openwire"
>>>> uri="tcp://myhost.mycompany.com:61617"
>>>> discoveryUri="multicast://default?group=test-lab-1"/>
>>>>        </transportConnectors>
>>>> ...
>>>>
>>>> - for broker NB-BKR-C:
>>>> ...
>>>>  <networkConnectors>
>>>>            <networkConnector name="labnb1"
>>>> uri="multicast://default?group=test-lab-1" />
>>>>  </networkConnectors>
>>>>
>>>> ...
>>>>   <transportConnectors>
>>>>            <transportConnector name="openwire"
>>>> uri="tcp://myhost.mycompany.com:61618"
>>>> discoveryUri="multicast://default?group=test-lab-1"/>
>>>>        </transportConnectors>
>>>> ...
>>>>
>>>> Now when started both brokers, log shows (NB-BKR-C;s log):
>>>>
>>>> 2010-08-05 17:06:29,054 | WARN  | Could not start network bridge
>>>> between:
>>>> vm://NB-BKR-C and: tcp://lab-2:61617 due to: java.net.ConnectException:
>>>> Connection refused |
>>>> org.apache.activemq.network.DiscoveryNetworkConnector |
>>>> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
>>>> 2010-08-05 17:06:29,055 | DEBUG | Start failure exception:
>>>> java.net.ConnectException: Connection refused |
>>>> org.apache.activemq.network.DiscoveryNetworkConnector |
>>>> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
>>>> java.net.ConnectException: Connection refused
>>>>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>>>>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>>>>        at
>>>> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>>>>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>>>>        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>>>>        at java.net.Socket.connect(Socket.java:519)
>>>>        at
>>>> org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:436)
>>>>        at
>>>> org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:402)
>>>>        at
>>>> org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.network.DemandForwardingBridgeSupport.start(DemandForwardingBridgeSupport.java:227)
>>>>        at
>>>> org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:130)
>>>>        at
>>>> org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent$2.run(MulticastDiscoveryAgent.java:506)
>>>>        at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>>>        at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>>>        at java.lang.Thread.run(Thread.java:595)
>>>>
>>>> Broker NB-BKR-B has the similar warning. I have not test message
>>>> forward
>>>> yet. Just feel uncomfortable seeing these stacktraces. But when I
>>>> change
>>>> 'myhost.mycompany.com' to localhost' under 'tcp' uri, the log does not
>>>> have
>>>> those warning and stacktrace. Also if these two brokers are hosted on
>>>> two
>>>> different VMs and uses host name or IP, it works fine.
>>>>
>>>> What might be the problem here?
>>>>
>>>> -J
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29356394.html
>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> http://blog.garytully.com
>>>
>>> Open Source Integration
>>> http://fusesource.com
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29390699.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 
> 

-- 
View this message in context: http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29400774.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Can I can run two brokers as network using multicast on the same host?

Posted by jzhang <jz...@wellington.com>.
I think the "&" should be like "&amp;" in xml:

"multicast://default?group=mygroup&amp;useLocalHost=false"

I will test it out and post the results. Thanks for the good catch.

-J





Gary Tully wrote:
> 
> discoveryUri="multicast://default?group=mygroup?useLocalHost=false" looks
> odd,
> the query string needs to use & to separate arguments,
> it should be:
>  "multicast://default?group=mygroup&useLocalHost=false
> 
> On 9 August 2010 19:17, jzhang <jz...@wellington.com> wrote:
>>
>> Thanks for the reply. I have added this property to the xml:
>>
>> transportConnectors>
>>           <transportConnector name="openwire"
>> uri="tcp://myhost.mycompany.com:61617"
>> discoveryUri="multicast://default?group=mygroup?useLocalHost=false"/>
>>        </transportConnectors>
>>
>> I have three brokers A, B and C (B and C are on the same Linux VM). I
>> started A first, and then B and then C. From log I can see A and B, A and
>> C
>> can 'see' each other. But there is no connection between B and C:
>>
>> - A log:
>> 2010-08-09 13:52:55,561 | INFO  | Network connection between
>> vm://NB-BKR-A#0
>> and tcp://lab-2/134.42.73.122:61617(NB-BKR-B) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-A#0
>> ..
>> 2010-08-09 13:53:17,161 | INFO  | Network connection between
>> vm://NB-BKR-A#2
>> and tcp://lab-2/134.42.73.122:61618(NB-BKR-C) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-A#2
>>
>> - B log:
>> 2010-08-09 13:52:55,938 | INFO  | Network connection between
>> vm://NB-BKR-B#0
>> and tcp://lab-1/134.42.73.100:61617(NB-BKR-A) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-B#0
>>
>> - C log:
>> 2010-08-09 13:53:17,810 | INFO  | Network connection between
>> vm://NB-BKR-C#0
>> and tcp://lab-1/134.42.73.100:61617(NB-BKR-A) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-C#0
>>
>> Is this expected?
>>
>> -J
>>
>>
>> Gary Tully wrote:
>>>
>>> this sounds like https://issues.apache.org/activemq/browse/AMQ-2771
>>> note the comments at the end about useLocalHost=false
>>>
>>> On 5 August 2010 22:23, jzhang <jz...@wellington.com> wrote:
>>>>
>>>> I am trying to set up a simple network of brokers within the same host
>>>> (Linux
>>>> VM) using multicast. It seems that I can only use 'localhost' as host
>>>> name
>>>> in tcp uri. If I use IP address or DNS name, the log shows 'connection
>>>> refused' warning message. Here are some details:
>>>>
>>>> My configurations:
>>>>
>>>> - for broker NB-BKR-B:
>>>> ...
>>>>  <networkConnectors>
>>>>            <networkConnector name="labnb1"
>>>> uri="multicast://default?group=test-lab-1" />
>>>>  </networkConnectors>
>>>>
>>>> ...
>>>>   <transportConnectors>
>>>>            <transportConnector name="openwire"
>>>> uri="tcp://myhost.mycompany.com:61617"
>>>> discoveryUri="multicast://default?group=test-lab-1"/>
>>>>        </transportConnectors>
>>>> ...
>>>>
>>>> - for broker NB-BKR-C:
>>>> ...
>>>>  <networkConnectors>
>>>>            <networkConnector name="labnb1"
>>>> uri="multicast://default?group=test-lab-1" />
>>>>  </networkConnectors>
>>>>
>>>> ...
>>>>   <transportConnectors>
>>>>            <transportConnector name="openwire"
>>>> uri="tcp://myhost.mycompany.com:61618"
>>>> discoveryUri="multicast://default?group=test-lab-1"/>
>>>>        </transportConnectors>
>>>> ...
>>>>
>>>> Now when started both brokers, log shows (NB-BKR-C;s log):
>>>>
>>>> 2010-08-05 17:06:29,054 | WARN  | Could not start network bridge
>>>> between:
>>>> vm://NB-BKR-C and: tcp://lab-2:61617 due to: java.net.ConnectException:
>>>> Connection refused |
>>>> org.apache.activemq.network.DiscoveryNetworkConnector |
>>>> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
>>>> 2010-08-05 17:06:29,055 | DEBUG | Start failure exception:
>>>> java.net.ConnectException: Connection refused |
>>>> org.apache.activemq.network.DiscoveryNetworkConnector |
>>>> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
>>>> java.net.ConnectException: Connection refused
>>>>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>>>>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>>>>        at
>>>> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>>>>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>>>>        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>>>>        at java.net.Socket.connect(Socket.java:519)
>>>>        at
>>>> org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:436)
>>>>        at
>>>> org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:402)
>>>>        at
>>>> org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.network.DemandForwardingBridgeSupport.start(DemandForwardingBridgeSupport.java:227)
>>>>        at
>>>> org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:130)
>>>>        at
>>>> org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent$2.run(MulticastDiscoveryAgent.java:506)
>>>>        at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>>>        at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>>>        at java.lang.Thread.run(Thread.java:595)
>>>>
>>>> Broker NB-BKR-B has the similar warning. I have not test message
>>>> forward
>>>> yet. Just feel uncomfortable seeing these stacktraces. But when I
>>>> change
>>>> 'myhost.mycompany.com' to localhost' under 'tcp' uri, the log does not
>>>> have
>>>> those warning and stacktrace. Also if these two brokers are hosted on
>>>> two
>>>> different VMs and uses host name or IP, it works fine.
>>>>
>>>> What might be the problem here?
>>>>
>>>> -J
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29356394.html
>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> http://blog.garytully.com
>>>
>>> Open Source Integration
>>> http://fusesource.com
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29390699.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 
> 

-- 
View this message in context: http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29392251.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Can I can run two brokers as network using multicast on the same host?

Posted by Gary Tully <ga...@gmail.com>.
discoveryUri="multicast://default?group=mygroup?useLocalHost=false" looks odd,
the query string needs to use & to separate arguments,
it should be:
 "multicast://default?group=mygroup&useLocalHost=false

On 9 August 2010 19:17, jzhang <jz...@wellington.com> wrote:
>
> Thanks for the reply. I have added this property to the xml:
>
> transportConnectors>
>           <transportConnector name="openwire"
> uri="tcp://myhost.mycompany.com:61617"
> discoveryUri="multicast://default?group=mygroup?useLocalHost=false"/>
>        </transportConnectors>
>
> I have three brokers A, B and C (B and C are on the same Linux VM). I
> started A first, and then B and then C. From log I can see A and B, A and C
> can 'see' each other. But there is no connection between B and C:
>
> - A log:
> 2010-08-09 13:52:55,561 | INFO  | Network connection between vm://NB-BKR-A#0
> and tcp://lab-2/134.42.73.122:61617(NB-BKR-B) has been established. |
> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
> localBroker=vm://NB-BKR-A#0
> ..
> 2010-08-09 13:53:17,161 | INFO  | Network connection between vm://NB-BKR-A#2
> and tcp://lab-2/134.42.73.122:61618(NB-BKR-C) has been established. |
> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
> localBroker=vm://NB-BKR-A#2
>
> - B log:
> 2010-08-09 13:52:55,938 | INFO  | Network connection between vm://NB-BKR-B#0
> and tcp://lab-1/134.42.73.100:61617(NB-BKR-A) has been established. |
> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
> localBroker=vm://NB-BKR-B#0
>
> - C log:
> 2010-08-09 13:53:17,810 | INFO  | Network connection between vm://NB-BKR-C#0
> and tcp://lab-1/134.42.73.100:61617(NB-BKR-A) has been established. |
> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
> localBroker=vm://NB-BKR-C#0
>
> Is this expected?
>
> -J
>
>
> Gary Tully wrote:
>>
>> this sounds like https://issues.apache.org/activemq/browse/AMQ-2771
>> note the comments at the end about useLocalHost=false
>>
>> On 5 August 2010 22:23, jzhang <jz...@wellington.com> wrote:
>>>
>>> I am trying to set up a simple network of brokers within the same host
>>> (Linux
>>> VM) using multicast. It seems that I can only use 'localhost' as host
>>> name
>>> in tcp uri. If I use IP address or DNS name, the log shows 'connection
>>> refused' warning message. Here are some details:
>>>
>>> My configurations:
>>>
>>> - for broker NB-BKR-B:
>>> ...
>>>  <networkConnectors>
>>>            <networkConnector name="labnb1"
>>> uri="multicast://default?group=test-lab-1" />
>>>  </networkConnectors>
>>>
>>> ...
>>>   <transportConnectors>
>>>            <transportConnector name="openwire"
>>> uri="tcp://myhost.mycompany.com:61617"
>>> discoveryUri="multicast://default?group=test-lab-1"/>
>>>        </transportConnectors>
>>> ...
>>>
>>> - for broker NB-BKR-C:
>>> ...
>>>  <networkConnectors>
>>>            <networkConnector name="labnb1"
>>> uri="multicast://default?group=test-lab-1" />
>>>  </networkConnectors>
>>>
>>> ...
>>>   <transportConnectors>
>>>            <transportConnector name="openwire"
>>> uri="tcp://myhost.mycompany.com:61618"
>>> discoveryUri="multicast://default?group=test-lab-1"/>
>>>        </transportConnectors>
>>> ...
>>>
>>> Now when started both brokers, log shows (NB-BKR-C;s log):
>>>
>>> 2010-08-05 17:06:29,054 | WARN  | Could not start network bridge between:
>>> vm://NB-BKR-C and: tcp://lab-2:61617 due to: java.net.ConnectException:
>>> Connection refused |
>>> org.apache.activemq.network.DiscoveryNetworkConnector |
>>> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
>>> 2010-08-05 17:06:29,055 | DEBUG | Start failure exception:
>>> java.net.ConnectException: Connection refused |
>>> org.apache.activemq.network.DiscoveryNetworkConnector |
>>> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
>>> java.net.ConnectException: Connection refused
>>>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>>>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>>>        at
>>> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>>>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>>>        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>>>        at java.net.Socket.connect(Socket.java:519)
>>>        at
>>> org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:436)
>>>        at
>>> org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:402)
>>>        at
>>> org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
>>>        at
>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>        at
>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>        at
>>> org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
>>>        at
>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>        at
>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>        at
>>> org.apache.activemq.network.DemandForwardingBridgeSupport.start(DemandForwardingBridgeSupport.java:227)
>>>        at
>>> org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:130)
>>>        at
>>> org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent$2.run(MulticastDiscoveryAgent.java:506)
>>>        at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>>        at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>>        at java.lang.Thread.run(Thread.java:595)
>>>
>>> Broker NB-BKR-B has the similar warning. I have not test message forward
>>> yet. Just feel uncomfortable seeing these stacktraces. But when I change
>>> 'myhost.mycompany.com' to localhost' under 'tcp' uri, the log does not
>>> have
>>> those warning and stacktrace. Also if these two brokers are hosted on two
>>> different VMs and uses host name or IP, it works fine.
>>>
>>> What might be the problem here?
>>>
>>> -J
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29356394.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> http://blog.garytully.com
>>
>> Open Source Integration
>> http://fusesource.com
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29390699.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: Can I can run two brokers as network using multicast on the same host?

Posted by jzhang <jz...@wellington.com>.
Thanks for the reply. I have added this property to the xml:

transportConnectors>
           <transportConnector name="openwire"
uri="tcp://myhost.mycompany.com:61617"
discoveryUri="multicast://default?group=mygroup?useLocalHost=false"/>
        </transportConnectors>

I have three brokers A, B and C (B and C are on the same Linux VM). I
started A first, and then B and then C. From log I can see A and B, A and C
can 'see' each other. But there is no connection between B and C:

- A log:
2010-08-09 13:52:55,561 | INFO  | Network connection between vm://NB-BKR-A#0
and tcp://lab-2/134.42.73.122:61617(NB-BKR-B) has been established. |
org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
localBroker=vm://NB-BKR-A#0
..
2010-08-09 13:53:17,161 | INFO  | Network connection between vm://NB-BKR-A#2
and tcp://lab-2/134.42.73.122:61618(NB-BKR-C) has been established. |
org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
localBroker=vm://NB-BKR-A#2

- B log:
2010-08-09 13:52:55,938 | INFO  | Network connection between vm://NB-BKR-B#0
and tcp://lab-1/134.42.73.100:61617(NB-BKR-A) has been established. |
org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
localBroker=vm://NB-BKR-B#0

- C log:
2010-08-09 13:53:17,810 | INFO  | Network connection between vm://NB-BKR-C#0
and tcp://lab-1/134.42.73.100:61617(NB-BKR-A) has been established. |
org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
localBroker=vm://NB-BKR-C#0

Is this expected?

-J


Gary Tully wrote:
> 
> this sounds like https://issues.apache.org/activemq/browse/AMQ-2771
> note the comments at the end about useLocalHost=false
> 
> On 5 August 2010 22:23, jzhang <jz...@wellington.com> wrote:
>>
>> I am trying to set up a simple network of brokers within the same host
>> (Linux
>> VM) using multicast. It seems that I can only use 'localhost' as host
>> name
>> in tcp uri. If I use IP address or DNS name, the log shows 'connection
>> refused' warning message. Here are some details:
>>
>> My configurations:
>>
>> - for broker NB-BKR-B:
>> ...
>>  <networkConnectors>
>>            <networkConnector name="labnb1"
>> uri="multicast://default?group=test-lab-1" />
>>  </networkConnectors>
>>
>> ...
>>   <transportConnectors>
>>            <transportConnector name="openwire"
>> uri="tcp://myhost.mycompany.com:61617"
>> discoveryUri="multicast://default?group=test-lab-1"/>
>>        </transportConnectors>
>> ...
>>
>> - for broker NB-BKR-C:
>> ...
>>  <networkConnectors>
>>            <networkConnector name="labnb1"
>> uri="multicast://default?group=test-lab-1" />
>>  </networkConnectors>
>>
>> ...
>>   <transportConnectors>
>>            <transportConnector name="openwire"
>> uri="tcp://myhost.mycompany.com:61618"
>> discoveryUri="multicast://default?group=test-lab-1"/>
>>        </transportConnectors>
>> ...
>>
>> Now when started both brokers, log shows (NB-BKR-C;s log):
>>
>> 2010-08-05 17:06:29,054 | WARN  | Could not start network bridge between:
>> vm://NB-BKR-C and: tcp://lab-2:61617 due to: java.net.ConnectException:
>> Connection refused |
>> org.apache.activemq.network.DiscoveryNetworkConnector |
>> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
>> 2010-08-05 17:06:29,055 | DEBUG | Start failure exception:
>> java.net.ConnectException: Connection refused |
>> org.apache.activemq.network.DiscoveryNetworkConnector |
>> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
>> java.net.ConnectException: Connection refused
>>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>>        at
>> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>>        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>>        at java.net.Socket.connect(Socket.java:519)
>>        at
>> org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:436)
>>        at
>> org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:402)
>>        at
>> org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
>>        at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>        at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>        at
>> org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
>>        at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>        at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>        at
>> org.apache.activemq.network.DemandForwardingBridgeSupport.start(DemandForwardingBridgeSupport.java:227)
>>        at
>> org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:130)
>>        at
>> org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent$2.run(MulticastDiscoveryAgent.java:506)
>>        at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>        at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>        at java.lang.Thread.run(Thread.java:595)
>>
>> Broker NB-BKR-B has the similar warning. I have not test message forward
>> yet. Just feel uncomfortable seeing these stacktraces. But when I change
>> 'myhost.mycompany.com' to localhost' under 'tcp' uri, the log does not
>> have
>> those warning and stacktrace. Also if these two brokers are hosted on two
>> different VMs and uses host name or IP, it works fine.
>>
>> What might be the problem here?
>>
>> -J
>> --
>> View this message in context:
>> http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29356394.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 
> 

-- 
View this message in context: http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29390699.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Can I can run two brokers as network using multicast on the same host?

Posted by Gary Tully <ga...@gmail.com>.
this sounds like https://issues.apache.org/activemq/browse/AMQ-2771
note the comments at the end about useLocalHost=false

On 5 August 2010 22:23, jzhang <jz...@wellington.com> wrote:
>
> I am trying to set up a simple network of brokers within the same host (Linux
> VM) using multicast. It seems that I can only use 'localhost' as host name
> in tcp uri. If I use IP address or DNS name, the log shows 'connection
> refused' warning message. Here are some details:
>
> My configurations:
>
> - for broker NB-BKR-B:
> ...
>  <networkConnectors>
>            <networkConnector name="labnb1"
> uri="multicast://default?group=test-lab-1" />
>  </networkConnectors>
>
> ...
>   <transportConnectors>
>            <transportConnector name="openwire"
> uri="tcp://myhost.mycompany.com:61617"
> discoveryUri="multicast://default?group=test-lab-1"/>
>        </transportConnectors>
> ...
>
> - for broker NB-BKR-C:
> ...
>  <networkConnectors>
>            <networkConnector name="labnb1"
> uri="multicast://default?group=test-lab-1" />
>  </networkConnectors>
>
> ...
>   <transportConnectors>
>            <transportConnector name="openwire"
> uri="tcp://myhost.mycompany.com:61618"
> discoveryUri="multicast://default?group=test-lab-1"/>
>        </transportConnectors>
> ...
>
> Now when started both brokers, log shows (NB-BKR-C;s log):
>
> 2010-08-05 17:06:29,054 | WARN  | Could not start network bridge between:
> vm://NB-BKR-C and: tcp://lab-2:61617 due to: java.net.ConnectException:
> Connection refused | org.apache.activemq.network.DiscoveryNetworkConnector |
> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
> 2010-08-05 17:06:29,055 | DEBUG | Start failure exception:
> java.net.ConnectException: Connection refused |
> org.apache.activemq.network.DiscoveryNetworkConnector |
> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
> java.net.ConnectException: Connection refused
>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>        at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>        at java.net.Socket.connect(Socket.java:519)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:436)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:402)
>        at
> org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
>        at
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>        at
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>        at
> org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
>        at
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>        at
> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>        at
> org.apache.activemq.network.DemandForwardingBridgeSupport.start(DemandForwardingBridgeSupport.java:227)
>        at
> org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:130)
>        at
> org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent$2.run(MulticastDiscoveryAgent.java:506)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>        at java.lang.Thread.run(Thread.java:595)
>
> Broker NB-BKR-B has the similar warning. I have not test message forward
> yet. Just feel uncomfortable seeing these stacktraces. But when I change
> 'myhost.mycompany.com' to localhost' under 'tcp' uri, the log does not have
> those warning and stacktrace. Also if these two brokers are hosted on two
> different VMs and uses host name or IP, it works fine.
>
> What might be the problem here?
>
> -J
> --
> View this message in context: http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29356394.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com