You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Vinod_mit <vi...@gmail.com> on 2007/05/21 14:46:52 UTC

Creating Network of Brokers

Hi 
I have just installed activemq, I have to start work with failover netowrk
brokers.I dont have
much idea about this can any one explain me regarding this.
I did like this iam not sure iam right.if wrong please help me.

1. I have created first broker like this ,
   In the activemq.xml i put these values 
 
    <transportConnectors> 
      <transportConnector uri="discovery:tcp://localhost:61617"/> 
    </transportConnectors> 

    <networkConnectors> 
      <networkConnector uri="static:tcp://localhost:61618"/> 
    </networkConnectors> 

after that i have started activemq it says activemq jms started.

2.I created second broker like this.

  I have modified the same activemq.xml by changing <transportConnectors>
and </networkConnectors>  values like this.

   <transportConnectors> 
      <transportConnector uri="discovery:tcp://localhost:61618"/> 
    </transportConnectors> 

    <networkConnectors> 
      <networkConnector uri="static:tcp://localhost:61617"/> 
    </networkConnectors> 
and started a activemq in another command window and got these message

INFO  faultPersistenceAdapterFactory - Journal is locked... waiting 10
seconds f
or the journal to be unlocked.

when i kill the first activemq process second gets activated.

but iam not understanding where i have to include failover detail ??? 
these details where i have to include ??

   <networkConnectors> 
      <networkConnector 
uri="static:failover:tcp://localhost:61617"/<tcp://localhost:61617%22/> 
> 
    </networkConnectors> 

is it in the client program like consumer ??? or in some file, please
expalin

Thanks
cinod
-- 
View this message in context: http://www.nabble.com/Creating-Network-of-Brokers-tf3790031s2354.html#a10718124
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Creating Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On 5/23/07, Vinod_mit <vi...@gmail.com> wrote:
>
>
> I tried the above iam getting some errors, because my network of brokers not
> working .
>
> i created one first system like this inthe first comuter
>
>                 <transportConnectors>
>                         <transportConnector name="openwire" uri="tcp://localhost:61616"/>
>                 </transportConnectors>
>
>                 <networkConnectors>
>
>                         <networkConnector name="host1 and host2"
> uri="static:/(tcp://localhostsecondsys:61616,tcp://localhostsecondsys:61616)"/>
>
>                 </networkConnectors>
>
> and second like this in the second computer
>
>                 <transportConnectors>
>                         <transportConnector name="openwire" uri="tcp://localhost:61616"/>
>                 </transportConnectors>
>
>                 <networkConnectors>
>
>                         <networkConnector name="host1 and host2"
> uri="static:/(tcp://localhostfirstsys:61616,tcp://localhostfirstsys:61616)"/>
>
>                 </networkConnectors>
>
> when i test this appication from first computer i cannot see the message
> info in the second computer. can any one help me
> how to do it with an example.

If these computers are on the same subnet, the easiest way to get a
network of brokers operational within minutes is to simply use the
default configuration which uses multicast. Below are the
instructions:

1) From host one, cd into the examples directory and run 'ant
producer'. This will send 10 messages to a queue named TEST.FOO.

2) From host two, cd into the examples directory and run 'ant
consumer' This will receive the 10 messages from the queue named
TEST.FOO.

Only once this works properly would I suggest changing the
configuration to something more custom. This ensures that the network
of brokers is, in fact, working correctly before any customizations
take place.

I always use this method when setting up a new network of brokers just
to ensure that everything is OK. Two days ago I set up a new network
of brokers using the default settings and discovered a networking
issue that had to be fixed before the network of brokers would operate
correctly.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Re: Creating Network of Brokers

Posted by Vinod_mit <vi...@gmail.com>.

I tried the above iam getting some errors, because my network of brokers not
working .

i created one first system like this inthe first comuter

		<transportConnectors>
			<transportConnector name="openwire" uri="tcp://localhost:61616"/>
		</transportConnectors>
	    
		<networkConnectors>
		
			<networkConnector name="host1 and host2"
uri="static:/(tcp://localhostsecondsys:61616,tcp://localhostsecondsys:61616)"/>
		
		</networkConnectors>

and second like this in the second computer

		<transportConnectors>
			<transportConnector name="openwire" uri="tcp://localhost:61616"/>
		</transportConnectors>
	    
		<networkConnectors>
		
			<networkConnector name="host1 and host2"
uri="static:/(tcp://localhostfirstsys:61616,tcp://localhostfirstsys:61616)"/>
		
		</networkConnectors>

when i test this appication from first computer i cannot see the message
info in the second computer. can any one help me 
how to do it with an example.

thanks

-- 
View this message in context: http://www.nabble.com/Creating-Network-of-Brokers-tf3790031s2354.html#a10761166
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Creating Network of Brokers

Posted by Bruce Snyder <br...@gmail.com>.
On 5/21/07, Gaurav Hariani <ga...@blackspark.com> wrote:
> It seems you are trying to run two instances of ActiveMQ from the same
> installation.
> And they are both trying to write to the same journal ... change the
> configuration to use a different journal location for the second broker.

Make sure your ports are not conflicting either. Currently I see that
you have clashing port numbers between the two brokers as well. You'll
need to rectify this to get two brokers running on the same machine.
This includes uncommenting the managementContext element and
specifying a different JMX port number for each broker.

Also, for ease of reading logs and debugging, assign each broker it's
own name in the brokerName attribute of the broker element.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/

Re: Creating Network of Brokers

Posted by Gaurav Hariani <ga...@blackspark.com>.
It seems you are trying to run two instances of ActiveMQ from the same 
installation.
And they are both trying to write to the same journal ... change the 
configuration to use a different journal location for the second broker.


Vinod_mit wrote:
> Hi 
> I have just installed activemq, I have to start work with failover netowrk
> brokers.I dont have
> much idea about this can any one explain me regarding this.
> I did like this iam not sure iam right.if wrong please help me.
>
> 1. I have created first broker like this ,
>    In the activemq.xml i put these values 
>  
>     <transportConnectors> 
>       <transportConnector uri="discovery:tcp://localhost:61617"/> 
>     </transportConnectors> 
>
>     <networkConnectors> 
>       <networkConnector uri="static:tcp://localhost:61618"/> 
>     </networkConnectors> 
>
> after that i have started activemq it says activemq jms started.
>
> 2.I created second broker like this.
>
>   I have modified the same activemq.xml by changing <transportConnectors>
> and </networkConnectors>  values like this.
>
>    <transportConnectors> 
>       <transportConnector uri="discovery:tcp://localhost:61618"/> 
>     </transportConnectors> 
>
>     <networkConnectors> 
>       <networkConnector uri="static:tcp://localhost:61617"/> 
>     </networkConnectors> 
> and started a activemq in another command window and got these message
>
> INFO  faultPersistenceAdapterFactory - Journal is locked... waiting 10
> seconds f
> or the journal to be unlocked.
>
> when i kill the first activemq process second gets activated.
>
> but iam not understanding where i have to include failover detail ??? 
> these details where i have to include ??
>
>    <networkConnectors> 
>       <networkConnector 
> uri="static:failover:tcp://localhost:61617"/<tcp://localhost:61617%22/> 
>   
>     </networkConnectors> 
>
> is it in the client program like consumer ??? or in some file, please
> expalin
>
> Thanks
> cinod
>