Category: mq

  • IBM MQ crtmqm instance issue

    Morning,

    Short notice. If you are trying to create a queue manager and receive following error:

    AMQ8101: WebSphere MQ error (893) has occurred.

    and you also have lots of space in you qmgrs and log directory, don’t look further than that.

    In some cases it happens because the install in /var/mqm is not complete. The small fix was by manually defining /var/mqm/mqs.ini, but i advise you to reinstall the framework.

    Before:

    $ ls -ltr /var/mqm/
    total 8
    drwxr-xr-x    2 root     system          256 Mar 21 13:14 lost+found
    drwxrwsrwt    2 mqm      mqm             256 Mar 29 15:22 trace
    drwxrwsr-x    3 mqm      mqm             256 Mar 29 15:22 qmgrs
    drwxrwsr-x    3 mqm      mqm             256 Mar 29 15:22 sockets
    drwxrwsr-x    3 mqm      mqm             256 Mar 29 15:22 shared
    drwxrwsrwt    2 mqm      mqm            4096 Apr 03 12:10 errors
    

    After:

    $ ls -ltr /var/mqm
    total 32
    drwxr-xr-x    2 root     system          256 Mar 21 13:14 lost+found
    drwxrwsrwx    2 mqm      mqm             256 Mar 29 15:22 trace
    drwxrwsrwx    2 mqm      mqm            4096 Apr 03 12:10 errors
    drwxrwsr-x    3 mqm      mqm             256 Apr 03 12:14 sockets
    drwxrwsr-x    3 mqm      mqm             256 Apr 03 12:14 qmgrs
    drwxrwsr-x    2 mqm      mqm             256 Apr 03 12:20 config
    drwxrwsr-x    3 mqm      mqm             256 Apr 03 12:20 conv
    drwxrwsr-x    2 mqm      mqm             256 Apr 03 12:20 log
    -rw-rw-r--    1 mqm      mqm            1941 Apr 03 12:20 service.env
    drwxrwsr-x    5 mqm      mqm             256 Apr 03 12:20 mqft
    drwxrwsr-x    4 mqm      mqm             256 Apr 03 12:20 shared
    -rw-rw-r--    1 mqm      mqm            1156 Apr 03 12:20 mqs.ini
    -rw-rw-r--    1 mqm      mqm             637 Apr 03 12:20 mqclient.ini
    drwxrwsr-x    3 mqm      mqm             256 Apr 03 12:20 exits
    drwxrwsr-x    3 mqm      mqm             256 Apr 03 12:20 exits64
    

    Cheers!

  • Migrating Websphere MQ 7.0.1 to IBM MQ 8.0.0.x

    Hi,

    Since there aren’t that many things new that i have done regarding Kafka and opensource software, i want to share with you this, not to be lost on a distant gitlab repo my IBM MQ migration steps and script.

    In order to migrate an instance from an older version (without support ) to a newer version, even IBM recommended  that you leave it as is, just stop it and migrate the packages after that you can use a script which i will provide below.

    First step is to stop the running queue managers using the following command:

    for i in $(dspmq | cut -d'(' -f2 | cut -d')' -f1); do endmqm $i; done

    If it fails and connections still remain unclosed, you can try using endmqm -i instead of endmqm. After the feedback is returned that queue managers are stopped, just to be sure, you can extra check it using a simple ps -ef | grep amq. Please check the status of the MQ listener as well, doing it with ps -ef | grep mqlsr. After you made sure everything is stopped, you can contact your AIX admin to commit the new packages. This should be checked using lslpp -l | greep mqm, an example output looks like this:

    # lslpp -l | grep mqm
      mqm.base.runtime           8.0.0.6  COMMITTED  IBM WebSphere MQ Runtime for
      mqm.base.samples           8.0.0.6  COMMITTED  IBM WebSphere MQ Samples
      mqm.base.sdk               8.0.0.6  COMMITTED  IBM WebSphere MQ Base Kit for
      mqm.client.rte             8.0.0.6  COMMITTED  IBM WebSphere MQ Client for
      mqm.java.rte               8.0.0.6  COMMITTED  IBM WebSphere MQ Java Client,
      mqm.msg.en_US              8.0.0.6  COMMITTED  IBM WebSphere MQ Messages -
      mqm.server.rte             8.0.0.6  COMMITTED  IBM WebSphere MQ Server
      mqm.base.runtime           8.0.0.6  COMMITTED  IBM WebSphere MQ Runtime for
    

    You now know you can get forward with the migration, and in that purpose you can also use the script below, it’s not bullet proof but you can change it and modify it for you needs:

    #!/usr/bin/ksh
    echo ". /usr/mqm/bin/setmqenv -s" >> $HOME/.profile
    env | grep PATH | grep /usr/mqm/bin > /dev/null
    if [ "$?" -ne "0" ];then
    	export PATH=$PATH:/usr/mqm/bin
    fi
    SYSTEM_CRITICAL_VAL=`mqconfig | grep CRITICAL`
    if [ "$?" -eq "0" ];then
    	echo "System values for MQ installation are not OK, please check $SYSTEM_CRITICAL_VAL"
    	exit
    fi
    INSTALLATION_NAME=`dspmqver | grep InstName | cut -d':' -f2 | sed 's/ //g'`
    for i in $(dspmq | cut -d'(' -f2 | cut -d')' -f1);do
    	echo "Queue manager ${i} is being set to installation ${INSTALLATION_NAME}"
    	setmqm -m $i -n $INSTALLATION_NAME
    	#echo $?
    	if ([ "$?" -eq "0" ] || [ "$?" -eq "59" ]);then
    		echo "Starting instance $i"
    		strmqm $i
    		if [ "$?" -eq "0" ];then
    		sleep 10
    		echo "ALTER QMGR CHLAUTH(DISABLED) " | runmqsc $i
    		echo "ALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKLOCL(NONE) CHCKCLNT (NONE)" | runmqsc $i
    		echo "REFRESH SECURITY TYPE(AUTHSERV)" | runmqsc $i
    		echo "ALTER CHL('SYSTEM.DEF.SVRCONN') CHLTYPE(SVRCONN) MAXMSGL(104857600) HBINT(300) MAXINST(999999999) MCAUSER('mqm') SSLCAUTH(OPTIONAL) "| runmqsc $i
    		endmqm -i $i
    		sleep 30
    		fi
    	fi
    done	

    Once this is done, you should have been migrated to MQ 8 and can connect to it using SYSTEM.DEF.SVRCONN which has MCAUSER setup to mqm. Please keep in mind that this a temporary solution and that  IBM MQ connection policies should be enabled for channel connect (you can also opt for a different user on the server connect channel and authorize just the objects that you connector needs)

    That should be all for today,

    Cheers!