1 Reply Latest reply on Feb 21, 2019 7:32 AM by ehugonnet

    ActiveMQ cluster setup on WildFly 13

    sergiu_pienar

      I'm trying to run an app on 2 WildFly13 instances, one which should be the master and the other the slave (backup).

      I'm hitting a problem with the messaging subsystem when starting the second server.

       

      The messaging subsystem for the full-ha-master profile:

       

      <subsystem xmlns="urn:jboss:domain:messaging-activemq:3.0">

                      <server name="default">

                          <security elytron-domain="messagingDomain"/>

                          <cluster password="${jboss.messaging.cluster.password:mypassword}"/>

                          <shared-store-master failover-on-server-shutdown="true"/>

        

                          <bindings-directory path="/opt/nfsmount/artemisShared/journal/bindings"/>

                          <journal-directory path="/opt/nfsmount/artemisShared/journal/journal"/>

                          <large-messages-directory path="/opt/nfsmount/artemisShared/journal/largemessages"/>

                          <paging-directory path="/opt/nfsmount/artemisShared/journal/paging"/>

                ... jms queues ...

                          <remote-connector name="netty" socket-binding="messaging"/>

                           <remote-connector name="netty-throughput" socket-binding="messaging-throughput">

                                    <param name="batch-delay" value="50"/>

                          </remote-connector>

                          <in-vm-connector name="in-vm" server-id="0"/>

                          <remote-acceptor name="netty" socket-binding="messaging"/>

                          <remote-acceptor name="netty-throughput" socket-binding="messaging-throughput">

                                <param name="batch-delay" value="50"/>

                               <param name="direct-deliver" value="false"/>

                          </remote-acceptor>

       

       

       

                          <broadcast-group name="bg-group1" jgroups-cluster="activemq-cluster" connectors="netty"/>

                          <discovery-group name="dg-group1" jgroups-cluster="activemq-cluster"/>

                          <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>

                          <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="netty" ha="true" block-on-acknowledge="true" reconnect-attempts="-1"/>

                          <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>

       

       

      The same configuration goes for the full-ha-slave profile which is assigned to the backup-server-group.

      The backup server starts with:

       

      [Server:backup-server-one] 07:21:17,501 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 76) AMQ221000: backup Message Broker is starting with configuration Broker Configuration (clustered=true,journalDirectory=/opt/nfsmount/artemisShared/journal/journal,bindingsDirectory=/opt/nfsmount/artemisShared/journal/bindings,largeMessagesDirectory=/opt/nfsmount/artemisShared/journal/largemessages,pagingDirectory=/opt/nfsmount/artemisShared/journal/paging)

      [Server:backup-server-one] 07:21:17,510 INFO  [org.apache.activemq.artemis.core.server] (AMQ119000: Activation for server ActiveMQServerImpl::serverUUID=333a5841-34d9-11e9-8f2c-0050568754bd) AMQ221032: Waiting to become backup node

      [Server:backup-server-one] 07:21:17,526 INFO  [org.apache.activemq.artemis.core.server] (AMQ119000: Activation for server ActiveMQServerImpl::serverUUID=333a5841-34d9-11e9-8f2c-0050568754bd) AMQ221033: ** got backup lock

      [Server:backup-server-one] 07:21:17,564 INFO  [org.apache.activemq.artemis.core.server] (AMQ119000: Activation for server ActiveMQServerImpl::serverUUID=333a5841-34d9-11e9-8f2c-0050568754bd) AMQ221012: Using AIO Journal

      [Server:backup-server-one] 07:21:17,739 INFO  [org.apache.activemq.artemis.core.server] (AMQ119000: Activation for server ActiveMQServerImpl::serverUUID=333a5841-34d9-11e9-8f2c-0050568754bd) AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE

      [Server:backup-server-one] 07:21:17,743 INFO  [org.apache.activemq.artemis.core.server] (AMQ119000: Activation for server ActiveMQServerImpl::serverUUID=333a5841-34d9-11e9-8f2c-0050568754bd) AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP

      [Server:backup-server-one] 07:21:17,745 INFO  [org.apache.activemq.artemis.core.server] (AMQ119000: Activation for server ActiveMQServerImpl::serverUUID=333a5841-34d9-11e9-8f2c-0050568754bd) AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ

      [Server:backup-server-one] 07:21:17,748 INFO  [org.apache.activemq.artemis.core.server] (AMQ119000: Activation for server ActiveMQServerImpl::serverUUID=333a5841-34d9-11e9-8f2c-0050568754bd) AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP

      [Server:backup-server-one] 07:21:17,790 INFO  [org.apache.activemq.artemis.core.server] (AMQ119000: Activation for server ActiveMQServerImpl::serverUUID=333a5841-34d9-11e9-8f2c-0050568754bd) AMQ221109: Apache ActiveMQ Artemis Backup Server version 1.5.5.jbossorg-012 [333a5841-34d9-11e9-8f2c-0050568754bd] started, waiting live to fail before it gets active

       

      which I assume is fine.


      On the main server I can see also that at this step the queues and topics are deployed and the connection factories registered.

       

      The problem is that the app has MDBs and other JMS components that use the DefaultJMSConnectionFactory, which I see is not deployed on the backup server - since I think it is assumed that these will be deployed only when and if the live server fails.

      While the app is trying to deploy it can not find this connection factory and crashes with:

       

      [Server:backup-server-one] 07:23:09,062 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 6) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "my-all-5.0.0.0.ear")]) - failure description: {

      [Server:backup-server-one]     "WFLYCTL0412: Required services that are not installed:" => [

      [Server:backup-server-one]         "jboss.ra.activemq-ra",

      [Server:backup-server-one]         "jboss.naming.context.java.jboss.DefaultJMSConnectionFactory"

       

      Is there something I'm getting wrong on how to configure a WildFly clustered with shared activemq storage ?