Ce contenu n'est pas disponible dans la langue sélectionnée.

7.3. Upgrading the Agent


7.3.1. Preparing the Agent for Automatic Updates

Even for automatic upgrades for the agent, certain preparation has to be made to the JBoss ON agent to make sure that the upgrade process goes smoothly and the agent restarts successfully.

7.3.1.1. Configuring Agent Preferences

Agent preferences for settings like the Java home directory can be set in environment variables for normal use. However, the environment variables set in the shell are lost when the upgrade process stops and restarts the agent, and that means that the agent may not automatically restart after upgrade. Custom settings for the agent, such as RHQ_AGENT_HOME or RHQ_AGENT_ADDITIONAL_JAVA_OPTS, should be added to the rhq-agent-env.sh file. This file is preserved during upgrade so all of the settings are carried over.

Warning

Do not edit any of the scripts used to launch the JBoss ON agent. There are five files which should never be modified:
  • rhq-agent.sh
  • rhq-agent-wrapper.sh
  • rhq-agent.bat
  • rhq-agent-wrapper.bat
  • the rhq-agent runtime
Any changes to the launcher scripts are overwritten during the automatic update. Changes to the environment files (such as rhq-agent-env.sh ) are preserved during the update.
The default location for the rhq-agent runtime is $USERHOME/.java/.userPrefs/rhq-agent/default.

7.3.1.2. Configuring Keystores and Truststores

If the original JBoss ON agent was configured to run over SSL using custom keystores and truststores, then make sure that those stores are configured so that the upgraded agent can still access them:
  1. The keystore files must have the word keystore in their filenames. For example, my-agent-keystore.dat.
  2. The truststore files must have the word truststore in their filenames. For example, my-agent-truststore.dat.
  3. Both the keystore and truststore files must be located in the agent's agentRoot/rhq-agent/data directory.
As long as the SSL files are properly set up, then they will be copied over into the new agent configuration, and the new agent will automatically run in SSL.
The upgrade process will write new files to the agent's current installation directory, so the agent's system user must have write permissions to that directory.
If the agent's home directory is /opt/rhq-agent, then the agent has to be able to write to the /opt/rhq-agent directory. If necessary, reset the permissions on the agent home directory. For example:
chown agent_user /opt/rhq-agent
Copy to Clipboard Toggle word wrap

7.3.1.4. Starting the Agent as a Background Service

Section 4.4, “Running the JBoss ON Agent as a Service” describes how to configure the agent to run as a background service. On Windows, this runs as a service. On Linux and Unix systems, the agent starts at boot time from init.d.
The auto-upgrade process assumes that the agent is running in the background. If the agent is not running as a background daemon, when the agent auto-updates itself, the old agent process running in the console is shutdown, and the new agent is restarted as a background service if possible. On Windows, if the agent is not installed as a service, the agent is restarted in a console window.

7.3.2. Automatically Updating the Agent

By default, both JBoss ON servers and agents are configured to upgrade agents automatically. As soon as the JBoss ON server is upgraded, then the agents will be upgraded.

Note

The agent should be running in the background to upgrade properly, as in Section 4.4, “Running the JBoss ON Agent as a Service”.
The automatic upgrade process is part of the normal agent tasks of checking the server for updates:
  1. The updated server puts the updated agent packages in a directory accessible to the agent.
  2. The server notifies the agent that the agent needs to update as soon as the server detects that the agent is running an older version.
  3. As the agent prepares to update, it begins shutting down its other process. This can take several minutes, as it gracefully shuts down each thread.
  4. The agent downloads the new binaries from the server.
  5. The agent spawns a new Java process.
  6. The Java process backs up the old agent configuration and applies the update.
  7. The Java process then restarts the agent and kills itself.
It is possible to instruct an agent to initiate an update or to check if updates are available using the update through the agent command line:
agentRoot/rhq-agent/bin/rhq-agent.sh

> update
Copy to Clipboard Toggle word wrap

7.3.3. Manually Upgrading the JBoss ON Agent

To ensure compatibility with the JBoss ON server, each agent must be upgraded to the same version of JBoss ON as the server.
Agents have the ability to auto-update themselves. So, under most conditions, it isn't necessary to manually upgrade agents. However, if the auto-update fails for some reason or you disabled agent auto-update, then the agent can be upgraded manually.

Note

All agents must be upgraded at the same time. Having agents of different versions is not supported.
  1. Shut down the JBoss ON agent.
  2. Windows only.. If the agent is running as a Windows service, uninstall the Windows service:
    cd old-agent-install-dir/bin
    ./rhq-agent-wrapper.bat remove
    Copy to Clipboard Toggle word wrap
  3. Upgrade the JBoss ON server, as in Section 7.1, “Upgrading the JBoss ON Server”. The JBoss ON server must be upgraded before any agents are upgraded.
  4. Restart the upgraded JBoss ON servers if they are not yet started.
  5. Download the agent update binary from the server.
  6. Copy the agent update binary JAR file into the parent directory where the agent is installed. For example:
    cp agent-update-binary.jar /opt/rhq-agent
    Copy to Clipboard Toggle word wrap
  7. Extract the new JBoss ON agent from the agent update binary by running the following command:
    java -jar agent-update-binary.jar --upgrade
    Copy to Clipboard Toggle word wrap
    This will tell the agent update binary to extract the JBoss ON agent distribution and update the current agent that is found in rhq-agent subdirectory. At this point, the upgraded JBoss ON agent is located in the original rhq-agent directory. The old agent has been backed up to the rhq-agent-old directory. Any upgrade errors are written to the agent's log files.
  8. Finally, start the JBoss ON agent.
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat