8.6. Installing Multiple Agents with a Shared Directory or Account
default, and the node location is agentUserHomeDir
- Its name, which is defined as an agent configuration setting
- Its location, which is itself a Java option
- Editing the agent configuration files directly
- Setting an explicit Java option
8.6.1. Editing the Configuration Files
agent-configuration.xmlfile and is loaded from there. The node location is derived from the node name setting.
- Edit the
agent-configuration.xmlfile to use the new node name:
[rhquser@server ~]$ vim agentRoot/rhq-agent/conf/agent-configuration.xml <node name="agent01-node">
- Then, start the agent with the
--configoption to load the edited configuration file and the
--prefsoption to point to the specific node location:
[rhquser@server ~]$ agentRoot/rhq-agent/bin/rhq-agent.sh --prefs=agent01-node --config=agent-configuration.xml
agent-configuration.xmlfile, then every time the agent restarts, the node location has to be passed to the agent using the
8.6.2. Setting a Java Option
agent-configuration.xmlfile only sets the node name; the node location still has to be passed every time the agent is started.
rhq-agent-env.shfile, the Java preferences node information is set once and then persisted, so you can restart the agent as a service, without having to pass
--prefsoptions or edit and reload the configuration.
- Open the agent prompt. For example, if the agent process is already running, the prompt can be opened by re-running the
rhq-agent.shscript with the
[rhquser@server ~]$ agentRoot/rhq-agent/bin/rhq-agent.sh -n
- Use the
setconfigcommand to set the
RHQ_AGENT_ADDITIONAL_JAVA_OPTSvalue with the preference node. For example:
> setconfig RHQ_AGENT_ADDITIONAL_JAVA_OPTS="-Djava.util.prefs.userRoot=agentUserHomeDir/.java/.userPrefs/rhq-agent/agent01-node"The preference node can be in the user preferences directory with a different name, such as
agent01-node, or it can be in an entirely different location, such as
/etc/agent-preferences, which is not a shared or filesystem-mounted location.
- Restart the agent process to load the new configuration. For example, if the agent is running as a service:
[rhquser@server ~]$ service rhq-agent-wrapper.sh stop [rhquser@server ~]$ service rhq-agent-wrapper.sh start
rhq-agent-env.shfile directly, and then restart the agent.