activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NabiL <elaomari.na...@gmail.com>
Subject JDBC Master/Slave
Date Mon, 19 Oct 2009 21:34:29 GMT

Hi,

I try to set up two AMQ 5.3 brokers (deployed on 2 tomcat servers ) to get
some redundancy in
our solution. 

The AMQ documentation describes the JDBC Master/slave as below :
On startup one master grabs an exclusive lock in the broker database and all
other brokers are slaves and pause waiting for the exclusive lock. 
>> This situation occurs only if we use AMQ as standalone (not embedding in
>> server container tomcat)

I configured the 2 AMQ Web-console5.3.war on each Tomcat server to use a
shared DB (Mysql). As a result, the master start successfully and grabs the
lock, the AMQ slave can't start. To resolve this situation i positioned
useDatabaseLock=false.

Questions : 
1 - If i disable database locking.. Do i need to use some other mechanism
to stop the slave broker from becoming active while the master is on-line in
order to avoid data corruption ?

2 - i configured  persistenceAdapter element on each broker as show below :
    <persistenceAdapter>
        <jdbcPersistenceAdapter dataSource="#mysql-ds"
useDatabaseLock="false"/>
     </persistenceAdapter>

<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
		<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
		<property name="url"
value="jdbc:mysql://host/activemq?relaxAutoCommit=true"/>
		<property name="username" value="xxx"/>
		<property name="password" value="xxx"/>
		<property name="maxActive" value="200"/>
		<property name="poolPreparedStatements" value="true"/>
   </bean>
 
 As you can see, i did not specify  any data
directory="${activemq.base}/data/ on jdbcPersistenceAdapter element. What is
the difference if specify the data directory on this element ?


Sorry for my bad english. Any help will be appreciated.

Thanks in advance.
NabiLo


-- 
View this message in context: http://www.nabble.com/JDBC-Master-Slave-tp25966078p25966078.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message