32.3. Setting up JBoss EAP 6 Instances
32.3.1. Configuring the Agent to Discover EAP 6 Instances
- The agent must have read permissions to the
run.jar
file, plus execute and search permissions for every directory in the path to therun.jar
file. - When a JBoss EAP 6 instance is installed from an RPM, the agent user must belong to the same system group which runs the EAP instance. This is jboss, by default.
32.3.2. Configuration for Servers and Profiles
32.3.2.1. Differences for Standalone Servers and Domains
Figure 32.6. Profiles Area in the EAP 6 Console
- Subsystem configuration is located in the profile resources within the Profiles autogroup for the domain controller.
- JVM definitions are configured under the domain controller (domain-wide defaults), server group (group-wide settings), or the managed server (local settings).
- Network interfaces are configured under the domain controller.
- Socket bindings themselves are configured as part of the domain controller configuration, in the entries under the SocketBindings autogroup for the domain controller. Each server group and managed server has an offset, a number that is added to the socket bindings value, which is used to give the managed servers unique port numbers in the domain; these offsets are set on the server group and managed server connection settings.
- System properties can be set on almost any server resource: the domain controller, host controller, server group, managed server.
32.3.2.2. Required Management Interfaces on EAP 6
/host=instanceName/core-service=management/management-interface=http-interface:add(interface=http,port="\${jboss.management.http.port:9990}",security-realm=ManagementRealm
32.3.2.3. Configuration Features in JBoss ON
- View the change history, including diffs between versions
- Rollback changes to any previous version, simply by clicking a button
- Track which users made changes, as part of an audit trail
- Use alerting to notify administrators of any configuration changes
- Define drift monitoring to track configuration changes against a defined baseline and to control unexpected configuration changes
32.3.3. Setup SSL authentication between JBoss ON and EAP 6 using the Setup CLI Operation
jboss-cli.sh
or jboss-cli.bat
). This operation updates <EAP_install_directory>/bin/jboss-cli.xml
and exchanges public keys between JBoss ON and EAP to allow operations such as Execute CLI commands and Execute CLI script be run from the JBoss ON GUI.
- This operation is optional. The jboss-cli can be configured manually using the EAP 6 documentation, see Setting up 2-Way SSL/TLS for the Management Interfaces.To use the Setup CLI operation, the JBoss ON Agent requires read and write permissions to the EAP files and directories.The Setup CLI was introduced by Enterprise Application Platform (EAP) Management Plug-in Pack Update-03 for JBoss ON 3.3.
Property | Description |
---|---|
Default Controller | To set the JBoss ON controller host and port as the defaults for EAP 6 JBoss CLI. |
Security | If the EAP 6 has a secured management interface, this option sets authentication between JBoss ON and EAP based on the Store Password Method, allowing JBoss ON to execute the EAP 6 JBoss CLI. |
Store Password Method | Sets the method for storing passwords to jboss-cli.xml when setting up security.
|
Procedure 32.2. Using the Setup CLI operation
- From the JBoss ON CLI, click the Inventory tab.
- From the Resources menu, click Servers and select the EAP server to be configured.
- From the EAP server resource page, click the Operations tab.
- Click New to schedule a new operation.
- From the Operation drop-down list, select Setup CLI, as shown below.
Figure 32.7. Example of the Setup CLI operation
- To make any required changes to the properties, clear the Unset? check box and click the relevant Value.
- Click Schedule to save the operation. The page redirects to the Operations History tab.
- When the Setup CLI operation has executed and the status indicates success, click the Date Submitted entry for the Setup CLI operation to view the results of the operation and confirm the changes were made successfully, as shown below under the Results section.
Figure 32.8. Example result of the Setup CLI operation
32.3.4. Creating Management Users
- Using an LDAP directory or external data store. This is the most secure implementation for EAP 6 and is recommended.
- Creating a management user through JBoss ON.
- Creating a local EAP account through the EAP add-user script.
32.3.4.1. Setting the Credentials for a Management User
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server, either the standalone server or the domain controller.
- In the inventory tree, select the top resource entry for the server.
- Open the Inventory tab.
- Select the Connection Settings subtab.
- Fill in the username and password for the management user that was created in EAP 6.
- Click the Save button at the top of the page.
32.3.4.2. Creating a Management User Through JBoss ON
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server, either the standalone server or the domain controller.
- In the inventory tree, select the top resource entry for the server.
- Open the Operations tab.
- Click the New button at the bottom of the page.
- Select the Install RHQ User option from the drop-down menu.
- Click the Schedule button.
32.3.4.3. Creating a Management User in EAP 6
- Run the add-user utility to create the user.
[root@server ~]# cd /opt/jboss-eap-6.0 [root@server bin]# ./add-user.sh What type of user do you wish to add? a) Management User (mgmt-users.properties) b) Application User (application-users.properties) (a): a Enter the details of the new user to add. Realm (ManagementRealm) : Username : jonadmin Password : Re-enter Password : About to add user 'jonadmin' for realm 'ManagementRealm' Is this correct yes/no? yes
- Set that user in the connection settings for the EAP 6 server resource in JBoss ON.
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server, either the standalone server or the domain controller.
- In the inventory tree, select the top resource entry for the server.
- Open the Inventory tab.
- Select the Connection Settings subtab.
- Fill in the username and password for the management user that was created in EAP 6.
- Click the Save button at the top of the page.
32.3.5. Creating a Dynamic Group for EAP 6 Resources
- Click the Inventory tab in the top menu.
- In the Groups area on the left, click the Dynagroup Definitions link.
- Enter the expression to create compatible groups for each EAP 6 server type.
resource.type.plugin = JBossAS7 resource.type.category = SERVER resource.parent.type.category = PLATFORM groupby resource.pluginConfiguration[productType] groupby resource.type.name
- Click the Save button in the middle of the page.
32.3.6. Setting Start Script Arguments, Environment Variables, and JAVA_OPTS
32.3.6.1. Start Script Discovery and Settings
- The discovery process identifies, or attempts to identify, the start script used, including custom start scripts.
- Discovery detects a subset of environment variables set in the
run.conf
file or parent process that are required for the start script to work.NoteAlthough the discovery process does detect some environment variables, the discovery scan does not detect JAVA_OPTS values.The connection properties for the start script intentionally defer to therun.conf
file for JAVA_OPTS values. - Discovery attempts to detect any arguments passed with the start script itself.
- Discovery attempts to detect what user the script is running as and assign a prefix command to use with the start script. For example, if the start script is running as the jboss user and the JBoss ON agent is running as jonagent, then the discovery script automatically assigns a sudo command, sudo -u jboss -g jboss, to pass with the start script.
-XX:PermSize=256M
), the argument value will not be updated if the server is restarted later with a different setting value.
32.3.6.2. Start Script Arguments and Drift Monitoring
Example 32.2. System Properties Without Violating the Drift Definition
32.3.6.3. Changing Start Script Configuration
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server.
- In the inventory tree, select the top resource entry for the server.
- Open the Inventory tab, and select the Connection Settings subtab.
- Expand the Operations area.
- Change or add start script settings. These are the scripts and settings that the JBoss ON agent uses when running a start or restart operation on the EAP 6 server.
- To use a custom start script, one other than
domain.sh
orstandalone.sh
, enter the path and script name. - Optionally, enter a prefix to use with the script when running the start script.When the start script is discovered, the agent tries to determine the user the script is running as and assign a prefix command to use with the start script. For example, if the start script is running as the jboss user and the JBoss ON agent is running as jonagent, then the discovery script automatically assigns a sudo command, sudo -u jboss -g jboss, to pass with the start script.Additionally, JBoss ON assigns the nohup command as a prefix so that if the JBoss Enterprise Application Platform is started by the agent and the agent process dies, the JBoss Enterprise Application Platform process continues running.
- Set any environment variables, one per line.
- Set any script arguments, one per line. For regular JAVA_OPTS, these arguments usually are
-X
,-D
, or-P
. Some useful-XX
arguments are listed in the JVM options documentation from Sun. Some useful system properties for EAP 6 are listed with the JBoss AS7 project documentation.The EAP 6 default start scripts use arun.sh
-style script, so the arguments use that format. A custom script can use different arguments or options.
- Click the Save button at the top of the page.
32.3.6.4. Changing JVM Heap Arguments in Standalone Mode
standalone.conf
or standalone.bat
(depending on the OS) at the end of the file.
- Click on the Inventory tab in the top menu
- Select "Servers - Top Level Imports" in the Resources menu table on the left, then click on the desired JBoss Enterprise Application Platform 6 standalone server from the table on the right.
- Click the "Inventory" tab in the JBoss Enterprise Application Platform Server details.
- Click the "Connection Settings" subtab.
- Scroll down to the "Additional JAVA_OPTS" row in the "Operations" section of the table.
- To add your arguements, uncheck the "Unset?" checkbox and add your arguements to the text box.NoteThe "Unset?" checkbox only determines if the settings are used from the JBoss ON Server or not. If "Unset" is unchecked, the values in the text box will be used. If "Unset" is checked, the value in the text box will not be used. Having "Unset?" checked does not imply that configuration file does not set JAVA_OPTS, it simply means that the value was not set via JBoss ON.
- Click "Save"
- The JBoss Enterprise Application Platform 6 server will need to be restarted for this update to take affect.
32.3.7. Changing Port Numbers
32.3.7.1. Changing Socket Binding Ports
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server.
- In the inventory tree, select the SocketBindingsGroup compatible group, and then select the socket binding to edit.
- Open the Configuration tab.
- Click the pencil icon to edit an existing socket definition or click the plus sign (+) to create a new one.
- Change the Port number to any available port between 1025 and 65535. On Linux, available port numbers can be determined using iptables.Optionally, configure multicast settings for the socket. If there are multiple instances of JBoss servers on the same system or in the same cluster, then multicast may be configured for cluster communication.
- Click the Save button at the top of the page.
32.3.7.2. Changing Port Offsets for Server Groups in a Domain
host.xml
file. This can be set when the managed server is created in JBoss ON, but it cannot be edited afterward.
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server.
- In the inventory tree, expand the Server Groups node, and select the server group.
- Open the Configuration tab for the server group.
- In the Port Offset field, enter the new value for the offset.
- Click Save at the top of the page.
32.3.8. Editing Network Interfaces
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server.
- In the inventory tree, select the Network Interfaces group under the Server Configuration, and select the interface (management, public, or unsecure).
- Open the Configuration tab.
- Set either the specific IP address for the interface to use or set which type of IP address to use (IPv4, IPv6, or either). Either the IP address or the IP address type must be set.Because either a specific IP address or an IP address type can be set, and which property is used is optional, the UI does not enforce that a selection is made. For the network interface to work properly, however, some kind of IP address configuration must be set.
- Click the Save button at the top of the page.
32.3.9. Setting System Properties
domain.xml
file. When editing a host controller or a managed server, the properties are added to the server's entry in the host.xml
file.
-D
or -P
arguments.
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server.
- In the inventory tree, select the top resource entry for the server.
- Open the Configuration tab.
- Expand the Properties section.
- Click the plus (+) icon at the bottom of the Paths list.
- Fill in the new property information.
- The system property name.
- The value of the property.
- If the property should be loaded immediately to the running JVM or if it should be loaded when the JVM is started. The default is to load it immediately.
- Click OK.
32.3.10. Adding System Paths
jboss.*
, user.*
, and java.*
.
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server.
- In the inventory tree, select the top resource entry for the server.
- Open the Configuration tab.
- Expand the Paths section.
- Click the plus (+) icon at the bottom of the Paths list.
- Fill in the path information.
- The name of the path to create.
- The path (absolute or relative) to create.
- If a relative path was given as the Path value, then de-select the Unset? checkbox for the Relative field, and enter the name of the system path that it is relative to.For example, if the new path is
devel/
, and this is relative to the EAP home directory, then the Relative value is java.home.dir. This results in a final path of/opt/jboss-eap-6.0/devel/
. - If the property is read-only. A read-only property cannot be edited after it is created. Read-only paths (aside from the default paths) have to be deleted and recreated if they need to be changed.
- Click OK.
32.3.11. Editing Connection Settings
32.3.11.1. Changing the General Properties for an EAP 6 Server
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server.
- In the inventory tree, select the top resource entry for the server.
- Open the Inventory tab, and select the Connection Settings subtab.
- The server connection properties are in the General Properties section. Only some of the properties can be edited. Information that is derived from the JBoss EAP 6 installation itself, like the home directory, base directory, and server type (EAP or AS) is displayed, but is inactive.
- Hostname gives IP address to use to connect to the server. This is usually 127.0.0.1, but if the management interface configuration has been changed, then the IP address may be a public IP instead of the localhost.
- Port is the port of the management interface.
- Secure indicates whether SSL is used to communicate with the JBoss Enterprise Application Platform 6 management interface. It will be set to true during discovery if the JBoss ON agent detects that the JBoss Enterprise Application Platform 6 standalone server or host controller HTTP management interface uses SSL.
- Username and Password are the credentials of the JBoss EAP 6 user for the agent to use to log in. If this user was created using the install RHQ user operation, then the user is rhqadmin.
- Domain Controllers Only. With the standalone server, all of the configuration and the server instance definition are in the same file,
standalone.xml
or any other configuration file passed to the start script. For domains, the server configuration is defined in one file (for the domain controller), while the server instances are defined in a separate file (for the host controller). The Domain Configuration and Host Configuration fields give the names of the files within thedomain/configuration/
directory to reference for profile configuration and for managed server instances, respectively.
- Click the Save button at the top of the page.
32.3.11.2. Changing the Secure Connection Settings for a JBoss Enterprise Application Platform 6 Server
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss Enterprise Application Platform 6 Server.
- In the inventory tree, select the top resource entry for the server.
- Open the Inventory tab, and select the Connection Settings subtab.
- The secure connection settings are in the Secure Connections Settings section.
- Configure the secure connection settings with the proper information and click Save.
- JBoss ON will begin using these settings after the next availability scan.
32.3.11.3. Viewing Installation Paths for EAP 6 Child Resources
domain.xml
file:
<server-groups> <server-group name="main-server-group" profile="full"> ...
Figure 32.9. Child Resource Connection Settings
32.3.12. Viewing Installed Extensions
domain.xml
or standalone.xml
).
<extensions> <extension module="org.jboss.as.clustering.infinispan"/> <extension module="org.jboss.as.clustering.jgroups"/> <extension module="org.jboss.as.cmp"/> <extension module="org.jboss.as.configadmin"/> <extension module="org.jboss.as.connector"/> <extension module="org.jboss.as.ee"/> <extension module="org.jboss.as.ejb3"/> ...
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server.
- In the inventory tree, select the top resource entry for the server.
- Open the Configuration tab.
- Expand the Installed extensions section.
32.3.13. Reloading the Server Configuration
Figure 32.10. Reload Configuration Message
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server.
- In the inventory tree, select the top resource entry for the server.
- Open the Operations tab.
- Click the New button at the bottom of the page.
- Select the Reload) option from the drop-down menu.
- Click the Schedule button.
32.3.14. Controlling Configuration Drift
- Set drift definitions that track the critical configuration directories, such as
domain/configuration/
andstandalone/configuration/
, but that exclude directories which will have constantly changing data, such as logging, library, and data directories. Even within the configuration directories, create exclude rules for thehost_xml_history/
,domain_xml_history/
, andstandalone_xml_history/
directories, since those are not proper configuration files and should not be tracked. - Once the desired configuration is in place, pin that configuration to the drift definition. This sets the desired configuration as the baseline. All changes will be compared against that baseline.
- Create an archive of the blessed configuration.
- Create a bundle definition that can be automatically deployed to reset the EAP 6 configuration and remediate drift.When creating the he destination should be the platform of the EAP 6 resource. The destination could be the standalone server or the domain controller, but using the platform allows you to deploy the bundle to an expendable directory, like
/tmp/mybundles/holding
, and then run a post-install task that copies the configuration files into the configuration directory.Deploying a bundle generally removes whatever existing files are in the target directory and replaces them with the bundle. There are ways to control that behavior, but, generally, it is safest to have the contents of the bundle match exactly what the final deployment will be.Since it may not be feasible to have the entire configuration directory in the bundle, deploying to a separate location on the filesystem preserves the configuration directory, and only the important configuration files are updated (when they are copied by the Ant task).For more on bundles and remedying drift, see Chapter 27, Deploying Content and Applications Through Bundles and the drift-bundle CLI example script in "Writing JBoss ON Command-Line Scripts." - Set up alerts for configuration drift that do two things:
- Send a notification email to administrators.
- Run a CLI script on the platform that automatically deploys the bundle.
Chapter 25, Defining Alerts has information on how to configure alert notifications that launch a JBoss ON server-side script or that run an operation on another resource.
domain.xml
and standalone.xml
. That will trigger a drift alert, if alerting is configured.
32.3.15. Tracking and Reverting Configuration Changes
- Click the Inventory tab in the top menu.
- Select Servers - Top Level Imports in the Resources menu table on the left. Select the JBoss EAP 6 server.
- In the inventory tree, select the top resource entry for the server.
- Open the Configuration tab, and select the History subtab.NoteChange history pages are kept for resource configuration (the Configuration tab) and the connection settings (the Inventory > Connection Settings tab).
- Clicking the change ID number opens the configuration settings that were in effect for that version.
- Changes can be compared to one another, in a standard diff format, by selecting them from the list and clicking the Compare button.
- The current, live version of the configuration can be reverted to any previous version by selecting the desired previous version in the list and clicking the Rollback button.