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: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
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>