Bug 807008 - [as7] potentially non-unique Resource keys used for both standalone and domain AS7 servers
[as7] potentially non-unique Resource keys used for both standalone and domai...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
4.3
Unspecified Unspecified
unspecified Severity urgent (vote)
: ---
: JON 3.1.0
Assigned To: Libor Zoubek
Mike Foley
:
Depends On:
Blocks: as7-plugin
  Show dependency treegraph
 
Reported: 2012-03-26 14:33 EDT by Ian Springer
Modified: 2015-11-01 19:42 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-03 11:17:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ian Springer 2012-03-26 14:33:26 EDT
Similar to earlier versions of AS, it's possible to run multiple standalone AS7 servers out of the same JBOSS_HOME dir (see https://issues.jboss.org/browse/AS7-1752). So we should be using the canonical path of the server "base dir" (e.g. /opt/jboss-as-7.1.1.Final/standalone2), rather than the JBOSS_HOME dir, as the Resource key.

Similarly, for domain AS7 servers (i.e. host controllers), it's possible to run multiple instances on the same box, either out of the same JBOSS_HOME dir, or out of different JBOSS_HOME dirs. In either case, we cannot use a constant value of "HostController" or "DomainController" as we currently do. Instead we should probably use the server "base dir" (e.g. /opt/jboss-as-7.1.1.Final/domain2), just as I proposed for standalone instances.
Comment 1 Ian Springer 2012-03-27 17:15:19 EDT
Fixed in master:

http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commit;h=4600e41

Here is output from the Agent prompt discovery command that demonstrates the new keys:

jboss-as-7.JBossAS7 Host Controller: Starting discovery...
jboss-as-7.JBossAS7 Host Controller: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.as.host-controller|match=.*], name=[HostController]], process=[process: pid=[21838], name=[/usr/java/jdk1.6.0_30/bin/java], ppid=[21817]]
jboss-as-7.JBossAS7 Host Controller: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.as.host-controller|match=.*], name=[HostController]], process=[process: pid=[21121], name=[/usr/java/jdk1.6.0_30/bin/java], ppid=[21100]]
jboss-as-7.JBossAS7 Host Controller: key=[/home/ips/Applications/jboss-as-7.1.1.Final/domain1], name=[domain1 JBoss AS 7 Domain Controller], version=[7.1.1.Final], description=[Domain controller for a JBoss Application Server 7 domain]
jboss-as-7.JBossAS7 Host Controller: key=[/home/ips/Applications/jboss-as-7.1.1.Final/domain2], name=[domain2 JBoss AS 7 Domain Controller], version=[7.1.1.Final], description=[Domain controller for a JBoss Application Server 7 domain]
jboss-as-7.JBossAS7 Host Controller: Done.

jboss-as-7.JBossAS7 Standalone Server: Starting discovery...
jboss-as-7.JBossAS7 Standalone Server: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.as.standalone|match=.*], name=[StandaloneAS]], process=[process: pid=[22346], name=[/usr/java/jdk1.6.0_30/bin/java], ppid=[22221]]
jboss-as-7.JBossAS7 Standalone Server: Process scan detected a server - scan=[ProcessScan: query=[process|basename|match=^java.*,arg|org.jboss.as.standalone|match=.*], name=[StandaloneAS]], process=[process: pid=[22345], name=[/usr/java/jdk1.6.0_30/bin/java], ppid=[22218]]
jboss-as-7.JBossAS7 Standalone Server: key=[/home/ips/Applications/jboss-as-7.1.1.Final/standalone2], name=[AS7 jetengine], version=[AS7 7.1.1.Final], description=[Standalone JBoss Application Server 7 server]
jboss-as-7.JBossAS7 Standalone Server: key=[/home/ips/Applications/jboss-as-7.1.1.Final/standalone1], name=[AS7 jetengine], version=[AS7 7.1.1.Final], description=[Standalone JBoss Application Server 7 server]
jboss-as-7.JBossAS7 Standalone Server: Done.


To QA this, the jboss-as-spawn.sh script, in RHQ git under etc/scripts/, can be used to spawn multiple AS instances on the same box.
Comment 2 Ian Springer 2012-03-27 17:24:39 EDT
I am actually going to reopen this, since I forgot to support relative paths for the values of the various jboss.*.dir System properties, e.g.:

-Djboss.server.base.dir=standalone2

standalone2 is a relative path and should get resolved as follows:

File baseDir = new File(homeDir, "standalone2");

We'll need to support relative paths for the following sysprops:

jboss.home.dir
jboss.server.base.dir
jboss.server.config.dir
jboss.domain.base.dir
jboss.domain.config.dir
org.jboss.boot.log.file

The base path used to resolve the relative paths will vary depending on the sysprop.
Comment 3 Ian Springer 2012-03-28 15:03:40 EDT
jboss.*.dir sysprops set to relative paths are now resolved the same way AS7 itself resolves them:

jboss.home.dir - resolved relative to cwd

jboss.server.base.dir, jboss.domain.base.dir - resolved relative to cwd, if that fails, resolved relative to jboss.home.dir

jboss.server.config.dir, jboss.domain.config.dir, jboss.server.log.dir, jboss.domain.log.dir - resolved relative to cwd

(master http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=1c3f8bc)
Comment 5 Heiko W. Rupp 2013-09-03 11:17:34 EDT
Bulk closing of old issues in VERIFIED state.

Note You need to log in before you can comment on or make changes to this bug.