Catégorie: Administration
28.11.07
Easing the configuration of a development JBoss cluster environment
Configuring a JBoss cluster is tedious because you need multiple machines, you need to configure multiple files on different machines, multicast, ips, shares, network interfaces and etc ... In order to make it easier to test things when working with JBoss clusters, here are a few tips.
First of all, use a virtual environment ! I use VMware Workstation on my development laptop (with virtual ip 192.168.208.2) and configure two debian virtual machines v1 and v2 on a NAT virtual network (192.168.208.x) with DHCP activated. I use a NAT virtual network so that the debian virtual machines can apt-get update from the internet through the dev machine.
I only configure one virtual machine (J1) with java and samba then copy and paste it in order to obtain the second virtual machine J2.
To avoid having multiple configuration files around, I find it convenient to centralize the whole JBoss directory in a shared folder on my windows development machine. I use c:\jboss shared on \\192.168.208.2\jboss in read only mode, I explain why the read only mode a bit later.
I then mount it using smbfs on each virtual JBoss node. It can be automated by adding the following line to your /etc/fstab:
//192.168.208.2/jboss /mnt/jboss smbfs ro,username=yourname,password=yourpasswd 0 0
The shared JBoss configuration must absolutely be mounted read only because it will be used by multiple JBoss instances which must not concurrently modify the same files.
JBoss needs additional configuration here because by default, JBoss creates 4 working directories under the server configuration directory server/all/:
- log: used by log4j and configrued in conf/log4j.xml
- data: used by hsqldb (i think)
- work: used by tomcat
- tmp: used by the jboss micro kernel
Those directories will actually be used in read write mode so we must tell JBoss to use some other directory, specific to each virtual node for its write needs. I use /var/local/jboss.
JBoss allows to do just that with the following property:
jboss.server.home.dir=/var/local/jboss
On the command line, you would pass the property that way:
./bin/run.sh -Djboss.server.home.dir=/var/local/jboss
But to avoid having to remember that and to take advantage of the configuration being centralized on the shared directory on the dev machine, edit the c:\jboss\bin\run.conf file and add the following line at the end:
JAVA_OPTS="$JAVA_OPTS -Djboss.server.home.dir=/var/local/jboss"
Now, you're setup, on each virtual node, you can start the jboss instance directly from the shared mount:
/mnt/jboss/bin/run.sh -c all
The shared /mnt/jboss directory structure will not be modified, all working files will be put in node specific /var/local/jboss sub directories !
Finally, just as you did for the conf/run.conf file, to modify the configuration of cluster nodes, just edit the files directly using the windows editor of your choice under the c:\jboss directory ... All cluster nodes will use those files. Dependencing on whether they are hot deployed or not, you may need to restart all instances of course.
Btw, if someone knows how to restart all nodes in the cluster partition, the tip would be helpfull ![]()
Enjoy !
28.08.07
Windows processor affinity
How to permanently mark a binary for processor affinity:
Permanent processor affinity
How to launch a program with a given affinity using the windows start command:
CPU Affinity Made Easy
The WinAPI call used to dynamically change a process affinity:
SetProcessAffinityMask
30.04.07
How to Generate a Thread Dump
Very handy.
26.04.07
Hyperic HQ - Web Infrastructure Management
Hyperic HQ 3.0.0 has been released. Hyperic HQ is an asset management package for data centers, showing users application, hardware, and resource data including system loads and availability.
Hyperic HQ allows you to track log events and configuration changes, plan alert escalations, and see trends in how the application stack performs.
23.04.07
Hermes JMS finally works with JBoss
I gave up hope in managing to get a JMS console to work with JBoss when a colleague of mine told me that he had successfully managed to get Hermes JMS 1.12 to work with JBoss AS 4.0.5 GA.
Simply follow the instructions given in this flash presentation.
Finally ... ![]()
13.03.07
eclipse-jmx - JMX Console for Eclipse IDE
eclipse-jmx is a plugin-in for Eclipse IDE which can be used to manage Java applications through JMX and its RMI Connector.
21.02.07
Howto activate subversion post commit log editing
Very handy. Trac doesn't catch the update though; must be some kind of cache ... annoying
19.02.07
Reverse-tunnelling SSH pour les nuls
Tout est dans le titre ![]()
26.05.06
Impossible d'utiliser mod_ssl conjointement avec un autre module d'authentification dans Apache HTTPD 2.0.54
C'est la plaie, je voulais tester l'authentification par certificat SSL, l'autorisation étant déléguée à un autre module grâce à la directive SSLOptions +FakeBasicAuth mais il semble y avoir un bug qui empêche de gérer les autorisations avec un autre module parce que la variable REMOTE_USER est affectée au DN complet du certificat client inutilisable par les autre modules.
Il y a bien la directive SSLUserName qui permet d'affecter la variable SSL que l'on veut à REMOTE_USER mais elle est ignorée lorsque