Monday, December 21, 2020

IBM MQ COLD Restart

 QMGR Recovery when the Disaster happens due to the Disk failures, Server crashes,Server restart without proper stopping QMGR or Human error’s like MQ administrator mistakenly delete QMGR active logs or Corrupted for some reason and unable to start the QMGR due to such failures . During such scenarios QMGR cold start is a very good technique to bring back the MQ from the Disaster failure.

We should verify the QMGR logs ,FFDC logs carefully to conclude the actives logs are corrupted due to any of the above mentioned reasons then only plan for Cold start .Other wise the check the logs for the reason and rectify based on the error . However we are discussing the situation where the active logs are no more or corrupted .

This document helps to understand how to recover qmgr when its active logs are corrupted. Take the backup of Entire /var/mqm/ before doing any changes  It will not take more space .

strmqm PROD.QM1  This will result below error

From the FDC logs/QMGR logs we see below error .

Take a backup copy of the qmgr data, log files any error logs/FDCs/dumps
Backup of /var/mmq/log/

Verify the existing QMGR /var/mqm/qmgrs/PROD.QM1/qm,ini file and take the below values from the QMGR. We will be creating TEMP QMGR with the exact  same attributes . We will not be starting this QMGR .

LogPrimaryFiles=100
LogSecondaryFiles=50
LogFilePages=2048
LogType=CIRCULAR

crtmqm –lc –lf 2048 –lp 100 –ls 50 TEMP

Once the TEMP QMGR is created we will not be starting this . We just need the active logs from /var/mqm/log/TEMP/active and /var/mqm/qmgrs/TEMP/amqalchk.fil file from TEMP QMGR to original QMGR .

/var/mqm/log/TEMP/active/* —> /var/mqm/log/PROD.QM1/active
/var/mqm/qmgrs/TEMP/amqalchk.fil —> /var/mqm/qmgrs/PROD.QM1/

We have replaced corrupted logs with the new logs .
Now start the QMGR with strmqm PROD.QM1
verify the status of QMGR using dspmq
Verify if there are any FDC logs , check the QMGR logs .If all the fine then verify the channel status . If all the channel status are good then we have successfully recovered the QMGR .

Please verify the connectivity with the Applications connecting to this qmgr.
Data in the queues is preserved if messages are persistent.

You can delete TEMP QMGR now . dltmqm TEMP

Monday, December 7, 2020

How to create DataSource in JBOSS

 Follow below steps for creating Data Source in JBOSS which will help for Application to connect DB using it .

STEP 1:
For MySQL
create directory structrue in /jboss/AppServer/jboss-eap-6.4/modules/
com/mysql .with in this create module.xml file with below content and copy driver jar file into this location
module.xml
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.0.8-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>

For MariaDB
copy jar to JBOSS_HOME/modules/org/mariadb/main/
copy jar to JBOSS_HOME/modules/org/mariadb/
create module.xml with the below . Maria DB jar and will beloaded during jboss startup and the class from the jar refered in DataSource for connecting to DB
<module xmlns="urn:jboss:module:1.1" name="org.mariadb">
<resources>
<resource-root path="mariadb-java-client-1.3.3.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
STEP 2:Install Driver

Add driver with in <drivers> tag on domain.xml under full-ha profile .This diver will be visible when we create datasouce from JBOSS console .
For mysql
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
For db2
<driver name="mariadb" module="com.mariadb">
<xa-datasource-class>org.mariadb.jdbc.MariaDbDataSource</xa-datasource-class>
<drivers>
<driver name="db2" module="com.ibm.db2">
<driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
</driver>
For MariaDB
<driver name="mariadb" module="com.mariadb">
<xa-datasource-class>org.mariadb.jdbc.MariaDbDataSource</xa-datasource-class>
STEP 3:Creation DATA SOURCE

Login to JBOSS consile using jbadmin
Go to Configuration tab --> Select full-ha profile in dropdown box -->click on ADD Enter Name :MySqlDS JNDI Name:java:/jdbc/MySqlDS
-->click on next select the previously added driver and click on next
-->Provide Conection url UserName & Password then SAVE and do test connection .


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...