activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rkparikh <rkpar...@essar.com>
Subject Not able to configure JDBC Master/Slave Clustering in ActiveMQ 5.4.2
Date Mon, 21 Feb 2011 04:05:55 GMT

Hi, 

I am trying to configure the JDBC Master/Slave clustering with two
brokers(says BrokerA and BrokerB) on local machines. 

I have follow the below steps to check 
1. Start the brokerA. 
    - it gets the lock on DB table. 
2. Start the brokerB 
    - it is trying to get the lock but not getting it. 
3. Start the client 
    - the client successfully connected to borker A. 
4. Stop brokerA 
    -  the client successfully connected to brokerB 
5. start brokerA. 
6. Stop brokerB. 

Now the problem is, the client is not getting connected to broker A , but it
is continuously trying to connect 
to BrokerB. 
If i started the broker B then the client is connected to BrokerB. 

Can someone help me out regarding this problem.

-------------------------------------------------------------------------------------------------------

I have attached the files containing the configuration for both brokers. 

Configuration File for Broker A :
----------------------------------------------------------------------------- 
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="BrokerA"
dataDirectory="${activemq.base}/data"
destroyApplicationContextOnStop="true"> 
             <managementContext> 
            <managementContext createConnector="false"/> 
        </managementContext> 
        
                <networkConnectors> 
                        <networkConnector name="linkToBrokerB" 
                uri="static:(tcp://localhost:51616)" duplex="true" 
                networkTTL="3" 
            />             
          </networkConnectors> 
                <!--<networkConnectors> 
              <networkConnector name="linkToBrokerB"
uri="multicast://default" 
                dynamicOnly="true" 
                networkTTL="3" 
                prefetchSize="1" 
                decreaseNetworkConsumerPriority="true"/> 
            </networkConnectors>--> 

        <persistenceAdapter> 
            <!--<kahaDB directory="${activemq.base}/data/kahadb"/>--> 
                        <!--<kahaDB directory="C:/Projects/data/kahadb"/>--> 
                         <jdbcPersistenceAdapter dataSource="#dataSource"/> 
        </persistenceAdapter> 
                  
        
        <transportConnectors> 
                       <transportConnector name="openwire"
uri="tcp://0.0.0.0:61616"   discoveryUri="multicast://default" 
                                           updateClusterClients="true"
rebalanceClusterClients="true"/> 
        </transportConnectors> 

    </broker> 

  
    <import resource="jetty.xml"/> 
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close"> 
    <property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver"/> 
    <property name="url" value="jdbc:oracle:thin:@DT21764:1521:XE"/> 
    <property name="username" value="AMQ_DB"/> 
    <property name="password" value="AMQ_DB"/> 
    <property name="maxActive" value="200"/> 
    <property name="poolPreparedStatements" value="true"/> 
  </bean> 
------------------------------------------------------------------------------ 

Configuration File for Broker B :
-------------------------------------------------------------------------------- 
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="BrokerA"
dataDirectory="${activemq.base}/data"
destroyApplicationContextOnStop="true"> 
             <managementContext> 
            <managementContext createConnector="false"/> 
        </managementContext> 
        
                <networkConnectors> 
                        <networkConnector name="linkToBrokerA" 
                uri="static:(tcp://localhost:61616)" duplex="true" 
                networkTTL="3" 
            />             
          </networkConnectors> 
                <!--<networkConnectors> 
              <networkConnector name="linkToBrokerA"
uri="multicast://default" 
                dynamicOnly="true" 
                networkTTL="3" 
                prefetchSize="1" 
                decreaseNetworkConsumerPriority="true"/> 
            </networkConnectors>--> 

        <persistenceAdapter> 
            <!--<kahaDB directory="${activemq.base}/data/kahadb"/>--> 
                        <!--<kahaDB directory="C:/Projects/data/kahadb"/>--> 
                         <jdbcPersistenceAdapter dataSource="#dataSource"/> 
        </persistenceAdapter> 
                  
        
        <transportConnectors> 
                       <transportConnector name="openwire"
uri="tcp://0.0.0.0:51616"   discoveryUri="multicast://default" 
                                           updateClusterClients="true"
rebalanceClusterClients="true"/> 
        </transportConnectors> 

    </broker> 

  
    <import resource="jetty.xml"/> 
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close"> 
    <property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver"/> 
    <property name="url" value="jdbc:oracle:thin:@DT21764:1521:XE"/> 
    <property name="username" value="AMQ_DB"/> 
    <property name="password" value="AMQ_DB"/> 
    <property name="maxActive" value="200"/> 
    <property name="poolPreparedStatements" value="true"/> 
  </bean> 
------------------------------------------------------------------ 
Also at client side i have used below configuration:

failover:(tcp://DT21764:61616,tcp://DT21764:51616)?reconnectDelay=20&maxReconnectDelay=10&randomize=true

-------------------------------------------------------------------------------------------------------

-----
Thanks and Regards,
Rahul
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Not-able-to-configure-JDBC-Master-Slave-Clustering-in-ActiveMQ-5-4-2-tp3316794p3316794.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message