Bug 807008 - [as7] potentially non-unique Resource keys used for both standalone and domain AS7 servers
Summary: [as7] potentially non-unique Resource keys used for both standalone and domai...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.3
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: JON 3.1.0
Assignee: Libor Zoubek
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: as7-plugin
TreeView+ depends on / blocked
 
Reported: 2012-03-26 18:33 UTC by Ian Springer
Modified: 2018-11-28 20:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-03 15:17:34 UTC
Embargoed:


Attachments (Terms of Use)

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.


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