[JON] Attempting to add a new JBoss AS instance using a different JNP port results in "A JBossAS Server with the specified connection properties was already in inventory"
Environment
- JBoss Operations Network (JON) 2.4.1
- JBoss Application Server (AS) 5
- JBoss Enterprise Application Platform (EAP) 5
-
EAP Plug-In Pack for JON
-
JBoss Application Server (AS) 5 plug-in for JON - jopr-jboss-as-5-plugin
- The JBoss AS server that is not being discovered or added to inventory uses the same value for
jboss.server.home.dir
as one that is already in JON inventory
Issue
- Attempting to add a new JBoss Enterprise Application Platform (EAP) server instance using a different JNP port results in "A JBossAS Server with the specified connection properties was already in inventory"
- JBoss Application Server (AS) server which uses the same configuration but different ports as a server already in inventory is not being discovered
- When manually adding a JBoss AS instance the following message is received: A JBossAS Server with the specified connection properties was already in inventory.
Resolution
Start the additional JBoss AS instance using a different jboss.server.home.dir
. If two JBoss server instances share the same profile or base profile, symbolic links can be used to present the two shared instances as two separate instances for JON. For example:
cd "${JBOSS_HOME}"/server
ln -s default serverOne
ln -s default serverTwo
cd "${JBOSS_HOME}"/bin
./run.sh -c serverOne -b 0.0.0.0 -Djboss.service.binding.set=ports-01 -Djboss.server.data.dir=/date/serverOne/data -Djboss.server.log.dir=/date/serverOne/logs -Djboss.server.temp.dir=/date/serverOne/tmp ... &
./run.sh -c serverTwo -b 0.0.0.0 -Djboss.service.binding.set=ports-02 -Djboss.server.data.dir=/date/serverTwo/data -Djboss.server.log.dir=/date/serverTwo/logs -Djboss.server.temp.dir=/date/serverTwo/tmp ... &
Root Cause
The resourceKey
used for a JBoss AS server resource is created based on the full path to the server's profile. For example, if running the default profile, the resourceKey
may look like /opt/jboss/eap/jboss-eap-5.1/jboss-as/server/default
. When the second server which shares this same profile is started, it will receive the same resourceKey
even though its configuration is different then the one already in inventory. Although the newly started JBoss AS instance is seen as a separate instance, the inventory management system rejects it because it appears to already exist.
Diagnostic Steps
- Obtain a debug log from the JON agent during the time a discovery or manual import was being attempted
- Obtain the process ID (PID) for the JBoss AS instance that should have been discovered or imported
- Review the debug log for the following messages:
-
DEBUG [ResourceDiscoveryComponent.invoker.daemon-447] (rhq.plugins.jbossas5.helper.JBossInstanceInfo)- jboss.home.dir="/case_00444978/tools/jboss5/central/ver_eap5.1.0/jboss-eap-5.1/jboss-as" DEBUG [ResourceDiscoveryComponent.invoker.daemon-447] (rhq.plugins.jbossas5.helper.JBossInstanceInfo)- jboss.server.home.dir="/opt/jboss/eap/jboss-eap-5.1/jboss-as/server/default/" DEBUG [ResourceDiscoveryComponent.invoker.daemon-447] (rhq.plugins.jbossas5.helper.JBossInstanceInfo)- jboss.server.name="serverOne" DEBUG [ResourceDiscoveryComponent.invoker.daemon-447] (rhq.plugins.jbossas5.helper.JBossInstanceInfo)- jboss.bind.address="0.0.0.0"
- Attempt to isolate the two (or more) JBoss AS instances that share the same jboss.server.home.dir.
- This path can also be seen in existing JBoss AS server resources in inventory by looking at resourceKey under JBoss AS resource -> Inventory -> Overview
-
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments