Activities

July 2014
M T W T F S S
« Jun   Aug »
 123456
78910111213
14151617181920
21222324252627
28293031  

Running multiple Glassfish instances in a server

One of the client to want to use 3 Glassfish environment for his Dev,QA and UAT purpose. He does not wish to pay separate servers for these low priority application roles.

System requirements

1. Have more RAM (16GB is fine) and medium computing power
2. 3 static IP for 3 environments
3. Glassfish installation
.

Process is simple as you need to start a Glassfish server running with a stable domain configuration file(domain.xml). Then take the backup and we need to update the port binding hostname reference associate with each services. You may need to update 13 area to listen glassfish on our custom IP’s

1.

<iiop-listener port="3700" id="orb-listener-1" address="192.168.10.121" lazy-init="true"></iiop-listener>
        <iiop-listener port="3820" id="SSL" address="192.168.10.121" security-enabled="true">

2.

 <iiop-listener port="3920" id="SSL_MUTUALAUTH" address="192.168.10.121" security-enabled="true">

3.

<jmx-connector port="8686" address="192.168.10.121" security-enabled="false" auth-realm-name="admin-realm" name="system"></jmx-connector>

4.

<jms-host host="192.168.10.121" name="default_JMS_host" admin-password="adminadmin"></jms-host>

5.

<network-listener port="80" protocol="pu-protocol" address="192.168.10.121" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool">
          <network-listener port="443" protocol="http-listener-2" address="192.168.10.121" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="4848" protocol="admin-listener" address="192.168.10.121" transport="tcp" name="admin-listener" thread-pool="admin-thread-pool"></network-listener>

6.

<iiop-listener port="${IIOP_LISTENER_PORT}" id="orb-listener-1" address="192.168.10.121"></iiop-listener>
<iiop-listener port="${IIOP_SSL_LISTENER_PORT}" id="SSL" address="192.168.10.121" security-enabled="true">
<iiop-listener port="${IIOP_SSL_MUTUALAUTH_PORT}" id="SSL_MUTUALAUTH" address="192.168.10.121" security-enabled="true">

7.

<jmx-connector port="${JMX_SYSTEM_CONNECTOR_PORT}" address="192.168.10.121" security-enabled="false" auth-realm-name="admin-realm" name="system"></jmx-connector>

8.

<jms-host port="${JMS_PROVIDER_PORT}" host="192.168.10.121" name="default_JMS_host"></jms-host>

Once you set everything you can see that Glassfish JAVA process is listening only on our given IP’s

 [root@fc-web09 ~]# netstat -nlp | grep "java"
tcp        0      0 ::ffff:192.168.10.121:8686  :::*                        LISTEN      9324/java
tcp        0      0 ::ffff:192.168.10.121:4848  :::*                        LISTEN      9324/java
tcp        0      0 ::ffff:192.168.10.121:80    :::*                        LISTEN      9324/java
tcp        0      0 ::ffff:192.168.10.121:3700  :::*                        LISTEN      9324/java
tcp        0      0 ::ffff:192.168.10.121:443   :::*                        LISTEN      9324/java
tcp        0      0 ::ffff:192.168.10.121:7676  :::*                        LISTEN      9324/java
[root@fc-web09 ~]#

🙂 So Glassfish instances are in a server is not limited yet. If you are running in a NATd environment, you can create VIP with respect to the private IP associate with the domain easily.

If you want to customizing the JVM options,


-Xloggc:gc.log
-XX:+PrintHeapAtGC
-XX:SurvivorRatio=6
-XX:+UseParallelGC
-verbose:gc
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails
-XX:HeapDumpPath=/var/glassfish/domains/domain1/logs
-XX:-HeapDumpOnOutOfMemoryError
-XX:-UseCompressedOops
-XX:MaxPermSize=300m
-XX:PermSize=64m
-XX:+OptimizeStringConcat
-XX:+AggressiveOpts
-XX:-UseLoopPredicate
-XX:-UseSplitVerifier
-server
-Djava.awt.headless=true
-Djavax.management.builder.initial=com.sun.enterprise.v3.admin.AppServerMBeanServerBuilder
-XX:+UnlockDiagnosticVMOptions
-Djava.endorsed.dirs=${com.sun.aas.installRoot}/modules/endorsed${path.separator}${com.sun.aas.installRoot}/lib/endorsed
-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy
-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-Xmx6144m
-Xms6144m
-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks
-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks
-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>