이 콘텐츠는 선택한 언어로 제공되지 않습니다.

7.13. Installing Multiple Agents with a Shared Directory or Account


Multiple agents, running on multiple systems, can share the same system user accounts. If the same user is used for a JBoss ON agent on different systems and those system users all use the same shared home directory, then they all share the same agent configuration location and preference node by default. Because of the way the agent uses Java preferences, this requires special agent configuration to prevent the agents from overwriting each other's preferences.
A similar situation can occur on Windows systems if the same domain user is used for the JBoss ON agent. In that case, the Java preferences are stored in a registry key which is used by the domain user and is loaded into the local user's profile. If there are multiple agents using the same domain user, then they will overwrite each other's registry keys.
All of the agent configuration, after setup, is stored in a Java preferences node, as described in Section 7.11, “Managing the Agent's Persisted Configuration”. With the default configuration, the node name is default, and the node location is agentUserHomeDir/.java/.userPrefs/rhq-agent/default.
If multiple agents are installed using the same file share, then all of them attempt to use the same default node and location.
When multiple agents attempt to use the same Java preferences node, each new agent overwrites the previous agent's configuration as it is set up. This means that only the newest agent's configuration is saved, so only the newest agent can be started. Starting any of the previous agents fails because they cannot find their own configuration.
The preferences node is uniquely identified by two settings:
  • Its name, which is defined as an agent configuration setting
  • Its location, which is itself a Java option
To run multiple agents with the same home directory, the preferences node has to be uniquely identified for each agent. There are a couple of different ways to do that:
  • Editing the agent configuration files directly
  • Setting an explicit Java option

7.13.1. Editing the Configuration Files

When the agent is first set up, the name of the agent preferences node is set in the agent-configuration.xml file and is loaded from there. The node location is derived from the node name setting.
  1. Edit the agent-configuration.xml file to use the new node name:
    [rhquser@server ~]$ vim agentRoot/rhq-agent/conf/agent-configuration.xml
    
    <node name="agent01-node">
    Copy to Clipboard Toggle word wrap
  2. Then, start the agent with the --config option to load the edited configuration file and the --prefs option to point to the specific node location:
    [rhquser@server ~]$ agentRoot/rhq-agent/bin/rhq-agent.sh --prefs=agent01-node --config=agent-configuration.xml
    Copy to Clipboard Toggle word wrap
Important
If the custom Java preferences node is specified by editing the agent-configuration.xml file, then every time the agent restarts, the node location has to be passed to the agent using the --prefs option.

7.13.2. Setting a Java Option

Editing the agent-configuration.xml file only sets the node name; the node location still has to be passed every time the agent is started.
By setting a Java option in the rhq-agent-env.sh file, the Java preferences node information is set once and then persisted, so you can restart the agent as a service, without having to pass --prefs options or edit and reload the configuration.
  1. Open the agent prompt. For example, if the agent process is already running, the prompt can be opened by re-running the rhq-agent.sh script with the -n option.
    [rhquser@server ~]$ agentRoot/rhq-agent/bin/rhq-agent.sh -n
    Copy to Clipboard Toggle word wrap
  2. Use the setconfig command to set the RHQ_AGENT_ADDITIONAL_JAVA_OPTS value with the preference node. For example:
    > setconfig RHQ_AGENT_ADDITIONAL_JAVA_OPTS="-Djava.util.prefs.userRoot=agentUserHomeDir/.java/.userPrefs/rhq-agent/agent01-node"
    Copy to Clipboard Toggle word wrap
    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.
  3. 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
    Copy to Clipboard Toggle word wrap
Note
It is also possible to stop the agent, edit the rhq-agent-env.sh file directly, and then restart the agent.
Important
Do not set the Java option within the rhq-agent runtime directory because this file is overwritten during JBoss ON agent updates. The default location for the rhq-agent runtime is $USERHOME/.java/.userPrefs/rhq-agent/default.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat