Bug 1022573

Summary: agent needs to be told what the server's endpoint is when rhqctl installs it
Product: [Other] RHQ Project Reporter: John Mazzitelli <mazz>
Component: Agent, InstallerAssignee: John Mazzitelli <mazz>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: high    
Version: 4.9CC: hrupp
Target Milestone: ---   
Target Release: RHQ 4.10   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1022710 (view as bug list) Environment:
Last Closed: 2014-04-23 12:31:47 UTC Type: Bug
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: 1022710    

Description John Mazzitelli 2013-10-23 14:46:57 UTC
The server no longer listens to 0.0.0.0 by default when you install it. You have to pick an IP address that the server will bind to (jboss.bind.address).

When you install the agent, we don't set explicitly the server address - we rely on the agent to use its default. This is one of two things - its either the IP from a DNS lookup of "rhqserver" alias, and if that is not found, it uses Java to look up the local hostname of the agent.

Usually, this is OK, unless you pick a server bind address that is different from what Java will pick up as the default hostname. If they are different, then the agent will fail to connect to the server.

Here is how I replicate this.

Build master - do not build a dev container, but just a production build (go in modules/enterprise/server/appserver and "mvn clean install").

From that build, run "rhqctl install --start" and when it prompts you, give it a jboss.bind.address of 127.0.0.1.

The agent will not be able to connect. That's because it will attempt to talk to the server on your hostname's non-loopback address (usually). On my box, it tries 192.168.x.x IP. But the server is not listening on that IP, its listening on 127.0.0.1 as I told it to.

The agent will therefore never be able to connect.

This is bad. Unless you are lucky and have a single network adapter with a single IP or Java happens to pick the IP that you pick, the agent won't be able to connect. The workaround is to set "rhqserver" alias in /etc/hosts so the agent can pick up the IP you want it to.

Comment 1 John Mazzitelli 2013-10-23 20:13:54 UTC
git commit to master: 92f4f9c

Comment 2 Heiko W. Rupp 2013-10-24 10:41:27 UTC
I think this should be extended to the agent port as well - in case that the user has set a different http port in the rhq-server.properties before running rhqctl install.

Comment 3 John Mazzitelli 2013-10-24 11:45:31 UTC
(In reply to Heiko W. Rupp from comment #2)
> I think this should be extended to the agent port as well - in case that the
> user has set a different http port in the rhq-server.properties before
> running rhqctl install.

The fix that I committed does this, too.

Comment 4 Heiko W. Rupp 2014-04-23 12:31:47 UTC
Bulk closing of 4.10 issues.

If an issue is not solved for you, please open a new BZ (or clone the existing one) with a version designator of 4.10.