Bug 807008

Summary: [as7] potentially non-unique Resource keys used for both standalone and domain AS7 servers
Product: [Other] RHQ Project Reporter: Ian Springer <ian.springer>
Component: PluginsAssignee: Libor Zoubek <lzoubek>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 4.3CC: ccrouch, hrupp, theute
Target Milestone: ---   
Target Release: JON 3.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-03 15:17:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 707223    

Description Ian Springer 2012-03-26 18:33:26 UTC
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 21:15:19 UTC
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 21:24:39 UTC
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 19:03:40 UTC
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 15:17:34 UTC
Bulk closing of old issues in VERIFIED state.