検索

このコンテンツは選択した言語では利用できません。

7.13.2. Setting a Java Option

download PDF
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
  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"
    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

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 では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.