I've been using and tweeking rhqctl the past two days (mainly around the agent
install). Aside from the things that I fixed, there are some other issues we need to deal
with, hopefuly before RHQ gets out into the wild with this stuff (that is, before 4.8 is
released).
Here's some issues I think we may still need to address or discuss (I may think of
more later):
1) Agent always loses all prior persisted config when getting installed
2) No way to only install, but not start, the agent.
3) Needed a way to point to a remote server as well as just general customization of agent
config
4) No way for rhqctl to start agent in foreground in case you want agent prompt or setup
questions
5) rhtctl install also starts things
Here's more details on those I listed above:
1) When installing the agent "rhqctl install --agent" you lose all prior
persisted perferences (the agent configuration) except for the security token. So at least
you won't lose the security token, but everything else goes away - which means you
STILL might not be able to connect to and communicate with the server. You will have to
make sure the configuration you give to the agent matches (or is otherwise compatible)
with your prior existing configuration.
So, how do you upgrade an agent? The way we did it before - do not use rhqctl and either
setup your agent so it knows to do an "auto-update" at the appropriate time (
https://docs.jboss.org/author/display/RHQ/RHQ+Agent+Installation#RHQAgent...
), or download the agent update binary from a server and manually upgrade your existing
agent with that update binary (
https://docs.jboss.org/author/display/RHQ/Manually+Upgrading+the+Agent ).
Therefore, it looks like we need to document this - it has be declared that "using
rhqctl to install the agent will NOT upgrade the agent if one was previously installed on
the box; it will install what is assumed is a completely new agent, with the caveat that
it will attempt to reuse the security token if one was previously persisted. Do not use
rhqctl if upgrading the agent from an older version unless you are willing to lose all
prior agent configuration."
2) There is no way to NOT start the agent after installing. It would be nice to just lay
down the agent file bits but not start it - this would allow one to later run the agent
using "rhq-agent.sh -l" and have it ask the setup questions without having the
agent first started and connect (or at least attempt to connect) to the server.
3) If you use rhqctl to install the agent on a box where the server will not be installed
or running, there is (well, there WAS) no way to tell the agent what remote server to talk
to (that is, no way to tell it where its registration server is). Now, I say there WAS no
way because I just committed something to master that allows you to set any agent
preference value as an override to the config file - so technically, you can do this now
via "rhqctl --agent --agent-preference
rhq.agent.server.bind-address=192.168.1.2" as an example. You can also set your own
agent token using this mechanism too (in case you lost the token and need to install an
agent - "rhqctl --agent --agent-preference rhq.agent.security-token=<security
token here>". This is nice because you can override *any* preference value - so
this opens up the configurability of rhqctl and now allows you to do other things like set
the comm change with secure SSL settings, set the agent name, customize the agent bind
port, customize the the connection URL of the agent (thus allowing us to support NAT
routing, et. al. But I'm smart enough to know (only because I've been beat up on
things like this) that as soon as we tell people "oh, just pass in --agent-preference
rhq.agent.server.bind-address=<hostname>" and people will reply
"that's ugly". Users can specify their own config settings via
"--agent-config my-custom-config.xml", so that's the alternative. Anyway,
just wanted to bring that up.
4) rhqctl cannot start the agent in foreground. So you can't use rhqctl to get to the
agent prompt nor can you use rhqctl and have the agent ask you for setup questions
5) The install comment to rhqctl not only installs things but also starts them. This
probably makes sense for the server, since you need to start the server and run
rhq-installer.sh to complete the installation. But this also means the storage node should
also be started because it is needed by the server. And as #2 mentions, the agent is
always started. I don't know what I want here. I guess if we support #2 (installing
but not starting the agent) that might be good enough.