You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by William Blackburn <wj...@mac.com> on 2006/12/14 02:19:45 UTC

4.1 Master/Slave - Slave dies upon first conn to master

I can't seem to get master slave working in 4.1 -- I configured the  
master and slave according to the instructions on the site. They  
start up OK, and I can see from the logs that the slave attaches to  
the master. But, as soon as the first connection is made to the  
master, the slave dies. The master log looks like:

INFO  DefaultDatabaseLocker          - Attempting to acquire the  
exclusive lock to become the Master broker
INFO  DefaultDatabaseLocker          - Becoming the master on  
dataSource: org.postgresql.ds.PGPoolingDataSource@724f31
INFO  JournalPersistenceAdapter      - Journal Recovery Started from:  
Active Journal: using 5 x 20.0 Megs at: /Users/wblackburn/ 
activemq-4.1.0-master/activemq-data/journal
INFO  JournalPersistenceAdapter      - Journal Recovered: 0 message 
(s) in transactions recovered.
INFO  TransportServerThreadSupport   - Listening for connections at:  
tcp://fastgt.local:61617
INFO  TransportConnector             - Connector openwire Started
INFO  BrokerService                  - ActiveMQ JMS Message Broker  
(localhost, ID:fastgt.local-50799-1166058345810-1:0) started
INFO  TransportConnection            - Slave Broker localhost is  
attached
ERROR MasterBroker                   - Slave Failed
java.lang.AssertionError: Unsupported Method
         at org.apache.activemq.transport.TransportSupport.request 
(TransportSupport.java:71)
         at org.apache.activemq.transport.TransportFilter.request 
(TransportFilter.java:88)
         at org.apache.activemq.transport.TransportFilter.request 
(TransportFilter.java:88)
         at org.apache.activemq.transport.MutexTransport.request 
(MutexTransport.java:49)
         at org.apache.activemq.broker.ft.MasterBroker.sendSyncToSlave 
(MasterBroker.java:363)
         at org.apache.activemq.broker.ft.MasterBroker.sendToSlave 
(MasterBroker.java:345)
         at org.apache.activemq.broker.ft.MasterBroker.acknowledge 
(MasterBroker.java:320)
         at org.apache.activemq.broker.MutableBrokerFilter.acknowledge 
(MutableBrokerFilter.java:88)
         at  
org.apache.activemq.broker.TransportConnection.processMessageAck 
(TransportConnection.java:488)
         at org.apache.activemq.command.MessageAck.visit 
(MessageAck.java:179)
         at org.apache.activemq.broker.TransportConnection.service 
(TransportConnection.java:284)
         at org.apache.activemq.broker.TransportConnection$1.onCommand 
(TransportConnection.java:177)
         at org.apache.activemq.transport.TransportFilter.onCommand 
(TransportFilter.java:65)
         at  
org.apache.activemq.transport.WireFormatNegotiator.onCommand 
(WireFormatNegotiator.java:133)
         at org.apache.activemq.transport.InactivityMonitor.onCommand 
(InactivityMonitor.java:122)
         at org.apache.activemq.transport.TransportSupport.doConsume 
(TransportSupport.java:84)
         at org.apache.activemq.transport.tcp.TcpTransport.run 
(TcpTransport.java:137)
         at java.lang.Thread.run(Thread.java:613)
ERROR MasterBroker                   - Slave Failed

master config is:

<!--
     Licensed to the Apache Software Foundation (ASF) under one or more
     contributor license agreements.  See the NOTICE file distributed  
with
     this work for additional information regarding copyright ownership.
     The ASF licenses this file to You under the Apache License,  
Version 2.0
     (the "License"); you may not use this file except in compliance  
with
     the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or  
implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!-- START SNIPPET: example -->
<beans>

   <!-- Allows us to use system properties as variables in this  
configuration file -->
   <bean  
class="org.springframework.beans.factory.config.PropertyPlaceholderConfi 
gurer"/>

   <broker brokerName="localhost" useJmx="true" xmlns="http:// 
activemq.org/config/1.0">

     <persistenceAdapter>
         <journaledJDBC journalLogFiles="5" dataDirectory="$ 
{activemq.base}/activemq-data" dataSource="#postgres-ds"/>
     </persistenceAdapter>

     <transportConnectors>
        <transportConnector name="openwire" uri="tcp://localhost: 
61617"/>
     </transportConnectors>

   </broker>

   <!--  This xbean configuration file supports all the standard  
spring xml configuration options -->

   <!-- Postgres DataSource Sample Setup -->
     <bean id="postgres-ds"  
class="org.postgresql.ds.PGPoolingDataSource">
         <property name="serverName" value="localhost"/>
         <property name="databaseName" value="activemq"/>
         <property name="portNumber" value="0"/>
         <property name="user" value="activemq"/>
         <property name="password" value="activemq"/>
         <property name="dataSourceName" value="postgres"/>
         <property name="initialConnections" value="1"/>
         <property name="maxConnections" value="10"/>
     </bean>

</beans>



The slave log looks like:

INFO  DefaultDatabaseLocker          - Attempting to acquire the  
exclusive lock to become the Master broker
INFO  DefaultDatabaseLocker          - Becoming the master on  
dataSource: org.postgresql.ds.PGPoolingDataSource@bcd14a
INFO  JournalPersistenceAdapter      - Journal Recovery Started from:  
Active Journal: using 5 x 20.0 Megs at: /Users/wblackburn/ 
activemq-4.1.0-slave/activemq-data/journal
INFO  JournalPersistenceAdapter      - Journal Recovered: 0 message 
(s) in transactions recovered.
INFO  TransportServerThreadSupport   - Listening for connections at:  
tcp://fastgt.local:61618
INFO  TransportConnector             - Connector openwire Started
INFO  TransportConnector             - Connector vm://localhost Started
INFO  MasterConnector                - Starting a network connection  
between vm://localhost#0 and tcp://null:0 has been established.
INFO  BrokerService                  - ActiveMQ JMS Message Broker  
(localhost, ID:fastgt.local-50808-1166058365982-2:0) started
INFO  MasterConnector                - Slave connection between vm:// 
localhost#0 and tcp://localhost/127.0.0.1:61617 has been established.

Slave config is:

<beans>

   <!-- Allows us to use system properties as variables in this  
configuration file -->
   <bean  
class="org.springframework.beans.factory.config.PropertyPlaceholderConfi 
gurer"/>

   <broker brokerName="localhost" useJmx="true" xmlns="http:// 
activemq.org/config/1.0" masterConnectorURI="tcp://localhost:61617"  
shutdownOnMasterFailure="false">

     <persistenceAdapter>
         <journaledJDBC journalLogFiles="5" dataDirectory="$ 
{activemq.base}/activemq-data" dataSource="#postgres-ds"/>
     </persistenceAdapter>

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

   </broker>

   <!--  This xbean configuration file supports all the standard  
spring xml configuration options -->

<!-- Postgres DataSource Sample Setup -->
     <bean id="postgres-ds"  
class="org.postgresql.ds.PGPoolingDataSource">
         <property name="serverName" value="localhost"/>
         <property name="databaseName" value="amqslave"/>
         <property name="portNumber" value="0"/>
         <property name="user" value="activemq"/>
         <property name="password" value="activemq"/>
         <property name="dataSourceName" value="postgres"/>
         <property name="initialConnections" value="1"/>
         <property name="maxConnections" value="10"/>
     </bean>


</beans>



Re: 4.1 Master/Slave - Slave dies upon first conn to master

Posted by Marlon Santos <ms...@exist.com>.
Oh I see, 

Well let's just hope that this is fixed sooner.

Regards...



William Blackburn-2 wrote:
> 
> Our app processes about 80 messages/sec using journaled-jdbc but only  
> 4-10 per sec using jdbc only.
> 
> I really need to use master/slave for performance reasons, but If it  
> doesn't work, I guess I'm outta luck...
> 
> Just noticed the JIRA you raised BTW (AMQ-1079) -- sadly no one has  
> commented on it yet.
> 
> BJ
> 
> On Dec 13, 2006, at 5:54 PM, Marlon Santos wrote:
> 
>>
>> Hi,
>>
>> IMHO, it is better to use a shared database master slave config  
>> because you
>> were using a database data source (postgresql in this case) rather  
>> than a
>> pure master slave which was explicitly shown in your configuration.  
>> By the
>> way, I also have had problems running a pure master slave config as  
>> of the
>> present. (Maybe there was a bug with the pure master slave  
>> configurations,
>> *i think*)
>>
>> Regards...
>>
>>
>> William Blackburn-2 wrote:
>>>
>>> I can't seem to get master slave working in 4.1 -- I configured the
>>> master and slave according to the instructions on the site. They
>>> start up OK, and I can see from the logs that the slave attaches to
>>> the master. But, as soon as the first connection is made to the
>>> master, the slave dies. The master log looks like:
>>>
>>> INFO  DefaultDatabaseLocker          - Attempting to acquire the
>>> exclusive lock to become the Master broker
>>> INFO  DefaultDatabaseLocker          - Becoming the master on
>>> dataSource: org.postgresql.ds.PGPoolingDataSource@724f31
>>> INFO  JournalPersistenceAdapter      - Journal Recovery Started from:
>>> Active Journal: using 5 x 20.0 Megs at: /Users/wblackburn/
>>> activemq-4.1.0-master/activemq-data/journal
>>> INFO  JournalPersistenceAdapter      - Journal Recovered: 0 message
>>> (s) in transactions recovered.
>>> INFO  TransportServerThreadSupport   - Listening for connections at:
>>> tcp://fastgt.local:61617
>>> INFO  TransportConnector             - Connector openwire Started
>>> INFO  BrokerService                  - ActiveMQ JMS Message Broker
>>> (localhost, ID:fastgt.local-50799-1166058345810-1:0) started
>>> INFO  TransportConnection            - Slave Broker localhost is
>>> attached
>>> ERROR MasterBroker                   - Slave Failed
>>> java.lang.AssertionError: Unsupported Method
>>>          at org.apache.activemq.transport.TransportSupport.request
>>> (TransportSupport.java:71)
>>>          at org.apache.activemq.transport.TransportFilter.request
>>> (TransportFilter.java:88)
>>>          at org.apache.activemq.transport.TransportFilter.request
>>> (TransportFilter.java:88)
>>>          at org.apache.activemq.transport.MutexTransport.request
>>> (MutexTransport.java:49)
>>>          at  
>>> org.apache.activemq.broker.ft.MasterBroker.sendSyncToSlave
>>> (MasterBroker.java:363)
>>>          at org.apache.activemq.broker.ft.MasterBroker.sendToSlave
>>> (MasterBroker.java:345)
>>>          at org.apache.activemq.broker.ft.MasterBroker.acknowledge
>>> (MasterBroker.java:320)
>>>          at  
>>> org.apache.activemq.broker.MutableBrokerFilter.acknowledge
>>> (MutableBrokerFilter.java:88)
>>>          at
>>> org.apache.activemq.broker.TransportConnection.processMessageAck
>>> (TransportConnection.java:488)
>>>          at org.apache.activemq.command.MessageAck.visit
>>> (MessageAck.java:179)
>>>          at org.apache.activemq.broker.TransportConnection.service
>>> (TransportConnection.java:284)
>>>          at org.apache.activemq.broker.TransportConnection 
>>> $1.onCommand
>>> (TransportConnection.java:177)
>>>          at org.apache.activemq.transport.TransportFilter.onCommand
>>> (TransportFilter.java:65)
>>>          at
>>> org.apache.activemq.transport.WireFormatNegotiator.onCommand
>>> (WireFormatNegotiator.java:133)
>>>          at org.apache.activemq.transport.InactivityMonitor.onCommand
>>> (InactivityMonitor.java:122)
>>>          at org.apache.activemq.transport.TransportSupport.doConsume
>>> (TransportSupport.java:84)
>>>          at org.apache.activemq.transport.tcp.TcpTransport.run
>>> (TcpTransport.java:137)
>>>          at java.lang.Thread.run(Thread.java:613)
>>> ERROR MasterBroker                   - Slave Failed
>>>
>>> master config is:
>>>
>>> <!--
>>>      Licensed to the Apache Software Foundation (ASF) under one or  
>>> more
>>>      contributor license agreements.  See the NOTICE file distributed
>>> with
>>>      this work for additional information regarding copyright  
>>> ownership.
>>>      The ASF licenses this file to You under the Apache License,
>>> Version 2.0
>>>      (the "License"); you may not use this file except in compliance
>>> with
>>>      the License.  You may obtain a copy of the License at
>>>
>>>      http://www.apache.org/licenses/LICENSE-2.0
>>>
>>>      Unless required by applicable law or agreed to in writing,  
>>> software
>>>      distributed under the License is distributed on an "AS IS"  
>>> BASIS,
>>>      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>> implied.
>>>      See the License for the specific language governing  
>>> permissions and
>>>      limitations under the License.
>>> -->
>>> <!-- START SNIPPET: example -->
>>> <beans>
>>>
>>>    <!-- Allows us to use system properties as variables in this
>>> configuration file -->
>>>    <bean
>>> class="org.springframework.beans.factory.config.PropertyPlaceholderCo 
>>> nfi
>>> gurer"/>
>>>
>>>    <broker brokerName="localhost" useJmx="true" xmlns="http://
>>> activemq.org/config/1.0">
>>>
>>>      <persistenceAdapter>
>>>          <journaledJDBC journalLogFiles="5" dataDirectory="$
>>> {activemq.base}/activemq-data" dataSource="#postgres-ds"/>
>>>      </persistenceAdapter>
>>>
>>>      <transportConnectors>
>>>         <transportConnector name="openwire" uri="tcp://localhost:
>>> 61617"/>
>>>      </transportConnectors>
>>>
>>>    </broker>
>>>
>>>    <!--  This xbean configuration file supports all the standard
>>> spring xml configuration options -->
>>>
>>>    <!-- Postgres DataSource Sample Setup -->
>>>      <bean id="postgres-ds"
>>> class="org.postgresql.ds.PGPoolingDataSource">
>>>          <property name="serverName" value="localhost"/>
>>>          <property name="databaseName" value="activemq"/>
>>>          <property name="portNumber" value="0"/>
>>>          <property name="user" value="activemq"/>
>>>          <property name="password" value="activemq"/>
>>>          <property name="dataSourceName" value="postgres"/>
>>>          <property name="initialConnections" value="1"/>
>>>          <property name="maxConnections" value="10"/>
>>>      </bean>
>>>
>>> </beans>
>>>
>>>
>>>
>>> The slave log looks like:
>>>
>>> INFO  DefaultDatabaseLocker          - Attempting to acquire the
>>> exclusive lock to become the Master broker
>>> INFO  DefaultDatabaseLocker          - Becoming the master on
>>> dataSource: org.postgresql.ds.PGPoolingDataSource@bcd14a
>>> INFO  JournalPersistenceAdapter      - Journal Recovery Started from:
>>> Active Journal: using 5 x 20.0 Megs at: /Users/wblackburn/
>>> activemq-4.1.0-slave/activemq-data/journal
>>> INFO  JournalPersistenceAdapter      - Journal Recovered: 0 message
>>> (s) in transactions recovered.
>>> INFO  TransportServerThreadSupport   - Listening for connections at:
>>> tcp://fastgt.local:61618
>>> INFO  TransportConnector             - Connector openwire Started
>>> INFO  TransportConnector             - Connector vm://localhost  
>>> Started
>>> INFO  MasterConnector                - Starting a network connection
>>> between vm://localhost#0 and tcp://null:0 has been established.
>>> INFO  BrokerService                  - ActiveMQ JMS Message Broker
>>> (localhost, ID:fastgt.local-50808-1166058365982-2:0) started
>>> INFO  MasterConnector                - Slave connection between vm://
>>> localhost#0 and tcp://localhost/127.0.0.1:61617 has been established.
>>>
>>> Slave config is:
>>>
>>> <beans>
>>>
>>>    <!-- Allows us to use system properties as variables in this
>>> configuration file -->
>>>    <bean
>>> class="org.springframework.beans.factory.config.PropertyPlaceholderCo 
>>> nfi
>>> gurer"/>
>>>
>>>    <broker brokerName="localhost" useJmx="true" xmlns="http://
>>> activemq.org/config/1.0" masterConnectorURI="tcp://localhost:61617"
>>> shutdownOnMasterFailure="false">
>>>
>>>      <persistenceAdapter>
>>>          <journaledJDBC journalLogFiles="5" dataDirectory="$
>>> {activemq.base}/activemq-data" dataSource="#postgres-ds"/>
>>>      </persistenceAdapter>
>>>
>>>      <transportConnectors>
>>>         <transportConnector name="openwire" uri="tcp://localhost:
>>> 61618"/>
>>>      </transportConnectors>
>>>
>>>    </broker>
>>>
>>>    <!--  This xbean configuration file supports all the standard
>>> spring xml configuration options -->
>>>
>>> <!-- Postgres DataSource Sample Setup -->
>>>      <bean id="postgres-ds"
>>> class="org.postgresql.ds.PGPoolingDataSource">
>>>          <property name="serverName" value="localhost"/>
>>>          <property name="databaseName" value="amqslave"/>
>>>          <property name="portNumber" value="0"/>
>>>          <property name="user" value="activemq"/>
>>>          <property name="password" value="activemq"/>
>>>          <property name="dataSourceName" value="postgres"/>
>>>          <property name="initialConnections" value="1"/>
>>>          <property name="maxConnections" value="10"/>
>>>      </bean>
>>>
>>>
>>> </beans>
>>>
>>>
>>>
>>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/4.1-Master- 
>> Slave---Slave-dies-upon-first-conn-to-master-tf2817915.html#a7865521
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/4.1-Master-Slave---Slave-dies-upon-first-conn-to-master-tf2817915.html#a7865808
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: 4.1 Master/Slave - Slave dies upon first conn to master

Posted by William Blackburn <wj...@mac.com>.
Our app processes about 80 messages/sec using journaled-jdbc but only  
4-10 per sec using jdbc only.

I really need to use master/slave for performance reasons, but If it  
doesn't work, I guess I'm outta luck...

Just noticed the JIRA you raised BTW (AMQ-1079) -- sadly no one has  
commented on it yet.

BJ

On Dec 13, 2006, at 5:54 PM, Marlon Santos wrote:

>
> Hi,
>
> IMHO, it is better to use a shared database master slave config  
> because you
> were using a database data source (postgresql in this case) rather  
> than a
> pure master slave which was explicitly shown in your configuration.  
> By the
> way, I also have had problems running a pure master slave config as  
> of the
> present. (Maybe there was a bug with the pure master slave  
> configurations,
> *i think*)
>
> Regards...
>
>
> William Blackburn-2 wrote:
>>
>> I can't seem to get master slave working in 4.1 -- I configured the
>> master and slave according to the instructions on the site. They
>> start up OK, and I can see from the logs that the slave attaches to
>> the master. But, as soon as the first connection is made to the
>> master, the slave dies. The master log looks like:
>>
>> INFO  DefaultDatabaseLocker          - Attempting to acquire the
>> exclusive lock to become the Master broker
>> INFO  DefaultDatabaseLocker          - Becoming the master on
>> dataSource: org.postgresql.ds.PGPoolingDataSource@724f31
>> INFO  JournalPersistenceAdapter      - Journal Recovery Started from:
>> Active Journal: using 5 x 20.0 Megs at: /Users/wblackburn/
>> activemq-4.1.0-master/activemq-data/journal
>> INFO  JournalPersistenceAdapter      - Journal Recovered: 0 message
>> (s) in transactions recovered.
>> INFO  TransportServerThreadSupport   - Listening for connections at:
>> tcp://fastgt.local:61617
>> INFO  TransportConnector             - Connector openwire Started
>> INFO  BrokerService                  - ActiveMQ JMS Message Broker
>> (localhost, ID:fastgt.local-50799-1166058345810-1:0) started
>> INFO  TransportConnection            - Slave Broker localhost is
>> attached
>> ERROR MasterBroker                   - Slave Failed
>> java.lang.AssertionError: Unsupported Method
>>          at org.apache.activemq.transport.TransportSupport.request
>> (TransportSupport.java:71)
>>          at org.apache.activemq.transport.TransportFilter.request
>> (TransportFilter.java:88)
>>          at org.apache.activemq.transport.TransportFilter.request
>> (TransportFilter.java:88)
>>          at org.apache.activemq.transport.MutexTransport.request
>> (MutexTransport.java:49)
>>          at  
>> org.apache.activemq.broker.ft.MasterBroker.sendSyncToSlave
>> (MasterBroker.java:363)
>>          at org.apache.activemq.broker.ft.MasterBroker.sendToSlave
>> (MasterBroker.java:345)
>>          at org.apache.activemq.broker.ft.MasterBroker.acknowledge
>> (MasterBroker.java:320)
>>          at  
>> org.apache.activemq.broker.MutableBrokerFilter.acknowledge
>> (MutableBrokerFilter.java:88)
>>          at
>> org.apache.activemq.broker.TransportConnection.processMessageAck
>> (TransportConnection.java:488)
>>          at org.apache.activemq.command.MessageAck.visit
>> (MessageAck.java:179)
>>          at org.apache.activemq.broker.TransportConnection.service
>> (TransportConnection.java:284)
>>          at org.apache.activemq.broker.TransportConnection 
>> $1.onCommand
>> (TransportConnection.java:177)
>>          at org.apache.activemq.transport.TransportFilter.onCommand
>> (TransportFilter.java:65)
>>          at
>> org.apache.activemq.transport.WireFormatNegotiator.onCommand
>> (WireFormatNegotiator.java:133)
>>          at org.apache.activemq.transport.InactivityMonitor.onCommand
>> (InactivityMonitor.java:122)
>>          at org.apache.activemq.transport.TransportSupport.doConsume
>> (TransportSupport.java:84)
>>          at org.apache.activemq.transport.tcp.TcpTransport.run
>> (TcpTransport.java:137)
>>          at java.lang.Thread.run(Thread.java:613)
>> ERROR MasterBroker                   - Slave Failed
>>
>> master config is:
>>
>> <!--
>>      Licensed to the Apache Software Foundation (ASF) under one or  
>> more
>>      contributor license agreements.  See the NOTICE file distributed
>> with
>>      this work for additional information regarding copyright  
>> ownership.
>>      The ASF licenses this file to You under the Apache License,
>> Version 2.0
>>      (the "License"); you may not use this file except in compliance
>> with
>>      the License.  You may obtain a copy of the License at
>>
>>      http://www.apache.org/licenses/LICENSE-2.0
>>
>>      Unless required by applicable law or agreed to in writing,  
>> software
>>      distributed under the License is distributed on an "AS IS"  
>> BASIS,
>>      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> implied.
>>      See the License for the specific language governing  
>> permissions and
>>      limitations under the License.
>> -->
>> <!-- START SNIPPET: example -->
>> <beans>
>>
>>    <!-- Allows us to use system properties as variables in this
>> configuration file -->
>>    <bean
>> class="org.springframework.beans.factory.config.PropertyPlaceholderCo 
>> nfi
>> gurer"/>
>>
>>    <broker brokerName="localhost" useJmx="true" xmlns="http://
>> activemq.org/config/1.0">
>>
>>      <persistenceAdapter>
>>          <journaledJDBC journalLogFiles="5" dataDirectory="$
>> {activemq.base}/activemq-data" dataSource="#postgres-ds"/>
>>      </persistenceAdapter>
>>
>>      <transportConnectors>
>>         <transportConnector name="openwire" uri="tcp://localhost:
>> 61617"/>
>>      </transportConnectors>
>>
>>    </broker>
>>
>>    <!--  This xbean configuration file supports all the standard
>> spring xml configuration options -->
>>
>>    <!-- Postgres DataSource Sample Setup -->
>>      <bean id="postgres-ds"
>> class="org.postgresql.ds.PGPoolingDataSource">
>>          <property name="serverName" value="localhost"/>
>>          <property name="databaseName" value="activemq"/>
>>          <property name="portNumber" value="0"/>
>>          <property name="user" value="activemq"/>
>>          <property name="password" value="activemq"/>
>>          <property name="dataSourceName" value="postgres"/>
>>          <property name="initialConnections" value="1"/>
>>          <property name="maxConnections" value="10"/>
>>      </bean>
>>
>> </beans>
>>
>>
>>
>> The slave log looks like:
>>
>> INFO  DefaultDatabaseLocker          - Attempting to acquire the
>> exclusive lock to become the Master broker
>> INFO  DefaultDatabaseLocker          - Becoming the master on
>> dataSource: org.postgresql.ds.PGPoolingDataSource@bcd14a
>> INFO  JournalPersistenceAdapter      - Journal Recovery Started from:
>> Active Journal: using 5 x 20.0 Megs at: /Users/wblackburn/
>> activemq-4.1.0-slave/activemq-data/journal
>> INFO  JournalPersistenceAdapter      - Journal Recovered: 0 message
>> (s) in transactions recovered.
>> INFO  TransportServerThreadSupport   - Listening for connections at:
>> tcp://fastgt.local:61618
>> INFO  TransportConnector             - Connector openwire Started
>> INFO  TransportConnector             - Connector vm://localhost  
>> Started
>> INFO  MasterConnector                - Starting a network connection
>> between vm://localhost#0 and tcp://null:0 has been established.
>> INFO  BrokerService                  - ActiveMQ JMS Message Broker
>> (localhost, ID:fastgt.local-50808-1166058365982-2:0) started
>> INFO  MasterConnector                - Slave connection between vm://
>> localhost#0 and tcp://localhost/127.0.0.1:61617 has been established.
>>
>> Slave config is:
>>
>> <beans>
>>
>>    <!-- Allows us to use system properties as variables in this
>> configuration file -->
>>    <bean
>> class="org.springframework.beans.factory.config.PropertyPlaceholderCo 
>> nfi
>> gurer"/>
>>
>>    <broker brokerName="localhost" useJmx="true" xmlns="http://
>> activemq.org/config/1.0" masterConnectorURI="tcp://localhost:61617"
>> shutdownOnMasterFailure="false">
>>
>>      <persistenceAdapter>
>>          <journaledJDBC journalLogFiles="5" dataDirectory="$
>> {activemq.base}/activemq-data" dataSource="#postgres-ds"/>
>>      </persistenceAdapter>
>>
>>      <transportConnectors>
>>         <transportConnector name="openwire" uri="tcp://localhost:
>> 61618"/>
>>      </transportConnectors>
>>
>>    </broker>
>>
>>    <!--  This xbean configuration file supports all the standard
>> spring xml configuration options -->
>>
>> <!-- Postgres DataSource Sample Setup -->
>>      <bean id="postgres-ds"
>> class="org.postgresql.ds.PGPoolingDataSource">
>>          <property name="serverName" value="localhost"/>
>>          <property name="databaseName" value="amqslave"/>
>>          <property name="portNumber" value="0"/>
>>          <property name="user" value="activemq"/>
>>          <property name="password" value="activemq"/>
>>          <property name="dataSourceName" value="postgres"/>
>>          <property name="initialConnections" value="1"/>
>>          <property name="maxConnections" value="10"/>
>>      </bean>
>>
>>
>> </beans>
>>
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/4.1-Master- 
> Slave---Slave-dies-upon-first-conn-to-master-tf2817915.html#a7865521
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: 4.1 Master/Slave - Slave dies upon first conn to master

Posted by Marlon Santos <ms...@exist.com>.
Hi,

IMHO, it is better to use a shared database master slave config because you
were using a database data source (postgresql in this case) rather than a
pure master slave which was explicitly shown in your configuration. By the
way, I also have had problems running a pure master slave config as of the
present. (Maybe there was a bug with the pure master slave configurations,
*i think*)

Regards...


William Blackburn-2 wrote:
> 
> I can't seem to get master slave working in 4.1 -- I configured the  
> master and slave according to the instructions on the site. They  
> start up OK, and I can see from the logs that the slave attaches to  
> the master. But, as soon as the first connection is made to the  
> master, the slave dies. The master log looks like:
> 
> INFO  DefaultDatabaseLocker          - Attempting to acquire the  
> exclusive lock to become the Master broker
> INFO  DefaultDatabaseLocker          - Becoming the master on  
> dataSource: org.postgresql.ds.PGPoolingDataSource@724f31
> INFO  JournalPersistenceAdapter      - Journal Recovery Started from:  
> Active Journal: using 5 x 20.0 Megs at: /Users/wblackburn/ 
> activemq-4.1.0-master/activemq-data/journal
> INFO  JournalPersistenceAdapter      - Journal Recovered: 0 message 
> (s) in transactions recovered.
> INFO  TransportServerThreadSupport   - Listening for connections at:  
> tcp://fastgt.local:61617
> INFO  TransportConnector             - Connector openwire Started
> INFO  BrokerService                  - ActiveMQ JMS Message Broker  
> (localhost, ID:fastgt.local-50799-1166058345810-1:0) started
> INFO  TransportConnection            - Slave Broker localhost is  
> attached
> ERROR MasterBroker                   - Slave Failed
> java.lang.AssertionError: Unsupported Method
>          at org.apache.activemq.transport.TransportSupport.request 
> (TransportSupport.java:71)
>          at org.apache.activemq.transport.TransportFilter.request 
> (TransportFilter.java:88)
>          at org.apache.activemq.transport.TransportFilter.request 
> (TransportFilter.java:88)
>          at org.apache.activemq.transport.MutexTransport.request 
> (MutexTransport.java:49)
>          at org.apache.activemq.broker.ft.MasterBroker.sendSyncToSlave 
> (MasterBroker.java:363)
>          at org.apache.activemq.broker.ft.MasterBroker.sendToSlave 
> (MasterBroker.java:345)
>          at org.apache.activemq.broker.ft.MasterBroker.acknowledge 
> (MasterBroker.java:320)
>          at org.apache.activemq.broker.MutableBrokerFilter.acknowledge 
> (MutableBrokerFilter.java:88)
>          at  
> org.apache.activemq.broker.TransportConnection.processMessageAck 
> (TransportConnection.java:488)
>          at org.apache.activemq.command.MessageAck.visit 
> (MessageAck.java:179)
>          at org.apache.activemq.broker.TransportConnection.service 
> (TransportConnection.java:284)
>          at org.apache.activemq.broker.TransportConnection$1.onCommand 
> (TransportConnection.java:177)
>          at org.apache.activemq.transport.TransportFilter.onCommand 
> (TransportFilter.java:65)
>          at  
> org.apache.activemq.transport.WireFormatNegotiator.onCommand 
> (WireFormatNegotiator.java:133)
>          at org.apache.activemq.transport.InactivityMonitor.onCommand 
> (InactivityMonitor.java:122)
>          at org.apache.activemq.transport.TransportSupport.doConsume 
> (TransportSupport.java:84)
>          at org.apache.activemq.transport.tcp.TcpTransport.run 
> (TcpTransport.java:137)
>          at java.lang.Thread.run(Thread.java:613)
> ERROR MasterBroker                   - Slave Failed
> 
> master config is:
> 
> <!--
>      Licensed to the Apache Software Foundation (ASF) under one or more
>      contributor license agreements.  See the NOTICE file distributed  
> with
>      this work for additional information regarding copyright ownership.
>      The ASF licenses this file to You under the Apache License,  
> Version 2.0
>      (the "License"); you may not use this file except in compliance  
> with
>      the License.  You may obtain a copy of the License at
> 
>      http://www.apache.org/licenses/LICENSE-2.0
> 
>      Unless required by applicable law or agreed to in writing, software
>      distributed under the License is distributed on an "AS IS" BASIS,
>      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or  
> implied.
>      See the License for the specific language governing permissions and
>      limitations under the License.
> -->
> <!-- START SNIPPET: example -->
> <beans>
> 
>    <!-- Allows us to use system properties as variables in this  
> configuration file -->
>    <bean  
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfi 
> gurer"/>
> 
>    <broker brokerName="localhost" useJmx="true" xmlns="http:// 
> activemq.org/config/1.0">
> 
>      <persistenceAdapter>
>          <journaledJDBC journalLogFiles="5" dataDirectory="$ 
> {activemq.base}/activemq-data" dataSource="#postgres-ds"/>
>      </persistenceAdapter>
> 
>      <transportConnectors>
>         <transportConnector name="openwire" uri="tcp://localhost: 
> 61617"/>
>      </transportConnectors>
> 
>    </broker>
> 
>    <!--  This xbean configuration file supports all the standard  
> spring xml configuration options -->
> 
>    <!-- Postgres DataSource Sample Setup -->
>      <bean id="postgres-ds"  
> class="org.postgresql.ds.PGPoolingDataSource">
>          <property name="serverName" value="localhost"/>
>          <property name="databaseName" value="activemq"/>
>          <property name="portNumber" value="0"/>
>          <property name="user" value="activemq"/>
>          <property name="password" value="activemq"/>
>          <property name="dataSourceName" value="postgres"/>
>          <property name="initialConnections" value="1"/>
>          <property name="maxConnections" value="10"/>
>      </bean>
> 
> </beans>
> 
> 
> 
> The slave log looks like:
> 
> INFO  DefaultDatabaseLocker          - Attempting to acquire the  
> exclusive lock to become the Master broker
> INFO  DefaultDatabaseLocker          - Becoming the master on  
> dataSource: org.postgresql.ds.PGPoolingDataSource@bcd14a
> INFO  JournalPersistenceAdapter      - Journal Recovery Started from:  
> Active Journal: using 5 x 20.0 Megs at: /Users/wblackburn/ 
> activemq-4.1.0-slave/activemq-data/journal
> INFO  JournalPersistenceAdapter      - Journal Recovered: 0 message 
> (s) in transactions recovered.
> INFO  TransportServerThreadSupport   - Listening for connections at:  
> tcp://fastgt.local:61618
> INFO  TransportConnector             - Connector openwire Started
> INFO  TransportConnector             - Connector vm://localhost Started
> INFO  MasterConnector                - Starting a network connection  
> between vm://localhost#0 and tcp://null:0 has been established.
> INFO  BrokerService                  - ActiveMQ JMS Message Broker  
> (localhost, ID:fastgt.local-50808-1166058365982-2:0) started
> INFO  MasterConnector                - Slave connection between vm:// 
> localhost#0 and tcp://localhost/127.0.0.1:61617 has been established.
> 
> Slave config is:
> 
> <beans>
> 
>    <!-- Allows us to use system properties as variables in this  
> configuration file -->
>    <bean  
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfi 
> gurer"/>
> 
>    <broker brokerName="localhost" useJmx="true" xmlns="http:// 
> activemq.org/config/1.0" masterConnectorURI="tcp://localhost:61617"  
> shutdownOnMasterFailure="false">
> 
>      <persistenceAdapter>
>          <journaledJDBC journalLogFiles="5" dataDirectory="$ 
> {activemq.base}/activemq-data" dataSource="#postgres-ds"/>
>      </persistenceAdapter>
> 
>      <transportConnectors>
>         <transportConnector name="openwire" uri="tcp://localhost: 
> 61618"/>
>      </transportConnectors>
> 
>    </broker>
> 
>    <!--  This xbean configuration file supports all the standard  
> spring xml configuration options -->
> 
> <!-- Postgres DataSource Sample Setup -->
>      <bean id="postgres-ds"  
> class="org.postgresql.ds.PGPoolingDataSource">
>          <property name="serverName" value="localhost"/>
>          <property name="databaseName" value="amqslave"/>
>          <property name="portNumber" value="0"/>
>          <property name="user" value="activemq"/>
>          <property name="password" value="activemq"/>
>          <property name="dataSourceName" value="postgres"/>
>          <property name="initialConnections" value="1"/>
>          <property name="maxConnections" value="10"/>
>      </bean>
> 
> 
> </beans>
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/4.1-Master-Slave---Slave-dies-upon-first-conn-to-master-tf2817915.html#a7865521
Sent from the ActiveMQ - User mailing list archive at Nabble.com.