June 13, 2013

Configure High-Availability Clustering using TCP Unicast with JBoss EAP 6, HTTPD, mod_cluster on RHEL 6

In my previous blogs I have written about HA in JBoss EAP 6 with Apache Webserver (httpd) and that is all done with UDP multicast. In this blog I will show you how to do it with TCP unicast.

/etc/httpd/conf.d/mod_cluster.conf

standalone-ha.xml

In this example we are going to run all JBoss EAP server on the same machine and we are using standalone mode for simplicity reason. But the same apply if you want to run domain mode.

First configure JGroups to use TCP unicast.

Secondly we need to configure modcluster subsystem in JBoss EAP 6 and set advertise="false" and proxy-list="127.0.0.1:80".

Now lets restart Apache Webserver (httpd) and start two JBoss server. And last you must deploy a clusterable application.

June 12, 2013

Common JBoss EAP 6 CLI Commands for Managing Domain Clusters

Add ServerGroup

Remove ServerGroup

Add Server to ServerGroup

Remove Server from ServerGroup

Manage Server on ServerGroup

June 8, 2013

How to Set Hostname on RHEL 6

Hostname is usually set when installing the machine, but sometime you need to change it.

To print current set hostname

server1.example.com

To temporarily change the hostname.

$ hostname server99.example.com

To permanently change the hostname, edit the /etc/sysconfig/network and set the HOSTNAME property.

NETWORKING=yes
HOSTNAME=server99.example.com

After saving the configuration, you will need to reboot your machine.

How to Disable/Enable and SELinux on RHEL 6

On test laptops you are not always interesting in having all security enabled, e.g. when developing or testing a applications. And that is true for SELinux.

To see if SELinux is active

To temporarily disable SELinux - 1 (enable) or 0 (disable).

To permanently disable SELinux, edit /etc/selinux/config and set SELINUX=disabled.

After saving you need to reboot your machine.

How to setup log4j Syslog Appender in JBoss EAP 6

This solution only works for JBoss EAP 6.0.1 and higher

JBoss ships with a own logging framework and which is used via the org.jboss.logging.Logger class. I myself tend to like to use standardized solution, which is for me - log4j.

Log4j ships with some Appenders, but one especially useful for a Linux environment is SyslogAppender. Here I will show you how to setup log4j org.apache.log4j.net.SyslogAppender with JBoss EAP 6.0.1.

Log4j already is shipped with JBoss, so binaries are required for installation. The configuration is either done in standalone.xml or domain.xml.

In the above configuration I'm using a local rsyslog server listening on UDP port 514. The log4j does not have a Syslog Appender that supports TCP. To test this configuration I'm using RHEL 6 and in a default installed RHEL an UDP listener is not default configured. To activate it, open /etc/rsyslog.conf and uncomment the below.

Now restart rsyslog with:

Now start JBoss and watch logging messages in the default log rsyslog message file.

After verified the Syslog Appender, you probably want to separate JBoss logging to a separate file. How to configure that is out of the scoop for this blog, but a simplistic configuration in /etc/rsyslog.conf is:

After modification, restart rsyslog and rsyslog will automatically create the new log file.

June 7, 2013

How to Install Graphical Printer Configuration Tool on RHEL 6

When installing RHEL 6 with Desktop, you might not get all of the administration tool installed from the beginning. A common tool that is often forgotten is the Printing Configuration tool. To install do the following:

After you can open the printer configuration from System -> Administration -> Printing.

June 3, 2013

New Apache Wicket Book and Good Starting Point for Newbie

A good starting point for learning new framework is to buy a book about. The problem with books is that they get quite fast out-dated for fast developing framework and that is also true for the Apache Wicket project. But quite recently a new e-book have been published for Apache Wicket 6 and the best thing about it, it is free - http://code.google.com/p/wicket-guide/.

You can get a complete list of all Apache Wicket books here http://wicket.apache.org/learn/books/.

And if you want another book I would recommend Wicket in Action.

Another good starting point is to run the components examples (http://www.wicket-library.com/wicket-examples/index.html) on the Apache Wicket page and read the Reference Wiki pages - https://cwiki.apache.org/WICKET/reference-library.html.

The next step if you have not already done that is to start writing codes. When doing so it is good to knew that there is a very good mailing list group for Apache Wicket, which I recommend to search in, if you get stuck - http://wicket.apache.org/help/.