Book Image

JBoss EAP6 High Availability

By : Weinan Li
Book Image

JBoss EAP6 High Availability

By: Weinan Li

Overview of this book

High availability is a system design approach and associated service implementation which ensures that a prearranged level of operational performance will be met during a contractual measurement period. High availability is usually a system combined with many different components that achieve different goals. High availability cluster implementations attempt to build redundancy into a cluster to eliminate single points of failure. JBoss EAP6 High Availability is the perfect guide for learning how to apply the newest technologies provided by JBoss to build your high availability system. With a clear explanation of the design of JBoss EAP6 and its clustering components, this book will help you customize each component to fulfill your specific requirements. Throughout the course of this book, you will learn how to build high availability clusters using the projects provided by JBoss. The book begins with an introduction to the design of JBoss EAP6 and its uses. The next step will be to explore the two companion open source projects - mod_jk and mod_cluster. In this section, you will get to grips with the concept of load balancing with mod_jk and mod_cluster. You will also learn how to enable SSL in the clustering environment and how to configure session replication between EAP6 servers. Furthermore, the appendix section introduces you to some troubleshooting techniques for Wildfly.
Table of Contents (15 chapters)
JBoss EAP6 High Availability
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Starting JBoss EAP6 in the standalone mode


Let's now try to start JBoss EAP6 in the standalone mode. Go to the bin directory and run standalone.sh. The server output is shown in the following screenshot:

Now let's look at some details on the server output to understand the startup process.

Understanding the startup process

We can see several important things from the server output. The following is the first one:

Started 123 of 177 services (53 services are passive or on-demand)

From the previous log, we can see that not all the components are started during the EAP6 startup process. This design greatly speeds up the startup time of EAP6. We can see that some services are started by default during the start process:

These components are called subsystems. These subsystems are configured in the standalone.xml file upon navigating through standalone/configuration.

Now let's see the actual command in standalone.sh that starts the EAP6 server:

eval \"$JAVA\" -D\"[Standalone]\" $JAVA_OPTS \
     \"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/server.log\" \
     \"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\"   \
     -jar \"$JBOSS_HOME/jboss-modules.jar\" \
     -mp \"${JBOSS_MODULEPATH}\" \
     -jaxpmodule "javax.xml.jaxp-provider" \
org.jboss.as.standalone \
     -Djboss.home.dir=\"$JBOSS_HOME\" \
-Djboss.server.base.dir=\"$JBOSS_BASE_DIR\" \
     "$SERVER_OPTS" "&"

Tip

Downloading the example code

You can download the example code files for all Packt Publishing books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

From the previous command, we can see that jboss-modules.jar is the bootstrap JAR file for the whole EAP6 server, and the entry point is org.jboss.as.standalone, which is specified in the following command:

-jar \"$JBOSS_HOME/jboss-modules.jar\" org.jboss.as.standalone

We'll see more details about the startup process later. Now let's check the configuration file of the standalone mode.

The standalone.xml file

The structure of standalone.xml is as follows:

As shown in the previous screenshot, standalone.xml defines multiple aspects of the standalone service. Let's have a brief view:

extensions

This section contains a list of extension modules. The components listed here will be loaded by jboss-modules.

management

This section contains the configuration related to management interfaces of EAP6 and its security settings.

profile

In this section, we can configure the settings for each subsystem. Most of the subsystems are the components loaded in the extensions section, and some subsystems are required by EAP6 internally and loaded at startup by default.

interfaces

This section defines a list of named network interfaces.

socket-binding group

This section contains a list of socket-binding groups, including the set of interfaces that could be used by different modules.

Alternative configuration files

Besides the default file standalone.xml, EAP6 has provided some other profiles for the standalone mode.

Tip

There is only one profile per standalone configuration file. In contrast, multiple profiles could be defined in the domain configuration file.

We can check them in the standalone/configuration directory:

These files define the different profiles for different purposes. The following is a summary of their differences:

standalone.xml

This is the default setting of standalone mode.

standalone-full.xml

Compared with the default settings, this profile has added the messaging subsystem (HornetQ and relative components).

standalone-ha.xml

Compared with the default settings, this profile has added clustering-related components: mod_cluster and JGroups, replicable caches powered by Infinispan, and other relative components.

standalone-full-ha.xml

Compared with the default setting, this profile provides a combination of functions in '-full' and '-ha'.

To use these alternative configurations during startup, we can use the -c option when calling standalone.sh. For example, if we want to use standalone-ha.xml, the command is as follows:

$ ./standalone.sh -c standalone-ha.xml

Please note that the -c option assumes that the configuration is located at $JBOSS_HOME/standalone/.

The --help option

Both standalone.sh and domain.sh provide us with the help document. We can always use the --help option to check it:

$ standalone.sh --help

Configuration files

In the bin directory, there are several configuration files that will be included during the startup process:

We can put our own configuration into these files, and it will be included by the startup scripts.