Running 2 JBossAS 7 HA on Same Machine - Only Finds 1 AS in Cluster During War Deployment
mprk Feb 15, 2012 11:18 PMI've tried configuring two JBossAS 7 instances on the same machine to run in HA mode. When I deploy the war file, which contains the distributable tag in web.xml, it will only deploy to the main instance. It will not auto deploy it on the other instance. If anyone has any ideas why it's not starting, it would be greatly appreciated.
I created two copies of JBossAS 7.1.0 CR in seperate directories on a Windows 7 Home Premium SP 1 system. I'm running jdk1.6.0_23.
I created one .bat file to launch both to looks like the following:
============= jboss.bat ==================
SET JBOSS_HOME=C:\Projects\cluster\jboss1
start %JBOSS_HOME%\bin\standalone.bat -Dworking.directory=%JBOSS_HOME%\bin --server-config standalone-ha.xml
SET JBOSS_HOME=C:\Projects\cluster\jboss2
start %JBOSS_HOME%\bin\standalone.bat -Dworking.directory=%JBOSS_HOME%\bin --server-config standalone-ha.xml -Djboss.socket.binding.port-offset=100
========================================
They both seem to come up fine. There is no firewall running on the machine. After I deploy the war file, the main console looks like the following:
=============== jboss1 =====================
Calling "C:\Projects\cluster\jboss1\bin\standalone.conf.bat"
===============================================================================
JBoss Bootstrap Environment
JBOSS_HOME: C:\Projects\cluster\jboss1
JAVA: C:\Programs\Java\jdk1.6.0_23\bin\java
JAVA_OPTS: -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.resolver.warning=true -Djboss.modules.system.pkgs=org.jboss.byteman -server
===============================================================================
23:11:59,741 INFO [org.jboss.modules] JBoss Modules version 1.1.0.CR6
23:12:00,115 INFO [org.jboss.msc] JBoss MSC version 1.0.1.GA
23:12:00,181 INFO [org.jboss.as] JBoss AS 7.1.0.CR1b "Flux Capacitor" starting
23:12:01,780 INFO [org.jboss.as] Creating http management service using socket-binding (management-http)
23:12:01,780 INFO [org.xnio] XNIO Version 3.0.0.CR7
23:12:01,795 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.0.CR7
23:12:01,808 INFO [org.jboss.remoting] JBoss Remoting version 3.2.0.CR8
23:12:01,827 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
23:12:01,833 INFO [org.jboss.as.jacorb] (ServerService Thread Pool -- 34) Activating JacORB Subsystem
23:12:01,854 INFO [org.jboss.as.clustering] (ServerService Thread Pool -- 38) JBAS010360: Activating JGroups subsystem.
23:12:01,867 INFO [org.jboss.as.connector] (MSC service thread 1-10) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.6.Final)
23:12:01,861 INFO [org.jboss.as.clustering] (ServerService Thread Pool -- 33) JBAS010300: Activating Infinispan subsystem.
23:12:01,909 INFO [org.jboss.as.security] (ServerService Thread Pool -- 50) Activating Security Subsystem
23:12:01,938 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 54) JBAS015537: Activating WebServices Extension
23:12:01,939 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 45) JBAS011910: Activating OSGi Subsystem
23:12:01,944 INFO [org.jboss.as.security] (MSC service thread 1-8) Picketbox version=4.0.6.Beta2
23:12:01,992 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 44) JBAS011800: Activating Naming Subsystem
23:12:02,209 INFO [org.jboss.as.naming] (MSC service thread 1-13) JBAS011802: Starting Naming Service
23:12:02,225 WARN [org.jboss.as.messaging] (MSC service thread 1-14) JBAS011600: AIO wasn't located on this platform, it will fall back to using pure Java NIO. If your platform is Linux, install LibAIO to enable the AIO journal
23:12:02,267 INFO [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default]
23:12:02,273 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 29) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
23:12:02,377 INFO [org.jboss.as.remoting] (MSC service thread 1-5) Listening on /127.0.0.1:4447
23:12:02,765 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.0.GA
23:12:03,189 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-9) live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=C:\Projects\solr-cluster\jboss1\standalone\data\messagingjournal,bindingsDirector
y=C:\Projects\solr-cluster\jboss1\standalone\data\messagingbindings,largeMessagesDirectory=C:\Projects\solr-cluster\jboss1\standalone\data\messaginglargemessages,pagingDirectory=C:\Projects\solr-cluster\jboss1\standalone\data\messagingpaging)
23:12:03,364 WARNING [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-9) Security risk! It has been detected that the cluster admin user and password have not been changed from the installation default. Please see the HornetQ user guide, cluster chapter, for instructions on how to
do this.
23:12:03,738 INFO [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-10) Starting Coyote HTTP/1.1 on http-127.0.0.1-127.0.0.1-8080
23:12:03,789 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-11) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
23:12:03,840 INFO [org.hornetq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-9) Started Netty Acceptor version 3.2.3.Final-r${buildNumber} 127.0.0.1:5445 for CORE protocol
23:12:03,806 WARN [jacorb.codeset] (MSC service thread 1-7) Warning - unknown codeset (Cp1252) - defaulting to ISO-8859-1
23:12:03,871 INFO [org.hornetq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-9) Started Netty Acceptor version 3.2.3.Final-r${buildNumber} 127.0.0.1:5455 for CORE protocol
23:12:03,790 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-4) JBAS010406: Registered connection factory java:/JmsXA
23:12:03,891 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-9) Server is now live
23:12:03,882 INFO [org.jboss.as.jacorb] (MSC service thread 1-7) CORBA ORB Service Started
23:12:03,963 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-9) HornetQ Server version 2.2.7.Final (HQ_2_2_7_FINAL_AS7, 121) [7f7cb688-5846-11e1-88f6-ac8112253161] started
23:12:03,950 INFO [org.jboss.as.remoting] (MSC service thread 1-8) Listening on /127.0.0.1:9999
23:12:03,946 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-16) JBAS015012: Started FileSystemDeploymentService for directory C:\Projects\solr-cluster\jboss1\standalone\deployments
23:12:03,944 INFO [org.hornetq.ra.HornetQResourceAdapter] (MSC service thread 1-4) HornetQ resource adaptor started
23:12:03,984 INFO [org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-4) IJ020002: Deployed: file://RaActivatorhornetq-ra
23:12:03,995 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-16) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]
23:12:04,096 INFO [org.jboss.as.modcluster] (MSC service thread 1-3) JBAS011704: Mod_cluster uses default load balancer provider
23:12:04,118 INFO [org.jboss.as.jacorb] (MSC service thread 1-5) CORBA Naming Service Started
23:12:04,132 INFO [org.jboss.modcluster.ModClusterService] (MSC service thread 1-3) Initializing mod_cluster 1.2.0.Beta2
23:12:04,146 INFO [org.jboss.as.messaging] (MSC service thread 1-8) JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory
23:12:04,147 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-1) trying to deploy queue jms.topic.testTopic
23:12:04,180 INFO [org.jboss.modcluster.advertise.impl.AdvertiseListenerImpl] (MSC service thread 1-3) Listening to proxy advertisements on 224.0.1.105:23364
23:12:04,223 INFO [org.jboss.as.messaging] (MSC service thread 1-1) JBAS011601: Bound messaging object to jndi name java:/topic/test
23:12:04,224 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-2) trying to deploy queue jms.queue.testQueue
23:12:04,242 INFO [org.jboss.as.messaging] (MSC service thread 1-2) JBAS011601: Bound messaging object to jndi name java:/queue/test
23:12:04,243 INFO [org.jboss.as.messaging] (MSC service thread 1-11) JBAS011601: Bound messaging object to jndi name java:/RemoteConnectionFactory
23:12:04,274 INFO [org.jboss.as.server.deployment] (MSC service thread 1-10) Starting deployment of "webtest.war"
23:12:05,106 WARNING [org.jgroups.protocols.UDP] (MSC service thread 1-14) failed to join /ff0e:0:0:0:0:0:e000:4b4b:7500 on net5: java.net.SocketException: error setting options
23:12:05,109 INFO [stdout] (MSC service thread 1-14)
23:12:05,110 INFO [stdout] (MSC service thread 1-14) -------------------------------------------------------------------
23:12:05,110 INFO [stdout] (MSC service thread 1-14) GMS: address=viper/web, cluster=web, physical address=127.0.0.1:55200
23:12:05,110 INFO [stdout] (MSC service thread 1-14) -------------------------------------------------------------------
23:12:07,147 INFO [org.jboss.as.clustering.CoreGroupCommunicationService.web] (MSC service thread 1-6) JBAS010207: Number of cluster members: 1
23:12:07,463 WARN [org.infinispan.config.ConfigurationValidatingVisitor] (MSC service thread 1-2) ISPN000152: Passivation configured without a valid eviction policy. This could mean that the cache store will never get used unless code calls Cache.evict() manually.
23:12:07,595 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-2) ISPN000078: Starting JGroups Channel
23:12:07,597 WARNING [org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher] (MSC service thread 1-2) Channel Muxer already has a default up handler installed (org.jboss.as.clustering.jgroups.ClassLoaderAwareUpHandler@4e411379) but now it is being overridden
23:12:07,598 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-2) ISPN000094: Received new cluster view: [viper/web|0] [viper/web]
23:12:07,599 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-2) ISPN000079: Cache local address is viper/web, physical addresses are [127.0.0.1:55200]
23:12:07,602 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-2) ISPN000128: Infinispan version: Infinispan 'Brahma' 5.1.0.CR1
23:12:07,686 INFO [org.infinispan.jmx.CacheJmxRegistration] (MSC service thread 1-5) ISPN000031: MBeans were successfully registered to the platform mbean server.
23:12:07,715 INFO [org.infinispan.jmx.CacheJmxRegistration] (MSC service thread 1-2) ISPN000031: MBeans were successfully registered to the platform mbean server.
23:12:07,732 INFO [org.jboss.as.clustering] (MSC service thread 1-5) JBAS010301: Started registry cache from web container
23:12:07,732 INFO [org.jboss.as.clustering] (MSC service thread 1-2) JBAS010301: Started repl cache from web container
23:12:07,881 INFO [org.jboss.web] (MSC service thread 1-4) registering web context: /webtest
23:12:07,889 INFO [org.jboss.as] (MSC service thread 1-4) JBoss AS 7.1.0.CR1b "Flux Capacitor" started in 8370ms - Started 190 of 302 services (107 services are passive or on-demand)
23:12:07,944 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "webtest.war"
=======================================================================
Here is the web.xml from the war file. The war file contains only one jsp for testing.
================== web.xml =======================
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<distributable/>
<display-name>Distributable WAR File Test</display-name>
<description>
Used to test JBossAS 7 HA services.
</description>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
===================================================