{"id":6459,"date":"2017-02-02T16:00:22","date_gmt":"2017-02-02T08:00:22","guid":{"rendered":"http:\/\/rmohan.com\/?p=6459"},"modified":"2017-02-02T16:00:22","modified_gmt":"2017-02-02T08:00:22","slug":"mq-8-on-centos-6-8","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6459","title":{"rendered":"MQ 8 on CENTOS 6.8"},"content":{"rendered":"<p><strong>MQ 8 on CENTOS 6.8<\/strong><\/p>\n<p>WebSphere MQ installation and validation<\/p>\n<p>WebSphere MQ installation and validation<br \/>\nready<br \/>\n1 Check the installation hardware and software requirements<br \/>\n2 Installation Notes<br \/>\nSingle server installs MQ and authentication<br \/>\n1 Create a user and user group Optional step<br \/>\n2 Extract the downloaded MQ installation package<br \/>\n3 Check if the rpm package is installed<br \/>\n4 Review the license agreement and accept the required<br \/>\n5 Install the MQ Server components<br \/>\n6 Verify that the installation was successful<br \/>\nDual-server installation of MQ and authentication<br \/>\n1 Preparation<br \/>\n2 Configure the B machine<br \/>\n3 Configure the A machine<br \/>\n4 Authentication<br \/>\nMQ client installation and validation<br \/>\n1 Preparation<br \/>\n2 Configure the MQ server B machine<br \/>\n3 Configure the MQ client C machine<br \/>\n4 Test the connectivity between the client and the server<br \/>\nUnload MQ<br \/>\nOther records<\/p>\n<p>1. Preparation<br \/>\n1.1 Check the installation hardware and software requirements<\/p>\n<p>Check MQ installation conditions, SUSE Linux 64-bit installation requirements are as follows: here to the latest 9.0, 8.0 example<br \/>\n&#8211; MQ 9.0 operating system requires SUSE Linux Enterprise Server 12 SP1 x86-64, 8.0 SUSE Linux 11 SP2<br \/>\n&#8211; The HyperVisor virtualization platform supports VMware ESXi 5.5 and above, and Hyper-V supports 2012, KVM<br \/>\n&#8211; Supported software: WAS, gcc4.8 or above, DB2 10.5.0.6, IBM JRE (most components only support built-JRE)<br \/>\n&#8211; Disk space requires 1GB (server component installation), memory recommended 3GB<\/p>\n<p>Specific see the official website to provide the requirements of the various platforms, including version MQ 9.0, MQ 8.0<br \/>\n1.2 Installation Precautions<\/p>\n<p>About the installation name<\/p>\n<p>Determine the unique installation name, incremented by Installation1,2 by default, and Installation0 reserved for the 7.0.1 MQ installation name<br \/>\nThe installation name can not be changed after successful installation<br \/>\nNames require upper and lower case letters and numbers, no spaces, case insensitive, up to 16 bytes<br \/>\nInstallation description information, you can set a 64-byte description, allowing Chinese and English<br \/>\nLinux use crtmqinst command to set the installation name, setmqinst command to set the description information<\/p>\n<p>Multiple copies are installed<\/p>\n<p>MQ supports single mount multiple copies (multiple versions or different installations of the same version), differentiated by different installation locations<br \/>\nA single machine supports up to 128 copies of the installation<br \/>\nMulti-copy installation can set up a master copy, the system will create environment variables and symbolic links, part of the management script command function requires these settings;<br \/>\nMulti-copy installations that support MQ 7.0 fp6 later, for installations that require multiple copies 7.0.1 Must be the first installation and automatically a master installation copy<br \/>\nPrior to MQ 7, only one product instance could be installed on a single machine<\/p>\n<p>Single copy installation<br \/>\n&#8211; Beginning with version 7.1, the first copy of the MQ installation on Windows defaults to the master copy. Linux needs to be configured manually (the setmqinst command)<br \/>\n&#8211; It is recommended that you set up a master installation copy so that MQ commands and libraries can be easily applied and create symbolic links under \/ usr \/ lib, \/ usr \/ bin \/, \/ usr \/ include<br \/>\n&#8211; For non-primary installation copies, manually set the environment variables and the library path configuration, such as LD_INSTALLATION_PATH<\/p>\n<p>Installation location<br \/>\n&#8211; Linux default installation location \/ opt \/ mqm, working data directory \/ var \/ mqm<br \/>\n&#8211; Linux path length up to 256 bytes, no spaces allowed<br \/>\n&#8211; The installation path can not have subdirectories and partial paths of the installed MQ path<br \/>\n&#8211; Typical installation paths: \/opt\/IBM\/MQ and \/opt\/IBM\/MQnew or \/opt\/IBM\/MQ\/installations\/1 and \/opt\/IBM\/MQ\/installations\/2<\/p>\n<p>MQ Installation Components (Linux)<br \/>\n&#8211; Runtime (MQSeriesRuntime), the runtime environment, must be installed (both client and server)<br \/>\n&#8211; Server (MQSeriesServer), running the queue manager and providing message queue services, the server-side needs<br \/>\n&#8211; Client (MQSeriesClient), a small subset of the functionality of MQ, a connection to the Server component, no queue manager<br \/>\n&#8211; SDK (MQSeriesSDK), development needs, used to compile the application<br \/>\n&#8211; Sample program, sample program<br \/>\n&#8211; Java messaging (MQSeriesJava), support Java Message Service Function (JMS)<br \/>\n&#8211; Man pages, help documentation, provide control commands, MQI commands, MQSC command help<br \/>\n&#8211; Java JRE, must, Java runtime, support the MQ part of Java written functions<br \/>\n&#8211; Message Catalogs, supported languages<br \/>\n&#8211; Global Security Kit, which supports encryption and security authentication, must be installed JRE<br \/>\n&#8211; Telemetry Service (MQSeriesXRService), remote sensing communication MQTT protocol, support for sensors and other devices to connect communication<br \/>\n&#8211; MQ Explorer, Management Monitor MQ<br \/>\n&#8211; Managed File Transfer, file transfer<br \/>\n&#8211; Advanced Message Security, the more advanced security, you must install the JRE and Security Kit<br \/>\n&#8211; AMQP Service, providing AMQP channel, support MQ Light APIs<br \/>\n2. Stand-alone server to install MQ and authentication<\/p>\n<p>This article uses SUSE Linux Enterprise 11 x64 SP4 system, installed in the virtual machine environment, MQ selected version 8.0.<br \/>\nBefore you install MQ, you need to set up the operating system.<br \/>\n2.1 Creating Users and User Groups (Optional)<\/p>\n<p>On Linux, MQ needs to create the install user mqm and the user group mqm (be careful to ensure that the UID and GID are consistent when installing MQ with multiple systems or multiple instances)<br \/>\nThe user ID has permissions to the MQ installation directory and files. The default MQ installation is automatically created when no mqm user is found.<br \/>\nYou need to specify a specific UID and GID as the installation user for MQ, and you can manually create users and groups before installation.<br \/>\nPrivilege Requirement: The normal user must belong to the mqm group to run the related administrative commands, such as crtmqm (create queue manager) and strmqm (start queue manager) commands<\/p>\n<p># groupadd -g 3000 mqm<br \/>\n# useradd -g mqm -u 3000 mqm<\/p>\n<p>2.2 Extract the downloaded MQ installation package<\/p>\n<p># su &#8211; root<br \/>\n# cd \/home\/mq<br \/>\n# tar -xvf WSMQ_8.0_IFR_TRIAL_LNX_ON_X86_64_.tar.gz<\/p>\n<p>2.4 Viewing the License Agreement and Accepting (Required)<\/p>\n<p># cd \/home\/mq\/server<br \/>\n# .\/mqlicense.sh -text_only<\/p>\n<p>2.5 Install the MQ Server components<\/p>\n<p>Installed in the default location \/opt\/mqm, if you need to change to join &#8211; prefix \/opt\/mymq<\/p>\n<p>rpm -ivh MQSeriesRuntime-*.rpm MQSeriesServer-*.rpm<\/p>\n<p>WARNING: System settings for this system do not meet recommendations for this product<br \/>\nSee the log file at &#8220;\/tmp\/mqconfig.11472.log&#8221; for more information<\/p>\n<p>more \/tmp\/mqconfig.11472.log<\/p>\n<p>sysctl -a | more<\/p>\n<p>Modify sysctl.conf file, mqconfig.11472.log not pass parameters modified<br \/>\nSp4 linux suse main file-max, nofile failed to detect<\/p>\n<p>Add a line, note the space\u00a0 Sets the maximum number of kernel open files<br \/>\nvim \/etc\/sysctl.conf<\/p>\n<p>fs.file-max = 524288<\/p>\n<p>View the maximum number of files that can be opened by the user process<\/p>\n<p>View the maximum number of files that can be opened by the user process<br \/>\n# su &#8211; mqm<br \/>\n# Ulimit -n shows 1024, and MQ requires 10240<br \/>\nIncrease the maximum number of mqm users to open files<br \/>\n# su &#8211; root<br \/>\n# vim \/etc\/security\/limits.conf<br \/>\nAdd to:<br \/>\nmqm hard nofile 10240<br \/>\nmqm hard nofile 10240<br \/>\nroot hard nofile 10240<br \/>\nroot hard nofile 10240<\/p>\n<p># su &#8211; root<br \/>\n# ulimit -n<br \/>\nView the display 10240 is to take effect<\/p>\n<p>rpm -ivh MQSeriesRuntime-*.rpm MQSeriesServer-*.rpm<br \/>\nprompt:<br \/>\npackage MQSeriesRuntime-8.0.0-2.x86_64 is already installed<br \/>\npackage MQSeriesServer-8.0.0-2.x86_64 is already installed<\/p>\n<p># rpm -q MQSeriesServer<br \/>\n# rpm -e MQSeriesServer-8.0.0-2<br \/>\n# rpm -q MQSeriesRuntime<br \/>\n# rpm -e MQSeriesRuntime-8.0.0-2<\/p>\n<p># cd \/home\/mq\/server<br \/>\n# .\/mqlicense<br \/>\n# rpm -ivh MQSeriesRuntime-*.rpm MQSeriesServer-*.rpm<\/p>\n<p>2.6 Verify that the installation was successful<\/p>\n<p>Verify that you need to install the built-in sample package component, MQSeriesSamples-8.0.0-2.x86_64.rpm<br \/>\nExamples of Authentication Complete the functions of creating and configuring a queue manager, sending messages to a queue, and getting messages from a queue<\/p>\n<p># rpm -ivh MQSeriesSamples-8.0.0-2.x86_64.rpm<\/p>\n<p># su &#8211; mqm<br \/>\nSet the environment variable<br \/>\n~ cd \/opt\/mqm\/bin<br \/>\n~ .\/setmqenv -s<\/p>\n<p>An error occurred:<br \/>\nAMQ8595: The setmqenv command was not preceded by the source command<br \/>\nFor an official explanation, see [Web site] (http:\/\/www.ibm.com\/support\/knowledgecenter\/SSFKSJ_7.5.0\/com.ibm.mq.ref.doc\/amq8.htm)<br \/>\nNeed to order the implementation of the source, not. \/ Or bash setmqenv way;<br \/>\nSource or setmqenv -s: is in the current shell environment variables<br \/>\nBash setmqenv or. \/ Setmqenv: will open a new sub-shell settings,<br \/>\nset up after the return to the parent shell, set the variable can not change the parent shell<\/p>\n<p>source setmqenv -s<br \/>\nCheck whether the set is successful, the implementation of the query mq version information command<\/p>\n<p>~ dspmqver<\/p>\n<p>Create the queue manager QMA<br \/>\n~crtmqm QMA<br \/>\nStarts queue management<br \/>\n~strmqm QMA<\/p>\n<p>To start the MQ script interpreter:<br \/>\n~runmqsc QMA<\/p>\n<p>Define the local queue in the script interpreter:<br \/>\nDEFINE QLOCAL (QUEUE1)<\/p>\n<p>Stop MQSC:<br \/>\nEnd<\/p>\n<p>Go to the sample component directory:<br \/>\n~cd \/opt\/mqm\/samp\/bin<br \/>\n~.\/amqsput QUEUE1 QMA<br \/>\nEnter the sent test message:<br \/>\ntest messages from john<br \/>\ntest2 messages<br \/>\nType enter twice to end with a blank line<\/p>\n<p>Retrieves the message from the queue<br \/>\n.\/amqsget QUEUE1 QMA<\/p>\n<p>3. Double-server installation of MQ and authentication<\/p>\n<p>This approach requires two servers, and are installed MQ server, one for sending, one is responsible for receiving messages, which is commonly used MQ scene.<\/p>\n<p>3.1 Preparation<\/p>\n<p>Two virtual machine A machine (192.168.98.129), B machine (192.168.98.130), two must be able to communicate with each other network, you can use the ping test<br \/>\nA machine and B machine in accordance with the single-server installation (2.1-2.5 steps, not 2.6 verification) Server, Runtime, Sample installed three components.<br \/>\nA machine as a sending server (sender), B machine as a receiving server (receiver)<\/p>\n<p>3.2 Configuration B machine<\/p>\n<p>Log in as root and switch to the mqm user<br \/>\n# su &#8211; mqm<br \/>\n~ cd \/opt\/mqm\/bin<br \/>\n~ source setmqenv -s<br \/>\n~ crtmqm QMB<br \/>\n~ strmqm QMB<br \/>\n~ runmqsc QMB<\/p>\n<p>Input: DEFINE QLOCAL (RECEIVER.Q) Defines the local queue RECEIVER.Q<br \/>\nContinue typing: DEFINE LISTENER (LISTENER1) TRPTYPE (TCP) CONTROL (QMGR) PORT (1414) Defines a listener to receive messages<br \/>\nEnter: START LISTENER (LISTENER1)\u00a0 Starts the listener<br \/>\nInput: DEFINE CHANNEL (QMA.QMB) CHLTYPE (RCVR) TRPTYPE (TCP) Defines the receiver channel<br \/>\nType: end and press Enter to end the input<\/p>\n<p>3.3 Configuration A machine<\/p>\n<p>The same root user login, switch to mqm users<br \/>\n# su &#8211; mqm<br \/>\n~ cd \/opt\/mqm\/bin<br \/>\n~ source setmqenv -s<br \/>\n~ crtmqm QMA<br \/>\n~ strmqm QMA<br \/>\n~ runmqsc QMA<\/p>\n<p>Input: D?DEFINE QLOCAL (QMB) USAGE (XMITQ) Defines the local queue QMB as a transmission queue<\/p>\n<p>Access local definition of remote queue LOCAL.DEF.OF.REMOTE.QUEUE<br \/>\nThis definition indicates that the transmit queue QMB of the A machine sends a message to the remote queue (QMB, RECEIVER.Q on the B)<\/p>\n<p>Input: DEFINE QREMOTE (LOCAL.DEF.OF.REMOTE.QUEUE) RNAME (RECEIVER.Q) RQMNAME (&#8216;QMB&#8217;) XMITQ (QMB)<\/p>\n<p>To define the transmit channel:<br \/>\nDEFINE CHANNEL (QMA.QMB) CHLTYPE (SDR) CONNAME (&#8216;192.168.98.130(1414)&#8217;) XMITQ (QMB) TRPTYPE (TCP)<br \/>\nstart up:<br \/>\nSTART CHANNEL (QMA.QMB)<\/p>\n<p>End:<br \/>\nend<\/p>\n<p>3.4 Verification<\/p>\n<p>Enter A machine, using the sample program to verify<\/p>\n<p># su &#8211; mqm<br \/>\n~ cd \/opt\/mqm\/samp\/bin<br \/>\n~ .\/amqsput LOCAL.DEF.OF.REMOTE.QUEUE QMA<br \/>\nAt this point you can easily enter the information in the B machine view<br \/>\nFor example: Test messages from A<\/p>\n<p>Into the B machine<br \/>\n# su &#8211; mqm<br \/>\n~ cd \/opt\/mqm\/samp\/bin<br \/>\n~ .\/amqsget RECEIVER.Q QMB<\/p>\n<p>Found not receive the message, check the reasons and found that network communications may be the problem, mainly port is open, so turn off the B machine firewall<br \/>\nLog in as the root user<br \/>\n#systemctl stop iptables ; systemctl disable iptables<br \/>\n# su &#8211; mqm<br \/>\n~ cd \/opt\/mqm\/samp\/bin<br \/>\n~ .\/amqsget RECEIVER.Q QMB<\/p>\n<p>4.MQ client installation and validation<br \/>\n4.1 Preparation<\/p>\n<p>Two virtual machines, including B machine (192.168.98.130) as MQ server, C machine (192.168.98.131) as the MQ client<br \/>\nThe MQ client (machine C) is connected to the MQ server (machine B), sends the message to the server, and retrieves the message from the server<\/p>\n<p>** Focus: **<br \/>\nIn the client and server machines need to create a non-mqm group of the same id users, the user&#8217;s id must be consistent<br \/>\nFor example, the user name is mquser1 and the id is 3001<\/p>\n<p># useradd mquser1 -u 3001<\/p>\n<p>4.2 Configuring the MQ Server (B Machine)<\/p>\n<p>Install the MQ Server components on the B machine, as described in section 2 of this document<br \/>\n# useradd mquser1 -u 3001<br \/>\n# su &#8211; mqm<br \/>\n~ cd \/opt\/mqm\/bin<br \/>\nSets the mq environment variable<br \/>\n~ source setmqenv -s<\/p>\n<p>Create the queue manager QUEUE.MANAGER.1 and start it<br \/>\n~ crtmqm QUEUE.MANAGER.1<br \/>\n~ strmqm QUEUE.MANAGER.1<br \/>\n~ dspmq\u00a0\u00a0 View all queue manager running status<\/p>\n<p>Start the script executor and make settings<br \/>\n~ runmqsc QUEUE.MANAGER.1<br \/>\nInput:<br \/>\nDEFINE QLOCAL(QUEUE1) Creates the local queue QUEUE1<br \/>\nAuthorize the mquser1 user (id 3001) to use the queue QUEUE1<br \/>\nSET AUTHREC PROFILE(QUEUE1) OBJTYPE(QUEUE) PRINCIPAL(&#8216;mquser1&#8217;) AUTHADD(PUT,GET)<br \/>\nThe authorized user mquser1 can connect to the queue manager<br \/>\nSET AUTHREC OBJTYPE(QMGR) PRINCIPAL(&#8216;mquser1&#8217;) AUTHADD(CONNECT)<\/p>\n<p>Defines the server connection channel<br \/>\nDEFINE CHANNEL(CHANNEL1) CHLTYPE(SVRCONN) TRPTYPE(TCP)<\/p>\n<p>Authorized MQ clients can connect to the above-defined channel, and authorize them by ip address and user name<br \/>\nSET CHLAUTH(CHANNEL1) TYPE(ADDRESSMAP) ADDRESS(&#8216;192.168.98.131&#8217;) MCAUSER(&#8216;mquser1&#8242;)<\/p>\n<p>Defines a listener to accept connections<br \/>\nDEFINE LISTENER(LISTENER1) TRPTYPE(TCP) CONTROL(QMGR) PORT(1315)<br \/>\nstart up:<br \/>\nSTART LISTENER(LISTENER1)<br \/>\nEnd:<br \/>\nEnd<\/p>\n<p>4.3 Configuring the MQ Client (C)<\/p>\n<p>After you unpack the installation package, install the client components<br \/>\n# cd \/home\/mq\/server<br \/>\n# .\/mqlicense.sh -accept<br \/>\n# rpm -ivh MQSeriesRuntime-8.0.0-2.x86_64.rpm MQSeriesClient-8.0.0-2.x86_64.rpm\u00a0 MQSeriesSamples-8.0.0-2.x86_64.rpm<\/p>\n<p>Test the network connectivity to the MQ Server B machine<br \/>\n# Ping 192.168.98.130<\/p>\n<p>Create a user connecting to the mq server:<br \/>\n# useradd mquser1 -u 3001<\/p>\n<p>Switch to mquser1<br \/>\n# su &#8211; mquser1<\/p>\n<p>Set the environment variable to indicate the connection information to the MQ server<br \/>\n~ export MQSERVER=CHANNEL1\/TCP\/&#8217;192.168.98.130 (1315)&#8217;<\/p>\n<p>Telnet test in Telnet C machines, and success<br \/>\n# telnet 192.168.98.130 1315<br \/>\n# su &#8211; mquser1<br \/>\n~ cd \/opt\/mqm\/samp\/bin<br \/>\nSend the message to the server<br \/>\n~ .\/amqsputc QUEUE1 QUEUE.MANAGER.1<br \/>\nEnter the message, the last two enter the end of the key<br \/>\nGet the message from the server<br \/>\n~ .\/amqsgetc QUEUE1 QUEUE.MANAGER.1<\/p>\n<p>5. Uninstall MQ<\/p>\n<p># rpm -qa | grep MQ Queries the currently installed MQ components<br \/>\n# rpm -e MQSeriesServer Uninstall the server component<br \/>\n# rpm -e MQSeriesSamples Unload the sample program<br \/>\n# rpm -e MQSeriesRuntime Unloads the run-time component, which is typically the last uninstallation<\/p>\n<p>6. Other records<\/p>\n<p>Login server implementation:<br \/>\n# cd \/opt\/mqm\/samp\/bin<br \/>\n#.\/amqsgetc QUEUE1 QUEUE.MANAGER.1<\/p>\n<p>An error occurred: .\/amqsgetc: error while loading shared libraries: libmqic_r.so: can not open shared object file: No such file or directory<\/p>\n<p>The error is part of the library is not found, install rpm -ivh rpm -ivm MQSeriesClient-8.0.0-2.x86_64.rpm, and then set the environment variable<\/p>\n<p>MQ commonly used commands:<br \/>\nYou must first set the environment variable to run directly<br \/>\n# su &#8211; mqm<br \/>\n~ cd \/opt\/mqm\/bin<br \/>\n~ source setmqenv -s<br \/>\n~ dspmq View queue manager status<br \/>\n~ runmqsc QUEUE.MANAGER.1<br \/>\nEnter the script command to execute the command<br \/>\nDIS Displays all commands that can be entered<br \/>\nDIS CHL(*) View the channel definition<br \/>\nDIS CHL(CHANNEL1) View the specific channel definition<br \/>\nDIS LISTENER(*) View the listener definition<br \/>\nDIS LSSTATUS(LISTENER1) View the status of the specified listener<br \/>\nDIS Q(*) View the queue definition<br \/>\nDIS Q(QUEUE1) View the queue definition<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MQ 8 on CENTOS 6.8<\/p>\n<p>WebSphere MQ installation and validation<\/p>\n<p>WebSphere MQ installation and validation ready 1 Check the installation hardware and software requirements 2 Installation Notes Single server installs MQ and authentication 1 Create a user and user group Optional step 2 Extract the downloaded MQ installation package 3 Check if the rpm package [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6459"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6459"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6459\/revisions"}],"predecessor-version":[{"id":6460,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6459\/revisions\/6460"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}