Monday, August 5, 2019

Enable JMX on Weblogic and connect using visualVM

Every one have requirement to monitor the Weblogic performance in terms for Heap, GC, class loading ..etc during project development phase for performance stats /Load test results . As a part of this we will be seeing how we can enable JMX port in Weblogic and monitor each JVM for the details statics .

Please note there is some level of Monitoring available in Weblogic but that is instant value at that current point of time . We can not see the historical data for ex past 1 hour data . So enable JMX port on Weblogic and connect to Weblogic using tools like Jconsole,JVisualVM ,Java Machine control (JMC) using it core technology protocol . by having this we can do highly efficient performance tuning debugging tasks like flight recordings etc

Steps for enabling JMX is sam in Weblogic 10 ,11g ,12c, and 14c .

setDomainEnv.sh (or) setDomainEnv.cmd file can be found in the weblogic DOMAIN_HOME/bin directory to configure JVM arguments.

Unix – setDomainEnv.sh

JAVA_OPTIONS="${JAVA_OPTIONS}
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
export JAVA_OPTIONS


Windows – setDomainEnv.cmd

set JAVA_OPTIONS=%JAVA_OPTIONS%
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

Add the above in the respective files and restart Weblogic .

setDomainEnv file is global and the parameter . so the port which is configure can be usable by only one JVM which ever starts first and other will get port conflicts . So We need to add different port for each JVM for this . Port can be anything available on the server.

As per my Experience there will be custom script defined for each JVM so better Add the above given JVM arguments individually for each JVM so that which ever JVM you want to connect can easily connect .

In other way you can add in setDomanEnv file with an if condition for each of you JVM like below . In your case JVM name's may be different .

JAVA_OPTIONS="${JAVA_OPTIONS}"
export JAVA_OPTIONS

if [ "$SERVER_NAME" == "AdminSer" ]
then
JAVA_OPTIONS="${JAVA_OPTIONS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
export JAVA_OPTIONS

elif [ "$SERVER_NAME" == "AppSrv01" ]
then
JAVA_OPTIONS="${JAVA_OPTIONS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11112 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
export JAVA_OPTIONS
fi

use jconsole hostname:port to connect from jconsoe

or double click jvisualVM and connect using IP and PORT without credentials .

Above is an insecure way of connecting . If you want to try in Highr environments then better use below

-Dcom.sun.management.jmxremote.password.file=jmxremote.password
-Dcom.sun.management.jmxremote.authenticate=true
Here we have used the access configuration files named jmxremote.access and jmxremote.password

jmxremote.access file
# The "monitor" role has readonly access.
# The "admin" role has readwrite access.
monitor readonly
admin readwrite
jmxremote.password file
# specify actual password instead of the text password
monitor password
admin password

Hope this help!!!

Tuesday, May 7, 2019

How to Setup IBM MQ Gateway QMGR

 A queue manager on which the interface queues are not located, but on which they are defined as cluster queues. Such a queue manager is called a gateway queue manager.

Sample Diagram for Gate Way QMGR

Created 3 QMGRS in TEST cluster

dis clusqmgr(*)
     2 : dis clusqmgr(*)
AMQ8441I: Display Cluster Queue Manager details.
   CLUSQMGR(FR1)                           CHANNEL(TO.FR1)
   CLUSTER(TEST)                        
AMQ8441I: Display Cluster Queue Manager details.
   CLUSQMGR(FR2)                           CHANNEL(TO.FR2)
   CLUSTER(TEST)                        
AMQ8441I: Display Cluster Queue Manager details.
   CLUSQMGR(GWQM)                          CHANNEL(TO.GWQM)
   CLUSTER(TEST)                        

Here FR1 and FR2 actually hold the interface queue .Ex QL1
Application connecting to GRQM doenst hold the actual Queue but puts a message into an interface queue because the queue is not managed by GWQM .GWQM checks its cluster queue defninitions.It recognizes that QL1 is managed by FR1,Fr2 so GWQM puts the message to QL1 on one of the QMGR's (FR1,FR2). subsequent messages will be load balenced to FR1 and FR2

define ql(QL1) cluster(Test) defbind(notfixed)
Defined QL1 on Both FR1 and FR2

Sending 10 messages to QL1 using GWQM

bash-4.4$ cat put.sh 
 #!/bin/bash
 for i in `seq 10` ; do
  echo "Sending $i message"
  echo "Test MSG $i" |/opt/mqm/samp/bin/amqsput QL1 GWQM >/dev/null 2>&1
 done 
bash-4.4$

Verify the messages on FR1 QL1

bash-4.4$ /opt/mqm/samp/bin/amqsget QL1 FR1
Sample AMQSGET0 start
message <Test MSG 2>
message <Test MSG 4>
message <Test MSG 6>
message <Test MSG 8>
message <Test MSG 10>
no more messages
Sample AMQSGET0 end
bash-4.4$ 

Verify the messages on FR2 QL1

bash-4.4$ /opt/mqm/samp/bin/amqsget QL1 FR2
Sample AMQSGET0 start
message <Test MSG 1>
message <Test MSG 3>
message <Test MSG 5>
message <Test MSG 7>
message <Test MSG 9>
no more messages
Sample AMQSGET0 end
bash-4.4$ 

Messages can also be routed to a gateway queue manager from queue managers that are external to the cluster. Refer below Diagram .

Application have its own QMGR (non-cluster) and it connects to GWQM . If the Application side has another MQ cluster then GWQM will be used to OverLap two cluster's

Monday, April 1, 2019

MQ 9.2 Patching on Linux Server

 

Firstly download the latest fix pack from IBM site . In our case we are patching 9.2.0.1 on a Linux server . Follow below steps .

1.Upload the fix pack 9.2.0-IBM-MQ-LinuxX64-FP0001.tar.gz to server /tmp or any other directory where we have enough space .

2.If there are any QMGR's running .Bring down those .

endmqm -i QMGRName

3.Take the backup of /var/mqm directory where the QMGR data will be stored .

mq fixpack extraction

4.Install MQ fix pack

FP Contents
FP Installation

5.Verify MQ version to see the latest fix pack reflected.

List All the MQ installed packages 
[root@ip-172-31-14-154 FP]# rpm -qa |grep -i MQ
MQSeriesMsg_ja-9.2.0-0.x86_64
MQSeriesMsg_ru-9.2.0-0.x86_64
MQSeriesSDK-9.2.0-0.x86_64
MQSeriesServer-U9201-9.2.0-1.x86_64
MQSeriesFTLogger-U9201-9.2.0-1.x86_64
MQSeriesXRService-U9201-9.2.0-1.x86_64
MQSeriesExplorer-U9201-9.2.0-1.x86_64
MQSeriesMsg_de-U9201-9.2.0-1.x86_64
MQSeriesMsg_it-U9201-9.2.0-1.x86_64
MQSeriesMsg_pt-U9201-9.2.0-1.x86_64
MQSeriesSamples-U9201-9.2.0-1.x86_64
MQSeriesJava-9.2.0-0.x86_64
MQSeriesFTAgent-9.2.0-0.x86_64
MQSeriesFTLogger-9.2.0-0.x86_64
MQSeriesFTTools-9.2.0-0.x86_64
MQSeriesMan-9.2.0-0.x86_64
MQSeriesMsg_fr-9.2.0-0.x86_64
MQSeriesMsg_it-9.2.0-0.x86_64
MQSeriesMsg_ko-9.2.0-0.x86_64
MQSeriesMsg_pt-9.2.0-0.x86_64
MQSeriesMsg_Zh_CN-9.2.0-0.x86_64
MQSeriesSamples-9.2.0-0.x86_64
MQSeriesRuntime-U9201-9.2.0-1.x86_64
MQSeriesJava-U9201-9.2.0-1.x86_64
MQSeriesFTBase-U9201-9.2.0-1.x86_64
MQSeriesFTService-U9201-9.2.0-1.x86_64
MQSeriesFTTools-U9201-9.2.0-1.x86_64
MQSeriesAMS-U9201-9.2.0-1.x86_64
MQSeriesBCBridge-U9201-9.2.0-1.x86_64
MQSeriesClient-U9201-9.2.0-1.x86_64
MQSeriesGSKit-U9201-9.2.0-1.x86_64
MQSeriesMsg_cs-U9201-9.2.0-1.x86_64
MQSeriesMsg_es-U9201-9.2.0-1.x86_64
MQSeriesMsg_hu-U9201-9.2.0-1.x86_64
MQSeriesMsg_ja-U9201-9.2.0-1.x86_64
MQSeriesMsg_pl-U9201-9.2.0-1.x86_64
MQSeriesMsg_ru-U9201-9.2.0-1.x86_64
MQSeriesMsg_Zh_TW-U9201-9.2.0-1.x86_64
MQSeriesSDK-U9201-9.2.0-1.x86_64
MQSeriesJRE-9.2.0-0.x86_64
MQSeriesFTBase-9.2.0-0.x86_64
MQSeriesServer-9.2.0-0.x86_64
MQSeriesFTService-9.2.0-0.x86_64
MQSeriesAMS-9.2.0-0.x86_64
MQSeriesWeb-9.2.0-0.x86_64
MQSeriesClient-9.2.0-0.x86_64
MQSeriesBCBridge-9.2.0-0.x86_64
MQSeriesExplorer-9.2.0-0.x86_64
MQSeriesMsg_cs-9.2.0-0.x86_64
MQSeriesMsg_es-9.2.0-0.x86_64
MQSeriesMsg_hu-9.2.0-0.x86_64
MQSeriesMsg_pl-9.2.0-0.x86_64
MQSeriesMsg_Zh_TW-9.2.0-0.x86_64
MQSeriesJRE-U9201-9.2.0-1.x86_64
MQSeriesFTAgent-U9201-9.2.0-1.x86_64
MQSeriesAMQP-U9201-9.2.0-1.x86_64
MQSeriesSFBridge-U9201-9.2.0-1.x86_64
MQSeriesMan-U9201-9.2.0-1.x86_64
MQSeriesMsg_fr-U9201-9.2.0-1.x86_64
MQSeriesMsg_ko-U9201-9.2.0-1.x86_64
MQSeriesMsg_Zh_CN-U9201-9.2.0-1.x86_64
MQSeriesWeb-U9201-9.2.0-1.x86_64
MQSeriesRuntime-9.2.0-0.x86_64
MQSeriesGSKit-9.2.0-0.x86_64
MQSeriesAMQP-9.2.0-0.x86_64
MQSeriesXRService-9.2.0-0.x86_64
MQSeriesSFBridge-9.2.0-0.x86_64
MQSeriesMsg_de-9.2.0-0.x86_64
[root@ip-172-31-14-154 FP]# 

After successful MQ fix pack we can bring up the QMGR's and verify the Application connectivity .

Featured

Weblogic Domain Migration

 In this blog we will see domain re-configuration which will be done as part of Weblogic migration from lower version to higher version [ Ex...