activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spiderman2 <shawn.gan...@bridgewatersystems.com>
Subject Re: Failover Functionality - Master/Slave
Date Fri, 09 Feb 2007 16:02:21 GMT

I've now tried running the Master and Slave on different hosts, as the JDBC
Master-Slave example intends. I see the same thing.

James, it seems you are right in that they don't seem to be using the same
DB. They are both configured to use:

<bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
    <property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver"/>
    <property name="url" value="jdbc:oracle:thin:@ks063:1521:AMQDB"/>
    <property name="username" value="activemq"/>
    <property name="password" value="activemq"/>
    <property name="poolPreparedStatements" value="true"/>
</bean>

HOWEVER, from the logs I'll show below, they also seem to be using the derby
datasource, and each a different one at that. Showing that both brokers are
becoming masters.

Should I be disabling the JDBCPersistenceAdapter? Or how do I get it to
share the oracle Database?

EDITED LOGS
==========

I start the first broker, Shawn1:
<snip>
JDBCPersistenceAdapter  - Database driver
recognized:[apache_derby_embedded_jdbc_driver]
DefaultDatabaseLocker    - Attempting to acquire the exclusive lock to
become the Master broker
DefaultDatabaseLocker    - Becoming the master on dataSource:
org.apache.derby.jdbc.EmbeddedDataSource@771eb1
</snip>

Start up is successul. Now Starting the 2nd Broker, Shawn2:

JDBCPersistenceAdapter  - Database driver
recognized:apache_derby_embedded_jdbc_driver]
DefaultDatabaseLocker    - Attempting to acquire the exclusive lock to
become the Master broker
DefaultDatabaseLocker    - Becoming the master on dataSource:
org.apache.derby.jdbc.EmbeddedDataSource@1115152

Network connection between vm://Shawn2#0 and
tcp://SGANDHI/192.168.150.118:61616(Shawn1) has been established.




James.Strachan wrote:
> 
> Note that with JDBC Master/Slave you don't network them together -
> with JDBC Master/Slave there is no direct master-slave communication.
> Nor should they be aware of each other, as the slave does not start
> listening on any sockets until it becomes the master (for JDBC
> master/slave).
> 
> Could you show your logs? Particular; when running the master, it
> should be clear it gets the lock on the database, then the slave
> clearly waits for the lock? Then when the master is killed it should
> be clear that the slave takes over right?
> 
> Both brokers are definitely using the same database right? I'm
> wondering if for some reason the exclusive locking isn't working
> 
> On 2/8/07, spiderman2 <shawn.gandhi@bridgewatersystems.com> wrote:
>>
>> I'm running the JDBC Master/Slave example as defined on
>> http://activemq.apache.org/jdbc-master-slave.html Web Docs
>>
>> Once they're both running (and logs show they're aware of each other), I
>> put
>> 100 messages on the Master's Queue. When I shut the Master down, I would
>> expect to see these messages appear on the Slave's queue. But I don't.
>>
>> I'm using Jconsole to see the Total Message count.
>>
>> MY CONFIG:
>> ========
>>
>> I'm running both Brokers on the same machine - so I had to change the
>> following on the slave's config to avoid conflict with the Master:
>>
>> TransportConnector default: port to 61617 (Instead of 61616)
>> TransportConnector stompt: port to 61614 (Instead of 61613)
>> persistenceAdapter:
>>         jdbcPersistenceAdapter
>> dataDirectory="${activemq.base}/activemq-data2" instead of data
>>
>>
>> Lastly, I'm using autodiscover:
>> <networkConnector name="default-nc" uri="multicast://default"/>
>>
>> and
>>
>>   <bean id="oracle-ds" class="org.apache.commons.dbcp.BasicDataSource"
>> destroy-method="close">
>>     <property name="driverClassName"
>> value="oracle.jdbc.driver.OracleDriver"/>
>>     <property name="url" value="jdbc:oracle:thin:@ks063:1521:AMQDB"/>
>>     <property name="username" value="activemq"/>
>>     <property name="password" value="activemq"/>
>>     <property name="poolPreparedStatements" value="true"/>
>>   </bean>
>>
>> What am I doing wrong? Or is this correct functionality?
>> --
>> View this message in context:
>> http://www.nabble.com/Failover-Functionality---Master-Slave-tf3196126s2354.html#a8874536
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/Failover-Functionality---Master-Slave-tf3196126s2354.html#a8888358
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message