Installing EAP 7
Installing the application server can be done in several ways. For the purpose of learning we will start with the basic unzipping installation which will produce a vanilla installation ready to be used. In real-world scenarios with dozens of customized installations to be completed, you will probably want to learn some advanced installation tactics. Don't worry, we have been trained for it and you will be too in a while.
Installing from the ZIP file
The first one we will detail is also the simplest, which merely requires unzipping a file. The JBoss EAP 7 ZIP file is available from the Red Hat Customer Portal. This method of installation is platform-independent and requires the following steps:
- Open a browser and log into the Customer Portal at https://access.redhat.com.
- Click Downloads.
- Select Red Hat JBoss Enterprise Application Platform in the Product list and click on it.
- In the next window, select the correct JBoss EAP version from the Version combobox and click Download.
JBoss EAP 7 is now downloaded to your target machine, ready for installation. Execute the following command in order to unzip the archive:
unzip jboss-eap-7.0.0.zip
Now you can test that the installation was successful by executing the standalone.sh
shell script (Windows users will launch the standalone.cmd
equivalent).
cd jboss-eap-7.0 cd bin $ ./standalone.sh
Tip
When to use ZIP installation:
The ZIP installation can be used for developers or simple environments where it's just fine to provide a basic default installation of the server, with all the configuration and libraries in the standard folders. Therefore, it's not the best choice for large enterprise systems where you want to automate and customize installations.
Installing EAP from RPM
This method of installation is peculiar of JBoss EAP and can be a practical solution if you want to manage your application ecosystem through Red Hat Packet Manager (RPM) archives.
Installing JBoss EAP 7 via RPM requires a subscription to the official Red Hat's repositories. You can either subscribe to the current JBoss EAP channel or a minor channel that provides a specific minor release and all applicable patches. This allows you to maintain the same minor version of JBoss EAP 7, while still staying current with high severity and security patches.
Let's see in practice how the installation can be done on a RHEL 7 operating system. First of all, we have to register our brand new server to the Red Hat Network (RHN), using our credentials (username/password) for accessing to all needed subscriptions.
The command will ask for username or password, or in case we've planned to use an internal RH Satellite 6 system, we can use a preconfigured Activation Key as an option:
# subscription-manager register
After a successful registration we need to figure out to which Pool we need to attach for downloading the EAP 7 packages. We can use the subscription-manager list
command followed by the less one for searching through multiple subscriptions:
# subscription-manager list --available|less Subscription Name: Client SKU Provides: Oracle Java (for RHEL Server) - AUS Oracle Java (for RHEL Client) Red Hat Enterprise Linux 7 High Availability Red Hat Enterprise Linux High Availability Red Hat EUCJP Support (for RHEL Server) Red Hat Enterprise Linux for Power Red Hat Enterprise Linux EUS Compute Node Red Hat Enterprise Linux for Power, big endian - Red Hat OpenShift Enterprise JBoss EAP add-on Oracle Java (for RHEL Server) - Extended Update dotNET on RHEL Beta (for RHEL Server) Red Hat Enterprise Linux Load Balancer JBoss Enterprise Web Server JBoss Enterprise Application Platform - ELS . . . . . . . . . . . . . . . . . . .
As soon as we find the right subscription (you should choose something like: JBoss Enterprise Application Platform) we have to take note of the pool ID and run the following:
# subscription-manager attach --pool
844aff014485be8a85f8d058bf198144
After that we can explore the available repositories:
# subscription-manager repos --list
We won't list here all the available repositories which is quite large; however, you have to enable only EAP, RHEL7 base rpms, extras, and optional repository, and disable all the others with the following command:
# subscription-manager repos --disable="*" --enable jb-eap-7.0-
for-rhel-7-server-rpms --enable rhel-7-server-rpms --enable
rhel-7-server-extras-rpms --enable rhel-7-server-optional-rpms
You can verify that the process worked as expected by simply running the following:
# yum repolist
The list should look like this:
Loaded plugins: search-disabled-repos repo id name !jb-eap-7.0-for-rhel-7-server-rpms/7Server/x86_64 (RPMs) !rhel-7-server-extras-rpms/x86_64 (RPMs) !rhel-7-server-optional-rpms/7Server/x86_64 (RPMs) !rhel-7-server-rpms/7Server/x86_64 (RPMs) repolist: 19,727
Complete the installation by executing the following:
# yum groupinstall jboss-eap7
Tip
When to use RPM installation:
The RPM installation makes things a lot easier in terms of installation because you can use all the tools that know how to deal with RPMs, and upgrading is simpler because you can use yum to do it, especially for security errata. The JBoss RPMs put things where many RHEL system administrators would expect them: config
files under /etc
, content and libraries under /var
, and so on.
Most of the downsides come from being forced to do things the way RHN/RPMs want to do them. You cannot install multiple version of JBoss in parallel, which may not be an issue if you spin up a new VM per instance, but can be for some people. It is also difficult to install non-current versions, since you either need to manually specify the versions of several hundred packages or use satellite with a date cutoff on a custom cloned channel to hide any packages from newer releases.
Installing from the JAR installer
The JBoss EAP 7 installer archive is also available from the Red Hat Customer Portal (https://access.redhat.com). The .jar
archive can be used to run either the graphical or text-based installers.
In order to complete the JAR installation, follow these steps:
- Open a terminal and navigate to the directory containing the downloaded installation program JAR.
- Type the following command:
java -jar jboss-eap-7.0.0-installer.jar
- As an alternative, if you have just a terminal available, use the text only mode by launching the following command:
java -jar jboss-eap-7.0.0-installer.jar -console
We will not detail the single steps of the installation which are quite intuitive and covered by the EAP installation guide. Rather we would like to stress that the installer produces an XML script; you can reuse it for multiple installations, as you can see from the following picture:
If you open the generated XML file, then you can pinpoint some custom elements in the installation:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <AutomatedInstallation langpack="eng"> <productName>EAP</productName> <productVersion>7.0.0</productVersion> <com.izforge.izpack.panels.HTMLLicencePanel id="HTMLLicencePanel"/> <com.izforge.izpack.panels.TargetPanel id="DirectoryPanel"> <installpath>/home/francesco/EAP-7.0.0</installpath> . . . . . </AutomatedInstallation>
Then you can repeat the installation with the following command:
java -jar jboss-eap-7.0.0-installer.jar -xml yourxml
Tip
When to use the JAR installer:We would recommend using the JAR installer for medium to large sized environments where you have some common defaults for networks, database connectivity, or security settings. Another advantage of this approach is that it can be used for any operating system as it's completely Java based.
Installing from the source
Downloading the source code can be used if you need low-level details about the single modules of the application server. Once you have downloaded the jboss-eap-7.0.0-src.zip
file, unzip it to your disk at first. Next you can build the server in two ways:
- Executing the batch script (
build.sh
orbuild.bat
for Windows) - If you have Maven 3.2.5 (or newer) installed you can use it directly as follows:
$ mvn install
Change to the bin directory after a successful build:
$ cd build/target/jboss-eap/bin
Verify that the application server boots successfully:
$ ./standalone.sh
Other installation options
The amount of installation options for EAP could well deserve one or more chapters; however, that would take us away from the scope of this book. We will just mention Ansible, which is an excellent configuration management and provisioning tool that uses SSH to perform administrative tasks on your machines. This has the evident advantage that nothing needs to be installed on the machines you are targeting as Ansible only runs on your main control machine, which could even be your laptop!
The steps used by Ansible to provision and configure machines are described in a kind of template called Playbooks, which are Ansible's configuration, deployment, and orchestration language.
You can find a large list of example Playbooks in the Ansible documentation, available at http://docs.ansible.com/ansible . Besides this, for testing purposes we have provided a sample EAP 7 playbook which is attached to the sources of this book. (Read the instructions contained in the README.txt
file packaged in ansible.zip
.)
Besides this, if you want a user interface for your provisioning activities, Ansible Tower is a web-based solution that makes Ansible even more easy to use for IT teams of all kinds. It's designed to be the hub for all of your automation tasks.