Running the RHQ ServerThe RHQ Server is actually a customized JBossAS server located in the jbossas directory where the RHQ Server distribution is installed. When you start the RHQ Server, you are actually starting that JBossAS server instance. Running in Debug Mode Sometimes you need the server launcher scripts (i.e. rhq-server.sh/.bat) to emit debug messages. To run the scripts in debug mode, define the environment variable RHQ_SERVER_DEBUG to 'true'. To disable this debug mode, unset that environment variable, or set it to 'false'. To run the RQH Server itself in debug mode, you need to modify the jboss-log4j.xml file, located in the jbossas/server/default/conf directory, appropriately. You would do this if you need the RHQ Server itself to log debug messages. Note that the RHQ_SERVER_DEBUG setting does not affect whether or not the RHQ Server itself emits debug messages - that environment variable effects only the server launcher scripts.
Running on WindowsThe RHQ Server can be run from within a console window or it can be installed as a Windows Service and run as a service. Running in a Windows ConsoleThe rhq-server.bat script is found in the <install-dir>/bin/ directory of the distribution. To run the RHQ Server in a console, execute the command rhq-server.bat console. Alternatively, open Windows Explorer and locate the <install-dir>/bin/rhq-server-console.bat file. Double click on the file to start the RHQ Server. The rhq-server.bat script looks for specific environment variables during its execution. These variables can be modified to suit your system requirements. For example, you can point the RHQ Server at a new JVM. The comments at the top of the rhq-server.bat file contain a detailed list of these environment variables. You do not have to set any specific variables to get the RHQ Server to run; sensible defaults are used. Installing and Running as a Windows ServiceWhen the RHQ Server runs as a Windows service, it runs as a particular user. This user is specified by the RHQ_SERVER_RUN_AS environment variable. The RHQ_SERVER_RUN_AS_ME variable overrides the RHQ_SERVER_RUN_AS variable and allows the RHQ Server to run as the current user. If neither of these two variables are set, the RHQ Server Windows Service runs as the System account. Both variables are explicitly mentioned here because of their security implications. All environment variables can be defined in the rhq-server.bat script. To run the RHQ Server Windows service as a specific user, define the RHQ_SERVER_RUN_AS variable with a value conforming to the strict Microsoft Windows format of: DOMAIN\username, for example, MYDOMAIN\john. Alternatively, define the RHQ_SERVER_RUN_AS_ME variable; no value is required. The RHQ Server runs as the username defined in the USERNAME environment variable. Execute the rhq-server.bat script with one of the following command line options:
Optional Wrapper Configuration FilesThe RHQ Server Windows Service can also be modified by the service wrapper configuration file, located at <server-install-dir>\bin\wrapper\rhq-server-wrapper.conf. This file sets some of the Java Service Wrapper configuration settings. The rhq-server.bat script uses the Java Service Wrapper utility to install and control the Windows Service. Before editing this file, refer to the Java Service Wrapper's property configuration documentation located at http://wrapper.tanukisoftware.org/doc/english/properties.html. A few common settings you might be interested in modifying are:
There are many other Java Service Wrapper configuration properties you can set. If you are interested in learning more, refer to the Java Service Wrapper documentation at http://wrapper.tanukisoftware.org/doc/english/properties.html. Also refer to the comments located in the rhq-server-wrapper.conf file. You can also configure the RHQ Server Windows Service by creating a bin\wrapper\rhq-server-wrapper.inc include file. This effectively augments the service wrapper configuration file, server-install-dir\bin\wrapper\rhq-server-wrapper.conf. If you want to add additional Java VM options, we recommend that you add your settings in here, as opposed to the rhq-server-wrapper.conf file. Running on UnixThe RHQ Server can run from a console window or run as a service started by the init process. Setting Environment VariablesThe rhq-server.sh file, located in the <server-install-dir>/bin/ directory, contains a detailed list of the environment variables it requires to run. For most variables, sensible defaults are used and therefore do not need editing. It is important however, to set the correct path to your Java installation. Before starting the RHQ Server, edit the rhq-server.sh file and ensure that either the RHQ_SERVER_JAVA_HOME or the RHQ_SERVER_JAVA_EXE_FILE_PATH variable is set appropriately. Running in a ConsoleTo run the RHQ Server in a console, execute the following commands as the root user: # cd _<server-install-dir>_/bin/ # ./rhq-server.sh console Running with init.dTo ensure the RHQ Server is started at boot time, the rhq-server.sh script can be managed by the init process. The script must be copied to the appropriate location and the RHQ_SERVER_HOME variable must be set to the installation directory of the RHQ Server. The exact procedure on how to do this varies between different flavors of UNIX. The example procedure below describes this process on Red Hat Enterprise Linux 5.2.
Service Installation on Red Hat Enterprise Linux 5.2The rhq-server.sh script can be placed under the /etc/init.d/ directory and managed by the service and chkconfig command. To run the RHQ Server as a service on Red Hat Enterprise Linux 5.2 and ensure that it starts in run level 5, follow the procedure below as the root user:
The RHQ Server service can now be managed by the command: service rhq-server.sh { start | stop | status }
For example, to start the service, enter the following command: # service rhq-server.sh start Running the Embedded Agent in the RHQ ServerThe RHQ Agent embedded within the RHQ Server allows you to manage the platform, other products and the RHQ Server itself, without having to run a separate RHQ Agent process on the same machine. This feature enables quick testing and demo'ing of RHQ without the need to install and run a standalone agent.
To enable the embedded RHQ Agent, edit the bin/rhq-server.properties file and set the rhq.server.embedded-agent.enabled flag to true. An example portion of the rhq-server.properties file is shown below. # Embedded RHQ Agent rhq.server.embedded-agent.enabled=true rhq.server.embedded-agent.name= rhq.server.embedded-agent.reset-configuration=true rhq.server.embedded-agent.disable-native-system=false |