WebSphere MQ 命令
IBMWebSphereMQ介绍安装以及配置服务详解
介绍安装以及配置服务详解IBM WebSphere MQ首先介绍一下MQMQ消息队列的简称是一种应用程序对应用程序的通信方法。
说白了也就是通过队列的方式来对应用程序进行数据通信。
而无需专用链接来链接它们。
MQ的通讯方式1.数据报的方式Datagram (Send and forget)应用程序在创建完消息后。
利用MQ的API将消息发送到队列中。
它充分利用了MQ(once and once only )2.请求和应答方式Request/Reply发送消息之后需等待对方处理结果。
需考虑如下问题:a.等待应答的时间是多少?b.如果没有应答怎么办。
c.本次session是否需要保留?MQ的开发流程1.让应用程序与队列管理器链接,通过MQconnect调用来进行此链接。
2.使用MQOpen调用为输出打开一个队列调用将其数据放到队列上。
MQPut应用程序使用 3.调用打开输入队列 4.调用MQOpen 5.使用MQGet从队列上接收数据安装步骤。
(此处为转载文章,作者已经证实所有步骤。
)Windows下WebSphere MQ服务端的安装:(1)把WebSphere MQWindows版服务器CD-ROM插入CD-ROM驱动器。
(2)如果安装了自动运行,那么会启动安装进程。
如果不启动,则双击CD-ROM 上的根目录中的Setup图标以启动安装程序。
(3)请等待,直到出现WebSphere MQ安装启动板窗口为止。
(4)如果需要更改安装的本地语言,单击选择语言图标,然后从列表中选择所需的语言。
(5)选择必备软件选项。
选择典型安装后,安装界面上的每个安装项右边有一个对钩号(表示已安装),反之则为一个叉号(表示还没有安装,如果要装MQ,则必须先把这些软件装好)。
如果出现了叉号:1)单击项目左边的?号以显示安装连接;2)选择要使用的安装源的选项,从以下各项选择:WebSphere MQ CD ?.因特网?网络? ?符号。
Websphere_MQ入门教程
Websphere MQ入门教程——使用IBM Websphere MQ提纲前言今天,大多数企业都希望他们的硬件和软件提供者不只受限于一家厂商,相反,大家普遍认为应当面向多家厂商能够运行多种软件的多种硬件平台,这些硬件平台既可以是大型机,也可以是笔记本计算机。
其中包括传统的中央集中式系统,通常指大型企业所采用的大型机,部门级小型计算机和个人用个人计算机或工作站。
通常这些平台是在“混乱”中发展起来的,当时它们的成长既有独立性又有偶然性。
混乱造成的结果是由企业“玻璃房子”控制的清静、秩序井然的世界退化成了一个个独立而分散的部门,并要求任务能够满足其独立而分散的需求。
有些公司一直在寻求一种成熟的策略,以便在企业范围内扩展应用和数据,使其距最终用户最近。
这种需求在设计时,存在许多限制,因为目前的交互式主要是同步形式,它要求对方一直处于通讯状态,这必然会大大增加网络代价。
目前,许多企业都是由一些相对于整体业务问题而孤立的解决方案所组成的自动化孤岛。
在信息共享的大环境下,如果能在这些孤岛之间架起桥梁,那么效率和利润都将得到提高。
从我们与不同行业客户与服务提供者广泛接触的经验来看,这种沟通非常必要,而且正变得越来越重要。
有些公司已经找到了连接网络若干个部分的解决方案,它们或者是自行开发的或者只有较窄的应用领域。
如IBM用户事务处理的CICS就有这样的连接功能,但数据处理软件的设计、维护和开发通常都非常昂贵。
因此需要一种通用软件,它能够集成多个运行于供应商所提供的系统上的应用程序。
这种软件不仅成本不高,而且可以可靠地处理很高的吞吐量,消息中间件正是解决这种互连问题的解决方案。
商业消息中间件的出现保证了消息传输的可靠性,高效率和安全性,同时也减少了系统的开发周期。
目前应用最多的消息中间件产品为IBM Websphere MQ。
本文就针对Websphere MQ的体系结构、管理和开发进行详细的阐述,希望对读者有所帮助。
WebSphere MQ快速指南说明书
Quick Guide of the Administrative Console from WebSphere ApplicationServer for WebSphere MQ usersIBM Techdoc: 7018556h t t p://w w w.i b m.c o m/s u p p o r t/d o c v i e w.w s s?u i d=s w g2*******Date last updated: 07-Mar-2018Angel Rivera –r i v e r a@u s.i b m.c o mIBM WebSphere MQ Support+++ Objective +++The objective of this techdoc is to provide a quick guide of the sections of the Admin-istrative Console from WebSphere Application Server which are relevant to Web-Sphere MQ users:- Listener Ports- JMS resources (Connection Factories, Destinations, Activation Specifications)- MDBs and their mapping to Listener Port or Activation Specification- Environment variables (MQ_INSTALL_ROOT for WebSphere Application Server V6)- Trace enablement and specification of the trace string- Specification for the MQ Native Libraries for Bindings Transport Type- Enablement of new MQ V7 functions: Read Ahead, Asynchronous Put- Additions in WAS V8: connection name list, advanced propertiesThe screen shots are taken from a WebSphere Application Server Administrative Con-sole at V7.Whenever relevant, specific screen shots from WebSphere Application Server V6 and V8.x and V9 will be shown.+++ Update on 07-Mar-2018:New section for the MQ Resource Adapter properties, such as: reconnectionRetryInterval+++ Update on 10-Aug-2016:Including WAS V9.+++ Update on 18-Nov-2011:Including WAS V8.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ High level view of the Console, regarding functions related to MQ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ This is the high level view of the WebSphere Application Server Administrative Con-sole showing the menus that have objects related to MQ.The default URL for the WebSphere Application Server Administrative Console is:h t t p://h o s t n a m e.d o m a i n.c o m:9060/i b m/c o n s o l eServers:Listener Ports: start, stop, statusApplications:MDBs: start, stop, bindings to Listener Port or to Activation Specification Resources:JMS Resources:Connection FactoriesDestinations (Queues, Topics)Activation SpecificationsMQ Resource Adapter properties (such as reconnectionRetryInterval) Environment:WebSphere Application Server V6: MQ_INSTALL_ROOT Troubleshooting:Tracing: trace string, enable tracing, disable tracing.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Listener Ports++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ A WebSphere Application Server Listener Port is not a JMS administrative object and thus, it is not stored in the JNDI directory service.Rather, it is an object under the "server" of WebSphere Application Server.The short cut is:Application servers > server1 > Message listener service > Listener PortsThe full procedure is described below.From the left panel, select:Servers > Server Types > WebSphere application serversFrom the right panel, click on the appropriate server, in this case, “server1”.The Configuration tab will display the main information on the server:You need to scroll down to reach the section “Communications”Click on “Messaging”Click on “Message listener service”In the “Message listener service”, click on: Listener Ports Click on Listener Ports++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ JMS resources (Connection Factories, Destinations, Activation Specifications)++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The JMS resources are:- Connection Factories (Generic, Queue and Topic)- Destinations (Queues, Topics)- Activation SpecificationsNotice that MQ is designated as the "WebSphere MQ messaging provider".The "Default messaging provider" is NOT MQ, but rather, the System Integration Bus (SIB).++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ JMS resources (JMS providers > MQ Resource Adapter properties)++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ New in WAS 8:WebSphere Application Server V8 exposes the following WebSphere MQconnection properties that are used to configure the WebSphere MQ resource adapter that is used by the WebSphere MQ messaging provider. These properties affect the connection pool that is used by activation specifications:- maxConnections- connectionConcurrency- reconnectionRetryCount- reconnectionRetryIntervalh t t p s://w w w.i b m.c o m/s u p p o r t/k n o w l e d g e c e n t e r/S S E Q T P_9.0.0/c o m.i b m.w e b s p h e r e .b a s e.d o c/a e/t m m_w m q r a_p r o p c o n f i g.h t m lWebSphere Application Server traditional 9.0.0.x > Managing messaging with the IBM MQ messaging providerConfiguring properties for the IBM MQ resource adapter.+ begin excerpt.You can configure the IBM MQ resource adapter properties that affect the connection pool, which is used by IBM MQ messaging provider activation specifications.About this taskThere are properties that are used to configure the IBM MQ resource adapter used by the IBM MQ messaging provider:- maxConnections: default 50- connectionConcurrency: default 1(Setting this property only affects WebSphere® Application Server 7 nodes.The property has no effect for WebSphere Application Server Version 8 or later nodes.)- reconnectionRetryCount: default 5- reconnectionRetryInterval: default 300,000 milliseconds (it is 5 minutes!!)- startupRetryCount- startupRetryInterval.These properties affect the connection pool, which is used by the IBM MQ messaging provider activation specifications. They do not affect the IBM MQ messaging provider queues, topics, or connection factories..Procedure.1. In the navigation pane, click Resources > JMS-> JMS providers to display a list of JMS providers in the content pane.2. Optional: If you want to manage JMS resources that are defined at a different scope setting, change the Scope setting to the required level.3. In the Providers column of the displayed list of JMS providers, click the name of the IBM MQ messaging provider that you want to work with.4. In the content pane under Additional properties, click Resource adapter properties to view the configuration page for the properties.5. Specify the required values for the properties..+ end excerptExample:JMS Resources > JMS providersJMS Resources > JMS providers > WebSphere MQ messaging providerJMS Resources > JMS providers > WebSphere MQ messaging provider > Resource Adapter properties++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ MDBs and their mapping to Listener Port or Activation Specification++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ A Message Driven Bean (MDB) is part of a deployed application.They can be found under:Applications > Application Types > WebSphere enterprise applicationsNotice that the application needs to be shown with a status of running (green arrow) in order for the corresponding MDB to be running.The MDB can be associated with a Listener Port or an Activation Specification. From the sample above, click on the application "SampleMDBEJBEAR".Under the section "Enterprise Java Bean Properties", select:Message Driven Bean listener bindingsIn this example, the binding is with a Listener Port++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Environment variables (MQ_INSTALL_ROOT for WebSphere Application Server V6) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++In WebSphere Application Server V6, the WebSphere Application Server environment variable MQ_INSTALL_ROOT is used to indicate the location of the MQ JMS jar files.The default value of MQ_INSTALL_ROOT is:${WAS_INSTALL_ROOT}/lib/WMQWhere WAS_INSTALL_ROOT is:AIX: /usr/IBM/WebSphere/AppServerOthers: /opt/IBM/WebSphere/AppServerWindows: C:\Program Files\IBM\WebSphere\AppServerThe jar files are located in ${MQ_INSTALL_ROOT}/java/libThus, the full path for these MQ jar files is:AIX: /usr/IBM/WebSphere/AppServer/lib/WMQ/java/libOthers: /opt/IBM/WebSphere/AppServer/lib/WMQ/java/libWindows: C:\Program Files\IBM\WebSphere\AppServer\lib\WMQ\java\libIn WebSphere Application Server V7, the variable MQ_INSTALL_ROOT is practically not used. For more details, consult the following techdoc:h t t p://w w w.i b m.c o m/s u p p o r t/d o c v i e w.w s s?u i d=s w g2*******WebSphere MQ V5.3, V6 and V7 as JMS Provider for WebSphere Application Server V5, V6.0, V6.1 and V7In WebSphere Application Server 6.0, the following variable is defined in terms of MQ_INSTALL_ROOT.Do NOT modify directly this variable:MQJMS_LIB_ROOT = ${MQ_INSTALL_ROOT}/lib/WMQIn WebSphere Application Server V6.1 the variable MQJMS_LIB_ROOT is NO longer used.It is still shown in the WebSphere Application Server Administration Console, but its value is NOT used. Instead, the following is actually used:${MQ_INSTALL_ROOT}/lib/WMQTo find out the values for these variables, use the WebSphere Application Server ad-ministrative console:Environment > WebSphere VariablesEnsure to select the scope to: Node=server1You will need to scroll down or go to the next page in the long list of variables, until you find:MQ_INSTALL_ROOT ${WAS_INSTALL_ROOT}/lib/WMQ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Trace enablement and specification of the trace string++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ The following technote has the details on how to enable the MQ JMS trace in WAS:h t t p://w w w.i b m.c o m/s u p p o r t/d o c v i e w.w s s?u i d=s w g2*******Technote: 1199176Enabling Java Message Service (JMS) trace for WebSphere Application ServerWAS V9.0 (all on one line):*=info:jmsApi=all:Messaging=all:com.ibm.mq.*=all:JMSApi=all:com.ibm.ws.cdi.jms*=all WAS V8: The string should be:*=info: JMSApi=all: Messaging=all: com.ibm.mq.*=allWebSphere Application Server V6 and V7: The string should be (in one single line)*=info:JMSApi=all:JMSServer=all:Messaging=all:JMS_WASTraceAdapter=all:com.ibm.mq.*=all:jmsApi=all Select: Troubleshooting -> Logs and Trace.- For WAS V6, V7, V8 and V9 (using old style and not using new HPEL) go to page 14. - For WAS V8 (using new HPEL) to go page 17.For WAS V6, V7, V8 and V9 (Legacy, NOT using HPEL):Select: Diagnostic TraceTo ensure you capture full data flows, select: Trace Output Format = AdvancedThen select:Change Log Details LevelsSpecify the string (all in one single line):WAS V9.0 (all on one line):*=info:jmsApi=all:Messaging=all:com.ibm.mq.*=all:JMSApi=all:com.ibm.ws.cdi.jms*=all WAS V8:*=info: JMSApi=all: Messaging=all: com.ibm.mq.*=allWAS V6 and V7:*=info:JMSApi=all:JMSServer=all:Messaging=all:JMS_WASTraceAdapter=all:com.ibm.mq.*=all:jmsApi=all Location of trace files<WAS_HOME>\profiles\<server_name>\logs\<server_name>\trace.logTo disable the trace in WebSphere Application Server:After you have finished collecting the trace, please disable the tracing to avoid un-necessary consumption of system resources and disk spaceChange Log Detail Levels:*=infoFor WAS V8 and later (using the new HPEL): Select: Configure HPEL traceSelect: Change log detail levelsSpecify the string (all in one single line):WAS V9.0 (all on one line):*=info:jmsApi=all:Messaging=all:com.ibm.mq.*=all:JMSApi=all:com.ibm.ws.cdi.jms*=all WAS V8:*=info: JMSApi=all: Messaging=all: com.ibm.mq.*=allLocation of trace files:<WAS_HOME>\profiles\<server_name>\logs\<server_name>\tracedata\*To disable the trace in WebSphere Application Server do the following:After you have finished collecting the trace, please disable the tracing to avoid un-necessary consumption of system resources and disk spaceChange Log Detail Levels:*=info++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Specification for the MQ Native Libraries for Bindings Transport Type++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ In order to locate the WebSphere MQ V7 or later native libraries required for BIND-INGS mode, the application server needs to be configured to have the generic Java Virtual Machine (JVM) argument set to the location of the libraries.-Djava.libary.pathFor information about where these files are installed, please see the "The Java Native Interface (JNI) libraries required by WebSphere MQ classes for JMS applications" sec-tion in the online manual for MQ/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.dev.doc /q031570_.htmThe Java Native Interface (JNI) libraries required by IBM MQ classes for JMS applica-tions+++ WebSphere Application Server 6From the WebSphere Application Server V6 Admin Console:Click on Servers > Application Servers > server1.Then, under “Server Infrastructure”,click Java and Process Management > Process definitionThen select “Java Virtual Machine”Under “Generic JVM arguments”, enter:-Djava.library.path=library_path For Linux 32-bit, it should be:-Djava.library.path=/opt/mqm/java/libFor Linux 64-bit, HP-UX and Solaris, the string is:-Djava.library.path=/opt/mqm/java/lib:/opt/mqm/java/lib64 For AIX, the string is:-Djava.library.path=/usr/mqm/java/lib:/usr/mqm/java/lib64+++ WebSphere Application Server V7 or laterIt is required for bindings mode applications that the JMS runtime must access the appropriate "bindings module" in the "native" WMQ libraries.Thus the Resource Adapter's "native library path" must be configured to point to the WMQ directory where these libraries are located:AIX: /usr/mqm/java/libUnix: /opt/mqm/java/libWindows: C:\Program Files\IBM\WebSphere MQ\java\libFor more information see the following web page from the WebSphere Application Server online manual:/support/knowledgecenter/SSEQTP_7.0.0/com.ibm.websphere. base.doc/info/aes/ae/tmj_adm33.htmlConfiguring the WebSphere MQ messaging provider with native libraries informationThe procedure is:- In the navigation pane, expand Resources > JMS > JMS providers- Select the WebSphere MQ messaging provider that is at the correct Scope for the connection factory or activation specification that will create the bindings mode con-nection. Note that native path information at Server scope is used in preference to native path information at higher scopes, and native path information at Node scope is used in preference to native path information at Cell scope.- Under General Properties, in the Native library path property, enter the full name of the directory that contains the WebSphere MQ native libraries.For example, on Linux enter /opt/mqm/java/lib. Enter only one directory name. Click OK.- Save any changes to the master configuration.- If you are running in an application server environment, you must restart all affect-ed servers twice when you have changed the native path information. Otherwise, a WMSG1623E message is produced, indicating that the WebSphere MQ messaging pro-vider is not available.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Enablement of new MQ V7 functions: Read Ahead, Asynchronous Put++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ These functions are ONLY available in WebSphere Application Server V7 and later. Read AheadResources > JMS > Queues > $QueueName/$TopicName > Advanced properties Section: OptimizationsYou will see the Advanced Properties:You will need to scroll down.Section: OptimizationsRead ahead, and cache, non-persistent messages for consumers As per queue definitionYesNoRead ahead consumer close methodWait for all cached messages to be deliveredWait for the current message to be deliveredAsynchronous put ("fire and forget")Resources > JMS > Queues > $QueueName/$TopicName > Advanced properties Section: OptimizationsSee previous page for the "Advanced Properties".Asynchronously send messages to the queue managerAs per queue definitionYesNo++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ Additions in WAS V8 and later: connection name list, advanced properties++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ These functions are ONLY available in WebSphere Application Server V8 and later.+ Support for WMQ connection name list in a Connection Factory (CF) or an Activation Specification (AS).During the creation of any of these objects:Notice the new radio button to choose between a single host/port or a connection name list+ Exposing additional WMQ propertiesSeveral existing WMQ properties that were previously set via custom properties are now available in the WAS Administrative Console.Queue connection factories: Client reconnectClient reconnect options (Disabled)Client reconnect timeout (1,800 seconds)Queues, Advanced properties:Message Body: Unspecified, JMS, MQReply to style: Default, MQMD, RFH2Queues, Advanced properties: Message descriptor:MQMD read enabledMQMD write enabled+++ end +++。
IBM WebSphere MQ 8.0 快速入门指南说明书
IBM WebSphere MQVersion 8.0Quick Start GuideUse this guide to get started with IBM WebSphere MQ Version 8.0.National Language Version:To obtain the Quick Start Guide in other languages,print the language-specific PDF from the Quick Start DVD.Product overviewWebSphere ®MQ provides a universal messaging backbone with robust connectivity for flexible and reliable messaging for applications,and integration of existing IT assets that use a service-oriented architecture (SOA).WebSphere MQ supports application portability through its message queuing interface (MQI),which is a consistent application programming interface available across all the supported platforms.WebSphere MQ also supports the Java ™Message Service (JMS)application programming interface,and both queue-based and publish/subscribe messaging.Managed File Transfer extends your WebSphere MQ messaging network to support file-based integration,and a range of security features is available to protect both the messaging system and the messages that pass through it.You can use the WebSphere MQ Explorer graphical user interface to administer and configure the entire WebSphere MQ network.Product documentation for all versions of WebSphere MQ is available at /software/integration/wmq/library/.Specifically,the WebSphere MQ Version 8.0product documentation is also available in IBM Knowledge Center (/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.helphome.v80.doc/WelcomePagev8r0.htm).You can also download the WebSphere MQ Version 8.0product documentation as a series of PDF files from ftp:///software/integration/wmq/docs/V8.0/PDFs.Service and support information is provided in the documentation.Information about how to use WebSphere MQ Explorer can be accessed either from within WebSphere MQ Explorer or in the product documentation.WebSphere MQ architectures range from simple architectures that use a single queue manager,to more complex networks of interconnected queue managers.For more information about planning your WebSphere MQ architecture,see the Planning (/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.pla.doc/q004690_.htm)section of the product documentation.For installation instructions for WebSphere MQ on AIX,HP-UX,Linux,Solaris,IBM i,or Microsoft Windows,and fordetails of the hardware and software configurations that are required,see the Installing(/support/ knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ins.doc/q008250_.htm)section of the product documentation.For installation instructions for WebSphere MQ on z/OS®,and for details of the hardware and software configurations that are required,see the Installing WebSphere MQ for z/OS(/support/knowledgecenter/SSFKSJ_8.0.0/ com.ibm.mq.ins.doc/q009640_.htm)section of the product documentation.Further scenarios help you to configure or use product features by taking you through the appropriate task steps.The scenarios include links to other content that helps you to gain a better understanding of the area in which you areinterested.More informationFor more information about WebSphere MQ,see the following resources:Product readme fileThe product readme file(readme.html)is included on the product media and is installed when you installproduct components.The latest version is available on the product readmes web page(/support/docview.wss?rs=171&uid=swg27006097).IBM Support PortalSupport information available through IBM Support Portal includes the following resources:v Support technotes(/support/search.wss?q=websphere+mq)v Available downloads and other resources(/support/entry/portal/product/websphere/websphere_mq?productContext=24824631)v Social Media channels for WebSphere and CICS®Support(/support/docview.wss?uid=swg21410956#2IBM WebSphere MQ Version8.0Licensed Materials-Property of IBM.©Copyright IBM Corp.2006,ernment Users Restricted Rights-Use,duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.IBM,the IBM logo,®,AIX,CICS,Passport Advantage,WebSphere and z/OS are trademarks or registered trademarks of International Business Machines Corp.,registered in many jurisdictions worldwide.Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.Linux is a registered trademark of Linus Torvalds in the United States,other countries,or both.Microsoft,Windows,and the Windows logo are trademarks of Microsoft Corporation in the United States,other countries,or both.Other product and service names might be trademarks of IBM or other companies.A current list of IBM trademarks is available on the Web at“Copyright and trademark information”(/legal/copytrade.shtml).Part Number:CF4BZMLPrinted in Ireland。
IBM WebSphere MQ常用命令
endmqm –i QmgrNa me 立即 停止
endmqm –p QmgrNa me 强制 停止 显示队列 管理器
dspmq – m QmgrNa me
运行 MQSeries 命令
runmqsc QmgrNa me
如果是默 认队列管 理器,可 以不带其 名字
DEFINE QMODEL (QNAM E) DEFTYP E (TEMPD YN) 定义本地 传 DE输FI队NE列 QLOCAL( QTNAME ) USAGE(X MITQ) DEFPSIS T(YES) +
INITQ (SYSTE M.CHAN NEL.INIT Q)+
PROCES S(PROCE SSNAME) REPLAC E
创建进程 定义
DEFINE PROCES S (PRONA ME) +
DESCR (‘ STRING ’)+
APPLTYP E (WINDO WSNT) +
APPLICID (’ runmqchl -c SDR_TE ST -m QM_ TEST’)
其中 APPLTYP E的值可 以是: CICS、 UNIX、 WINDOW S、 WINDOW SNT等
清除队列 中的所有 消息
CLEAR QLOCAL (QNAM E)
常用补充 命令 显示队列 管理器 dspmq 显示文件 名 dspmqfls
启动本地 队列管理 器 strmqm
结束本地 队列管理 器 endmqm
启动通道 启动进程 runmqchi/ runmqchl
ibmwebspheremq常用命令常用命令创建队列管理器crtmqmqmgrnameq是指创建缺省的队列管理器删除队列管理器dltmqmqmgrname启动队列管理器strmqmqmgrname如果是启动默认的队列管理器可以不带其名字停止队列管理器endmqmqmgrname受控停止endmqmqmgrname立即停止endmqmqmgrname强制停止显示队列管理器dspmqqmgrname运行mqseries命令runmqscqmgrname如果是默认队列管理器可以不带其名字往队列中放消息amqsputqnameqmgrname如果队列是默认队列管理器中的队列可以不带其队列管理器的名字从队列中取出消息amqsgetqnameqmgrname如果队列是默认队列管理器中的队列可以不带其队列管理器的名字启动通道runmqchlqmgrname启动侦听runmqlsrqmgrname停止侦听endmqlsrqmgrnamemqseries命令定义死信队列defineqlocalqnamedefpsistyesreplace设定队列管理器的死信队列alterqmgrdeadqqname定义本地队列defineqlqnamereplace定义别名队列defineqaliasqaliasnametargqqname远程队列定义defineqremoteqrnamernameaaarqmnameqmgrnamexmitqqtname定义模型队列defineqmodelqnamedeftypetempdyn定义本地传输队列defineqlocalqtnameusagexmitqdefpsistyesinitqsystemchannelinitqprocessprocessnamereplace创建进程定义defineprocesspronamedescrstringappltypewindowsntapplicidrunmqchlqmtest其中appltype的值可以是
IBMWEBSPHEREMQ客户端--服务器端安装配置
一:安装1,使用虚拟光驱加载,运行setup.ext2,进入安装主页面3,进入软件需求,一般第一次安装的时候第二项的eclipse会显示未安装,单击eclipse前面的“+”,在选从cd-rom安装,安装完后进入网络配置项4,网络配置,选否,直接进入websphereMQ安装项一直下一步到安装类型界面注意此时一般选择定制,可选择安装路径及安装的组件下一步路径根据需要自行设定6,下一步到功能组件界面如果需要安装服务器则windows客户机可以不选,其他选项最好全选,不用考虑太多建议:可将服务器,客户机资源管理器java消息传递和soap transport还有开发工具全部选中,日后无论做客户机还是服务器就不需要有所改动了如下图7,然后开始安装,耗时较长8,安装完成后会进入配置界面,一般都默认下一步,但是在网络配置那一项时选择否,其他的全都是默认不要在进行任何改动,9,快完成时会遇到缺省设置,一般无需设置,当安装配置完毕后进入资源管理器中自行设置,所以不点击缺省设置,直接单击下一步直至完成即可。
二.服务器—客户端配置首先设置服务器1,可根据资源管理器中的帮助文档进行配置2,帮助—〉帮助内容—〉webspheremq 帮助中心—〉webspheremq教程3,如果只需要配置客户端—服务器端的话按照如下步骤1新建一个队列管理器2在此队列管理器下新建一个本地队列(仅仅是本地队列,输入队列名称直接点击完成即可)3在高级选项里面的通道,新建一个服务器连接通道,输入通道名后下一步,选择MCA 项在mca用户标识中输入MUSR_MQADMIN即可,单击完成此时便配置好了服务器客户端配置客户端无需进行配置只需要安装mq的客户机便可,其实不用安装也可以实现同服务器的通讯客户端与服务器所谓客户端就是任何一个终端可以通过服务器端的ip地址将消息写入服务器的队列或是读取服务器端中队列的消息,所有的消息都存储在服务器端,客户端可以不用安装mq,通过程序可以直接与服务器建立连接,例如下面这段代码:import com.ibm.mq.*;public class Client {/*** @param args*/@SuppressWarnings("unchecked")public static void main(String[] args) {// TODO Auto-generated method stubString hostName = "192.168.1.4" ;String channel = "HH" ;String qManager = "QM_APPLE" ;String qName = "Q1" ;/**//*设置MQEnvironment 属性以便客户机连接*/MQEnvironment.hostname = hostName ;MQEnvironment.channel = channel ;SID = 1381;MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);/**//*连接到队列管理器*/try {MQQueueManager qMgr = new MQQueueManager(qManager);int openOptions = MQC.MQOO_INPUT_AS_Q_DEF |MQC.MQOO_OUTPUT;MQQueue system_default_local_queue = qMgr.accessQueue(qName, openOptions);//与队列连接MQMessage hello_world = new MQMessage();hello_world.writeUTF("Hello World");MQPutMessageOptions pmo = new MQPutMessageOptions();system_default_local_queue.put(hello_world,pmo);//将消息放入队列中// MQMessage receiveMsg = new MQMessage();// receiveMsg.messageId = hello_world.messageId;// MQGetMessageOptions gmo = new MQGetMessageOptions();// system_default_local_queue.get(receiveMsg,gmo);// String msgText = receiveMsg.readUTF();// System.out.println("the message is: " + msgText);// qMgr.disconnect();} catch (Exception e) {// TODO Auto-generated catch blocke.printStackTrace();System.out.println(e);}}}客户端不用安装mq也可实现读写信息。
IBMWebSphereMQ安装及配置详解
IBMWebSphereMQ安装及配置详解1. 打开MQ安装程序,选择下⼀步,默认安装WebSphere MQ,2. 完成MQ的安装⼯作,启动WebSphere MQ,3. 服务器配置,选择新建队列管理器,创建名为 "mq"的队列管理器,其他选项默认不变,点"下⼀步"4. 允许在 TCP/IP上进⾏队列管理器的远程管理,点击"下⼀步",完成MQ队列管理器的创建。
5. 新建本地队列,在mq下创建名为"MQ_send"的本地队列(⽤户可以根据⾃⼰的需求更改本地队列的名字和数量),其他选项默认即可。
6. 在 mq下创建名为"MQ_CHL"的服务器通道,其他选项默认即可。
7. 在MQ服务器端的计算机⽤户中添加MQ客户端所在计算机的系统⽤户。
例如:我的MQ客户端所在的计算机⽤户名为Administrator,则在服务器端系统中添加名为"Administrator"的⽤户。
具体步骤如下:<1>点击"开始"->"控制⾯板"->"管理⼯具"->"计算机管理"->"本地⽤户和组"->"⽤户",选择Administrator点右键,打开属性⾯板,选择“⾪属于”把mqmt添加进去。
如下图所⽰:(如果客户端计算机使⽤的其他的⽤户名,在服务器端新建⼀个⽤户名,同样操作,把⽤户名添加⾪属于mqm组⾥⾯)注意:1. 客户端连接MQ服务出现2035错误MQRC_NOT_AUTHORIZED2.找到mq的安装⽬录下的bin⽬录,在cmd环境下执⾏命令runmqsc 然后执⾏命令 alter qmgr chlauth(disabled) 把权限验证下掉就可以了,如下图所⽰:3. MQ常⽤命令:登录MQI,⼀般是cd到MQ安装⽬录下bin,然后切换mqm账户,mqm账户是mq默认的管理员账户。
WebSphere MQ_常用命令
1. 创建队列管理器crtmqm -q QMA(-q表示QMA为默认队列管理器)2. 启动队列管理器strmqm QMA(对于默认队列管理器,则为strmqm )3. 启动管理器平台runmqsc QMA4. 定义本地队列define qlocal(queueA)若用于队列管理器之间进行通信,这应为define qlocal(queue1) usage(xmitq)5. 定义远程队列define qremote(queue.remote) rname(apple.queue) rqmname('queueB') xmitq(queue1)(apple.queue为远程队列管理器queueB中的本地队列)6. 定义发送端通道define channel(queueA.queueB) chltype(sdr) conname('192.168.1.90(1414)') xmitq(queueA) trptype(tcp)7. 定义接受方通道define channel(queueA.queueB) chltype(rcvr) trptype(tcp)8. 更改侦听端端口号alter listener(system.default.listener.tcp) trptype(tcp) port(1415)9. 启动侦听start listener(system.default.listener.tcp)在命令行c:\runmqlsr10. 列出侦听状态display lsstatus(*)11. 测试,向队列中放入消息amqsput queue_name queue_manager_name从队列中取出消息amqsget queue_name queue_manager_name12. 在服务器方建立用于客户方链接的通道define channel(channel2) chltype(svrconn) trptype(tcp) mcauser(' ')13. 在客户机方,使用MQSERVER定义客户机链接通道(如使用了Active Directory 服务支持,则可略过本步骤)SET MQSERVER=CHANNEL1/TCP/192.168.1.90(1414) //Windowsexport MQSERVER=’CHANNEL1/TCP/server-hostname(port)’ //linux15. 测试,向队列中放入消息amqsputc queue_name queue_manager_name从队列中取出消息amqsgetc queue_name queue_manager_name16. 关闭队列管理器endmqm mqm_nameendmqm -i mqm_name17. 结束所有侦听进程endmqlsr -m mqm_name18. 查看WebSphere MQ版本号dspmqver19. 查看已有的MQ管理器dspmq20. 启动WebSphere MQ Explorerstrmqcfg21. "dspmqfls" command to convert between real and transformed object names.。
安装 IBM WebSphere MQ
安装 IBM WebSphere MQWebSphere MQ 是在 InterChange Server 和连接器之间支持通信的消息传递软件。
本节描述如何安装和配置 WebSphere MQ,以本机方式使用或作为 Java 消息服务(JMS)提供程序在 InterChange Server 环境中使用。
请参阅"为 JMS 配置 WebSphere MQ"以将 WebSphere MQ 配置为 JMS 提供程序。
当环境存在以下情况时使用 JMS:∙当连接器代理程序需要安装在与 CORBA 不兼容的远程机器时。
∙当目标位置需要传输设备进行持久传送时。
在所描述的情况下,将 WebSphere MQ 用作 JMS 提供程序,而不是以本机方式使用,这是因为本机 MQ 依赖 CORBA 进行管理以及其它组件。
当用作 JMS 提供程序时,就不再依赖于CORBA。
另外,本机 MQ 只将入局事件持久保存在服务器中。
注: 优化了“正在进行的”(WIP)事件以提高本机 WebSphere MQ 传递的性能。
当使用 WebSphere MQ 作为 JMS 提供程序时,InterChange Server 使用未经过优化的消息传递来进行事件传递;可能会观察到某些性能影响。
在与 InterChange Server 相同的网络上安装 WebSphere MQ。
此安装涉及以下一般步骤:1.估计 WebSphere MQ 空间需求2.创建 WebSphere MQ 的用户帐户3.运行 WebSphere MQ 安装4.定义队列(仅限于 JMS)5.配置 WebSphere MQ 侦听器6.配置适配器的队列7.配置内核(仅限于 Solaris 和 HP-UX)8.为 JMS 配置 WebSphere MQ9.修改 WebSphere MQ 的消息队列属性在以后各节中更详细地描述了其中的每个步骤。
注: 安装 WebSphere MQ 要求您是超级用户。
IBM的websphereMQ的c#使用(一)
IBM的websphereMQ的c#使⽤(⼀)接上篇的MQ配置。
利⽤C#实现MQ消息的收发。
1.需要引⼊的dll是amqmdnet.dll2.app.config配置<?xml version="1.0" encoding="utf-8" ?><configuration><appSettings ><add key="HostName" value ="192.168.1.40"/><add key="Channel" value ="CLIENT.QM_ORANGE"/><add key ="Port" value ="1418"/><add key ="QueueManager" value="QM_APPLE"/><add key="Queue" value="Q1"/></appSettings><connectionStrings><add name ="connectionString" connectionString ="Data Source=(local);Initial Catalog=TestDb; Integrated Security=SSPI" /></connectionStrings></configuration>3.MQ操作类using System;using System.Data;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using IBM.WMQ;using System.Xml;using System.Configuration;using System.Windows.Forms;namespace WindowsFormsApplicationMQ{class Management{string queueName;MQQueueManager qMgr;MQMessage mqMsg;MQQueue queue;MQPutMessageOptions putOptions;#region连接队列管理器public Management(){}string linkStatus;public string LinkToQueueManager(){string QueueName = ConfigurationSettings.AppSettings["Queue"];queueName = QueueName;Environment.SetEnvironmentVariable("MQCCSID", "1381");if (MQEnvironment.properties.Count <= 0){MQEnvironment.properties.Add(SID_PROPERTY, 1381);}MQEnvironment.Port = Convert.ToInt32(ConfigurationSettings.AppSettings["Port"]);MQEnvironment.Channel = ConfigurationSettings.AppSettings["Channel"];MQEnvironment.Hostname = ConfigurationSettings.AppSettings["HostName"];string qmName = ConfigurationSettings.AppSettings["QueueManager"];try{if (qMgr == null || !qMgr.IsConnected){qMgr = new MQQueueManager(qmName);}linkStatus = "连接队列管理器:" + "成功!";}catch (MQException e){linkStatus = "连接队列管理器错误: 结束码:" + pletionCode + " 错误原因代码:" + e.ReasonCode;}catch (Exception e){linkStatus = "连接队列管理器错误: 结束码:" + e;}return linkStatus;}#endregion#region发送消息public void SendMsg(string message){int openOptions=MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_SHARED | MQC.MQOO_INQUIRE;try{queue = qMgr.AccessQueue(queueName, openOptions); //尝试打开队列}catch(MQException e){MessageBox.Show("打开队列失败:"+e.Message);}mqMsg = new MQMessage();mqMsg.WriteString(message);putOptions = new MQPutMessageOptions();try{queue.Put(mqMsg, putOptions); //将消息放⼊消息队列}catch (MQException mqe){MessageBox.Show("发送异常终⽌:"+mqe .Message );}finally{try{qMgr.Disconnect();}catch (MQException e){}}}#endregion#region接收消息public DataSet receiveMsg(){int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_SHARED | MQC.MQOO_INQUIRE;try{queue = qMgr.AccessQueue(queueName, openOptions); //尝试打开队列}catch (MQException e){MessageBox.Show("打开队列失败:" + e.Message);}//从队列管理器中获得消息MQGetMessageOptions mqGetMsgOpts;mqMsg = new MQMessage();mqGetMsgOpts = new MQGetMessageOptions();mqGetMsgOpts.WaitInterval = 15000;mqGetMsgOpts.Options |= MQC.MQGMO_WAIT;try{int queryDep = queue.CurrentDepth;if (queryDep > 0){queue.Get(mqMsg, mqGetMsgOpts); //获得消息var ds = new DataSet();var table = new DataTable("T_School");table.Columns.Add("ID", typeof(string));table.Columns.Add("SchoolName", typeof(string));table.Columns.Add("BuildDate", typeof(string));table.Columns.Add("Address", typeof(string));ds.Tables.Add(table);string message = mqMsg.ReadString(mqMsg.MessageLength);mqMsg.Format = MQC.MQFMT_XMIT_Q_HEADER;var reader = new StringReader(message);ds.ReadXml(reader, XmlReadMode.Fragment);return ds;}else{return null;}}catch(MQException ex) {MessageBox.Show("访问队列停⽌" + ex.InnerException);return null;}finally{try{qMgr.Disconnect();}catch (MQException e){}}}#endregion}}。
(完整版)WebSphereMQ一小时快速入门
WebSphere MQ一小时快速入门一、什么是中间件中间件是处于应用软件和系统软件之间的通用服务,是一类以自己的复杂换取企业应用简单化的可复用的基础软件。
中间件主要分为消息中间件、应用服务器中间件、交易中间件等等。
而今天,笔者晓奕主要向大家介绍的正是IBM厂商的消息中间件WebSphere MQ。
二、WebSphere MQ简介Websphere MQ是IBM的商业消息通讯中间件(Commercial Messaging Middleware)。
Websphere MQ提供一个具有工业标准、安全、可靠的消息传输系统。
它可实施在广泛的IBM和非I BM平台上,它的功能是控制和管理一个集成的商业应用,使得组成这个商业应用的多个分支程序(模块)之间通过传递消息完成整个工作流程。
通过使用WebSphere MQ用户可以简单方便的开发出可靠、高效的分布式应用系统。
三、WebSphere MQ主要对象消息是对使用它的应用程序有意义的以字节为单位的字符串。
消息可以用来实现在相同或不同平台上应用程序间的通信。
队列是用于存储消息的数据结构。
按功能可以分为本地队列、远程队列、传输队列、模板队列、别名队列、死信队列等等。
队列管理器在WebSphere MQ中队列管理器是基本的软件系统,队列管理器可看成是队列和其他对象的容器。
通道是一种提供从一个队列管理器到另一个队列管理器的通信路径。
它又叫消息通道,用在分布式的队列把消息从一个队列管理器发送到另一个队列管理器。
按照定义可以分为发送通道(Sender)、接收通道(Receiver)、服务器通道(Server)、请求器通道(Requester)等。
MQSC命令是用来管理队列管理器对象,包括队列管理器本身、通道、队列和进程定义。
可以使用 runmqsc 向队列管理器发出 MQSC 命令。
四、WebSphere MQ体系结构WebSphere MQ的体系结构如图所示,它是由许多对象所组成的,主要包括队列管理器、队列、通道、进程定义等对象。
WebSphere MQ 迁移指南.pdf_1701335685.495954说明书
Case studiesPlanning your migrationCheck Pre-reqs for your planned target version to ensure capability (click on buttons below)WebSphere MQpre-reqs Other IBM productspre-reqsExecuting your migrationWebSphere / IBM MQ migrationTask 1 – Determine your migration pathTask 2 – Preparing for your migrationTask 1 – Download the product from Passport AdvantageTask 3 – InstallationCase 1 – Multi-stage migration Supplemental resourcesReference links and self-studyTask 2a – Single-stage migrationTask 2b – Side-by-side migrationTask 2c – Multi-stage migrationUse this self-help tool to plan and execute your WebSphere MQmigration. Step through the tool by clicking on each of the blocks below as applicable.New FeaturesPlanningPotential ImpactsCurrent Version Target VersionV7.1V7.5V8Planning Guide V7.5Planning Guide V8Planning GuideWhat’s newV8What’s newV7.5What’s newV8Task 1 – Determine your migration pathSpecial considerationsIBM MQ v9 is the preferred target migration path and should be considered the best option.When choosing your target version take into account the features included in the new version and weigh the benefits of migrating to the latest version to decrease how often a migration is required.When skipping versions (for example migrating from v7.1.0 to v9) ensure you look at the What’s new for each release you skip to ensure you know all the new features you will gain.Out of Support April 30th 2017Channel Authentication Password Authentication Changes that affectmigration What changed?Channel Authentication Password Authentication Changes that affectmigration What changed?Check the IBM Lifecycle page to see when products will go out of support.V8.0V9Planning GuideWhat’s newV9Channel Authentication Password Authentication Changes that affectmigration What changed?V9Planning GuideV9Planning GuideWhat’s newV9What’s newV9Target versionGeneral migration considerationsV7.5Preparing for migration V8Preparing for migration Task 2 – Preparing for your migrationPlanningMigration coexistence, compatibility and interoperability considerationsV7.1 V7.5 V8 Support length remaining Short Medium Long In-place migration32/64bit 32/64bit 64bit Published performance reports Yes Yes Yes Single install package Yes Yes Yes File AuthorizationYes Yes YesV7.5V8 Migration method considerationsSingle stage migrationSide-by-side migrationMulti-stage migrationReplaces the only installation of IBM MQ on a server, with a later release Allows the installation of new version along side the olderAllows the installation of new version along side the olderPotential changes to client configurationsEarlier version and new version clients can coexistNo immediate need to change your client configurationsPreserves existing scripts and procedures for running IBM MQ the most Existing QMgr remain associated with the old version QMgrs can remain associated with theearlier version, until such time that you want to migrate them to the new versionQMgrs get migrated to new version immediatelyNew QMgrs can be created for either installed version New QMgrs can be created for either installed versionV9Preparing for migrationV9V7.5 Single-stage migrationSingle stage migrationSingle-stage migration is the term used to describe replacing the only installation of IBM MQ on a server, with a later release.Until WebSphere® MQ version 7.1, single-stage was the only migrationscenario. Single-stage migration preserves existing scripts and procedures for running IBM MQ the most. With other migration scenarios you might change some scripts and procedures, but you can reduce the effect queue manager migration has on users.V8 Single-stage migrationV9 Single-stage migrationV7.5 Side-by-side migrationSide-by-side migrationSide-by-side migration is the term used to describe installing a new version of IBM MQ alongside an older version on the same server.Queue managers continue running, and remain associated with the olderversion of IBM MQ, during the installation and verification of the new version of IBM MQ.When you decide to migrate queue managers to the new version of IBM MQ, you stop all queue managers, migrate them all to the new version, and uninstall the old version of IBM MQ.The side-by-side migration scenario is less flexible than the multistagemigration. The advantage the side-by-side scenario has over the single-stage scenario is that you can install and verify the new IBM MQ installation on the server before switching over to it.The process is based on the following premise:Install additional IBM MQ code alongside existing installation while queue managers are still running.Move queue managers one at a time to the new installation. Migrate and test applications one at a time.With the side-by-side approach, you can assign a later version of IBM MQ to be the primary installation, whereas, with the multistage approach, you cannot do so, if you have WebSphere MQ version 7.0.1 installed, until you uninstall WebSphere MQ version 7.0.1.With a later version of IBM MQ set as the primary installation, manyapplications restart without having to re-configure their environment, and IBM MQ commands work without providing a local search path.V8 Side-by-side migrationV9 Side-by-side migrationExecution Task 2c – Multi-stage migrationV7.5 Multi-stage migrationMulti-stage migrationMultistage migration is the term used to describe running a new version of IBM MQ alongside an older version on the same server.After installing the new version alongside the old, you can create new queue managers to verify the new installation, and develop new applications.At the same time, you can migrate queue managers and their associatedapplications from the old version to the new. By migrating queue managers and applications one-by-one, you can reduce the peak workload on your staff managing the migration.V8 Multi-stage migrationV9 Multi-stage migrationExecution Task 3 – InstallationDownload the appropriate version from PassportAdvantage (or obtain media) forruntime and toolkitPerform installation V7.5 Installation guideV8 Installation guideNotesYou do not need to uninstall a prior version and it is highly recommended that you do not uninstall old versions until you are confident you no longer need the prior version.A general recommendation is to keep one prior version.PerformInstallation VerificationTests [IVT)NotesOnce a queue manager has been started, after migrating to a new version, it will also bemigrated to the newer version. This cannot be undone and the queue manager cannot be reverted back to the previous version.Start queue manager to finish migration processStart queue manager’s listener, if not set toautomatic.Apply latest fixpackV9 Installation guidePlanningSelf-studyMulti-stage migration of QMgrsMultiple IBMMQ installations V8Installation guideon hub serversUse CaseIndustrial Design Distributors (IDD) are tasked with migrating off of WebSphere MQ V7.0.1.12 as it is no longer supported by IBM as of September 30th , 2015. Their main concern is with a group of “hub”WebSphere MQ servers that receive high volume inventory orders daily from remote store-front systems.Migration PathIBM recommends doing a multi-stage migration to IBM V8. This allows for IBM V8 to be installed along side of WebSphere MQ V7.0.1.12. Testing of the new version can be actioned, before migrating any V7.0.1.12 QMgr(s) to the new version.It is encouraged that you create a new QMgr for the V8 installation and do testing. Once test verification is completed, promote the production V7.0.1.12 QMgrs to V8 as needed.Please note that once a QMgr has been migrated, it is not possible to reverse it back to the previous version. For this reason we suggest making a file system backup of all V7.0.1.12 QMgrs as a best practice.Migration white paper Linux/UnixMigration white paper WindowsPlanningSelf-studyMulti-stage migration of QMgrsMigrating a Qmgr cluster V8Installation guidein a cluster of QMgrsUse CaseHydra Pharmacology is tasked with migrating WebSphere MQ V7.0.1.2, because it is going out of support on September 30th , 2015. These older QMgrs are in a WMQ cluster and responsible for processing prescriptions for 200+ satellite pharmacies.Migration PathIBM recommends doing a multi-stage migration to IBM V8, but the V7.0.1.2 servers must first be upgraded to V7.0.1.6 or above. In order to install V8 along side of a previous version, that version must be at V7.0.1.6 or greater.The multiple installation of IBM MQ V8 along side of WebSphere MQ V7.0.1.6+ allows for testing of the new version, before migrating any V7.0.1 QMgr(s) to the new version.Once test verification is completed, cluster QMgrs can be migrated to V8 as needed. IBM recommends migrating all Full Repositories before migrating any Partial Repositories. Also, migrate all Full repositories at the same time.Please note that once a QMgr has been migrated, it is not possible to reverse it back to the previous version. For this reason we suggest making a file system backup of all V7.0.1.6+ QMgrs as a best practice.Migration white paper Linux/UnixMigration white paper WindowsSupplemental resourcesInstallation / migration self-studyWebcasts Technotes Blogs VideosLink referenceDWAnswers。
WebSphere MQ 性能调优浅谈
LogWriteIntegrity=SingleWrite|DoubleWrite|TripleWrite
记录器使用的用于可靠地写日志记录的方法。
SingleWrite
其中使用非易失性写高速缓存(例如,启用 ssa 写高速缓存),这对于记录器在单个写中写日志记录是很安全的。
DoubleWrite
LogSecondaryFiles=2|1-61
耗尽主文件时分配的日志文件。次日志文件的最小数是 1,最大数是 61。缺省数是 2。主次日志文件的总数不能超过 63,但是不能少于 3。启动队列管理器时检查此值。您可更改此值,但是在重新启动队列管理器前更改不会有效,而且然后也不会立即发生作用。
? "为 DB2 添加资源管理器配置信息"
? "为 Oracle 添加资源管理器配置信息"
? "为 Sybase 添加资源管理器配置信息"
在一些情况下,必需更多的写来写更完整的日志记录。
TripleWrite
在一些情况下,必需更多的写来写完整的日志记录,但是要花UNIX 系统。RestrictedMode 节是由 crtmqm 命令上的 -g 选项设置的。 不要在创建队列管理器后更改这个节。如果您不使用 -g 选项,则不会在 qm.ini 文件中创建此节。
5.1 更改队列管理器配置信息
这里描述的属性修改个别队列管理器的配置。它们覆盖 WebSphere MQ 的任何设置。在 Windows 系统上,您可从 WebSphere MQ 服务管理单元访问,使用队列管理器的属性页面更改信息。在 UNIX 系统上,您可通过编辑 qm.ini 配置文件更改信息。
SwitchFile=name(必需)
aix下ibm websphere MQ 7
aix下ibm websphere MQ 7.0安装最近在搭一个项目的灾备环境(包括数据库和应用的容灾),ORACLE数据库同步已经通过DATAGUARD实现了,现在要部署应用程序到灾备机房的服务器中,应用软件用到了ibm websphere MQ,查了一下版本是7.0.1.2。
用户手上有7.0的正版光盘,又从官方网站下好补丁。
下周刚好有三天的MQ培训,虽然现在我不做开发了,但了解一下总没坏处,反正是要装的,于是不等开发人员过来,自己动手进行了安装,安装非常简单,和普通软件安装没什么两样,在此记录一下过程。
1WebSphere MQ安装步骤1.1准备工作1.1.1创建组和用户WebSphere MQ产品安装时,需要创建一个mqm组和一个mqm用户,要求mq m用户的主组是mqm。
为了方便系统管理,建议创建mqm组和mqm用户时,自定义组ID和用户ID。
如果是在高可用环境下,两台服务器创建的mqm组和mqm用户的ID必须要一样。
*注意:建议将root 用户增加到 mqm 组中。
组组名组ID 用户mqm 405 root,mqm用户用户名组ID 主组组集主目录管理员用户mqm 406 mqm mqm /home/mqm false建议使用如下命令创建mqm组和mqm用户。
mkgroup id=405 mqmmkuser id=406 pgrp=mqm groups=mqm home=/home/mqm mqm1.1.2创建文件系统如果MQ环境是单机环境则在本地磁盘创建如下文件系统即可;如果需要做成高可用环境,那么需要在共享磁盘上创建一个共享vg,例如vgmq,本文以创建在vgmq为例。
WebSphere MQ产品的安装目录是/usr/mqm,工作目录是/var/mqm,安装目录和工作目录不允许修改。
GSkit 必须安装在缺省位置。
在AIX平台的vgmq创建如下lv和文件系统卷组设备名大小文件系统属主vgmq /dev/mqmlv 1024M /var/mqm mqm:mqmvgmq /dev/mqmloglv 1024M /var/mqm/log mqm:mqmmklv -y mqmlv -t jfs2 vgmq 1Gcrfs -v jfs2 -d /dev/mqmlv -m /var/mqm -A yesmount /var/mqmmklv -y mqmloglv -t jfs2 vgmq 1Gcrfs -v jfs2 -d /dev/mqmloglv -m /var/mqm/log -A yesmount /var/mqm/log1.2安装WebSphere MQ for AIX1.2.1安装准备使用如下命令:#df –k确认下列文件系统已经被mount上:/var/mqm和/var/mqm/log1.2.2安装软件把WebSphere MQ 6.0 for AIX的介质ftp到服务器上的一个临时目录,例如/tmp/mqm,然后开始安装。
使用WebSphere MQ管理远程队列管理器
使用WebSphere MQ管理远程队列管理器2010年08月13日15:11 来源:百度空间作者:姚垚编辑:李倩评论:0条本文Tag:IBM Websphere【IT168 技术】与WebSphere MQ 5.3 for Windows 的版本类似,WebSphere MQ 6.0 的资源管理器远程管理也通过远程队列管理器的服务器连接通道实现远程管理。
直接连接设置步骤(所有设置都是在目的远程队列管理器上设置):1、队列管理器需要定义一个用于连接队列管理器的服务器连接通道。
与5.3版本不同的是,这个通道不一定是SYSTEM.ADMIN.SVRCONN。
该通道的名字可以随意定义,在设置远程管理的时候在 WebSphere MQ 资源管理器中指定即可。
需要注意的是,启动WebSphere MQ 资源管理器的机器上的当前用户可能没有访问队列管理器对象的权限,导致 MQ 资源管理器无法管理远程队列管理器。
简单的方法是在定义服务器连接通道的时候设置该通道的 MCAUSER 属性为mqm组中的用户。
DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) TRPTYPE(TCP) MCAUSER(‘mqm’)2、队列管理器需要定义一个名为 SYSTEM.MQEXPLORER.REPLY.MODEL 的临时模型队列以和MQ 资源管理器通信:DEFINE QM(SYSTEM.MQEXPLORER.REPLY.MODEL) DEFTYPE(TEMPDYN)3、队列管理器需要启动命令服务器strmqcsv <QMNAME>4、队列管理器需要启动侦听:DEFINE LISTENER(TCP.LSTENER) TRPTYPE(TCP) PORT(1414)START LISTENER(TCP.LISTENER)如果远程队列管理器是在Windows下用图形界面建立的,则1、2、3步都已经默认做好了。
WebSphere-MQ集群操作手册
MQ集群操作手册目录1、序言 (2)1.1编写目的 (2)1.2背景 (2)1.3 定义 (2)2、技术准备 (3)2.1 集群架构图 (3)2.2 集群的定义 (3)2.3 集群的优点 (3)2.4 集群的组件 (4)3、安装MQ (5)3.1软件需求 (5)3.2软件安装 (5)4、队列管理器集群 (16)4.1 集群架构 (17)4.2 创建队列管理器成员 (17)4.3 创建队列管理器集群 (30)4.4 配置集群权限 (42)5、集群消息验证 (45)1、序言1.1编写目的本文档系统介绍了websphere mq安装与集群的配置,本文档适合技术部相关开发与实施人员阅读。
1.2背景集群(Cluster)技术是发展高性能计算机的一项技术。
它是一组相互独立的计算机,利用高速通信网络组成一个单一的计算机系统,并以单一系统的模式加以管理。
其出发点是提供高可靠性、可扩充性和抗灾难性。
一个集群包含多台拥有共享数据存储空间的服务器,各服务器通过内部局域网相互通信。
当一台服务器发生故障时,它所运行的应用程序将由其它服务器自动接管。
采用集群系统通常是为了提高系统的稳定性和网络中心的数据处理能力及服务能力。
1.3 定义mq: websphere mq2、技术准备2.1 集群架构图2.2 集群的定义可以把集群认为是一个队列管理器的网络,或是一个队列管理器的集合,集群中的队列管理器可以是部署在不同的操作系统平台的。
2.3 集群的优点使用群集有两个优点:1) 减少系统管理:即使您创建了一个很小的群集,都将减少系统管理的工作。
在群集中建立队列管理网络比在分布式队列建立网络将使用更少的定义。
由于使用更少的定义,您将能够更快和更容易地建立和改变网络。
并且降低了定义错误的风险。
2) 增强可用性和实现负载均衡:简单的群集将更容易管理。
对于复杂的群集,将提高了扩展性和可用性。
因为您可以定义在不同的队列管理器定义相同的队列,因此工作负载可以在群集的队列管理器实现均衡。
WebSphere MQ 命令
附录WebSphere MQ 命令一览表队列管理器(Queue Manager)crtmqm 创建队列管理器(Create Queue Manager)[-c Text] 描述,最多64 个字符[-d DefaultTransmissionQueue] 缺省传输队列[-h MaximumHandleLimit] 一个应用程序可以MQOPEN 的最大句柄数min=1,max=999,999,999,default=256[-lc | -ll] Log 类型-lc Circular Logging,环型日志-ll Linear Logging,线型日志[-ld LogPath] Log 文件的目录,mqm 用户必须有访问权限,缺省为:Windows X:\Program Files\IBM\WebSphere MQ\log\qmgrUNIX /var/mqm/log[-lf LogFileSize] Log 文件大小,4KB 的倍数.Windows min=32,max=16,384,default=256 (1 MB)UNIX min=64,max=16,384,default=1024 (4 MB)[-lp LogPrimaryFiles] 主Log 文件数量,min=2,max=62,default=3[-ls LogSecondaryFiles] 备用Log 文件数量,min=1,max=61,default=2 注意:LogPrimaryFiles + LogSecondaryFiles <= 63[-q] 缺省队列管理器[-g ApplicationGroup] 应用组。
Application Group 中的用户可以运行MQI 应用,更新IPCC 资源,改变Queue Manager 目录中的内容。
仅对WMQ for AIX,Solaris,HPUX,Linux 有效。
会反映到qm.ini 中。
WebSphere MQ 简介
群集(Cluster):为了简化点对点通讯模式
中的系统配置,MQ提供Cluster(群集)的 解决方案。群集类似于一个域(Domain), 群集内部的队列管理器之间通讯时,不 需要两两之间建立消息通道,而是采用 群集(Cluster)通道与其它成员通讯,从而 大大简化了系统配置。此外,群集中的 队列管理器之间能够自动进行负载均衡, 当某一队列管理器出现故障时,其它队 列管理器可以接管它的工作,从而大大 提高系统的高可靠性。
WebSphere MQ 的优点
IBM MQ具有独特的安全机制、简便快速的编
程风格、卓越不凡的稳定性、可扩展性和跨平 台性,以及强大的事务处理能力和消息通讯能 力。 MQ具有强大的跨平台性,它支持的平台数多 达35种。它支持各种主流Unix操作系统平台, 如:HP-UX、AIX、SUN Solaris、Open VMX; 等;支持各种主机平台,如:OS/390、 MVS/ESA、VSE/ESA;同样支持Windows NT服务器。
通道
通道是MQ系统中队列管理器之间传递消息的管道,它
是建立在物理的网络连接之上的一个逻辑概念。 在MQ中,主要有三大类通道类型,即消息通道,MQI 通道和Cluster通道。消息通道是用于在MQ的服务器 和服务器之间传输消息的,需要强调指出的是,该通 道是单向的,它又有发送(sender), 接收(receive), 请求 者(requestor), 服务者(server)等不同类型,供用户在 不同情况下使用。MQI通道是MQ Client和MQ Server 之间通讯和传输消息用的,与消息通道不同,它的传 输是双向的。群集(Cluster)通道是位于同一个MQ 群集 内部的队列管理器之间通讯使用的。
非永久性消息是存储在内存中的,它是为了提 高性能而设计的,当系统掉电或MQ队列管理 器重新启动时,将不可恢复。当用户对消息的 可靠性要求不高,而侧重系统的性能表现时, 可以采用该种类型的消息,如:当发布股票信 息时,由于股票信息是不断更新的,我们可能 每若干秒就会发布一次,新的消息会不断覆盖 旧的消息。永久性消息是存储在硬盘上,并且 纪录数据日志的,它具有高可靠性,在网络和 系统发生故障等情况下都能确保消息不丢、不 重。
websphere mq常用命令
一、常用命令创建队列管理器crtmqm –q QMgrName-q是指创建缺省的队列管理器删除队列管理器dltmqm QmgrName启动队列管理器strmqm QmgrName如果是启动默认的队列管理器,可以不带其名字停止队列管理器endmqm QmgrName 受控停止endmqm –i QmgrName 立即停止endmqm –p QmgrName 强制停止显示队列管理器dspmq –m QmgrName运行MQ命令runmqsc QmgrName如果是默认队列管理器,可以不带其名字往队列中放消息amqsput QName QmgrName如果队列是默认队列管理器中的队列,可以不带其队列管理器的名字从队列中取出消息amqsget QName QmgrName如果队列是默认队列管理器中的队列,可以不带其队列管理器的名字启动通道runmqchl –c ChlName –m QmgrName启动侦听runmqlsr –t TYPE –p PORT –m QMgrName停止侦听endmqlsr -m QmgrName下面是在MQ环境中可以执行的MQ命令(即在runmqsc环境下可以敲的命令) 定义持久信队列DEFINE QLOCAL(QNAME)DEFPSIST(YES)REPLACE设定队列管理器的持久信队列ALTER QMGR DEADQ(QNAME)定义本地队列DEFINE QL(QNAME)REPLACE定义别名队列DEFINE QALIAS(QALIASNAME) TARGQ(QNAME)远程队列定义DEFINE QREMOTE(QRNAME)+RNAME(AAA)RQMNAME(QMGRNAME)+XMITQ(QTNAME)定义模型队列DEFINE QMODEL(QNAME)DEFTYPE(TEMPDYN)定义本地传输队列DEFINE QLOCAL(QTNAME) USAGE(XMITQ) DEFPSIST(YES) +INITQ(SYSTEM.CHANNEL.INITQ)+PROCESS(PROCESSNAME) REPLACE创建进程定义DEFINE PROCESS(PRONAME)+DESCR(‘STRING’)+APPLTYPE(WINDOWSNT)+APPLICID(’ runmqchl -c SDR_TEST -m QM_ TEST’)其中APPLTYPE的值可以是:CICS、UNIX、WINDOWS、WINDOWSNT等创建发送方通道DEFINE CHANNEL(SDRNAME)CHLTYPE(SDR)+CONNAME(‘100.100.100.215(1418)’)XMITQ(QTNAME)REPLACE其中CHLTYPE可以是:SDR、SVR、RCVR、RQSTR、CLNTCONN、SVRCONN、CLUSSDR 和CLUSRCVR。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
附录WebSphere MQ 命令一览表队列管理器(Queue Manager)crtmqm 创建队列管理器(Create Queue Manager)[-c Text] 描述,最多64 个字符[-d DefaultTransmissionQueue] 缺省传输队列[-h MaximumHandleLimit] 一个应用程序可以MQOPEN 的最大句柄数min=1,max=999,999,999,default=256[-lc | -ll] Log 类型-lc Circular Logging,环型日志-ll Linear Logging,线型日志[-ld LogPath] Log 文件的目录,mqm 用户必须有访问权限,缺省为:Windows X:\Program Files\IBM\WebSphere MQ\log\qmgrUNIX /var/mqm/log[-lf LogFileSize] Log 文件大小,4KB 的倍数.Windows min=32,max=16,384,default=256 (1 MB)UNIX min=64,max=16,384,default=1024 (4 MB)[-lp LogPrimaryFiles] 主Log 文件数量,min=2,max=62,default=3[-ls LogSecondaryFiles] 备用Log 文件数量,min=1,max=61,default=2 注意:LogPrimaryFiles + LogSecondaryFiles <= 63[-q] 缺省队列管理器[-g ApplicationGroup] 应用组。
Application Group 中的用户可以运行MQI 应用,更新IPCC 资源,改变Queue Manager 目录中的内容。
仅对WMQ for AIX,Solaris,HPUX,Linux 有效。
会反映到qm.ini 中。
mqm 必须是Application Group 中的用户。
缺省-g all[-t IntervalValue] min=0,max=999,999,999,default=999,999,999,单位: 毫秒。
触发间隔(Trigger Time Interval)[-u DeadLetterQueue] 死信队列(Dead Letter Queue))[-x MaximumUncommittedMessages] 最大的未提交的消息数量min=1,max=999,999,999,default=10,000在一个交易中的消息最大数量,为MQPUT + MQGET + LUW 中产生的Trigger Message 数量之和[-z] 抑止出错信息QMgrName 队列管理器名例:crtmqm -t 5000 -u SYSTEM.DEAD.LETTER.QUEUE -ll QMdltmqm 删除队列管理器(Delete Queue Manager)[-z] 抑止出错信息QMgrName 队列管理器名例:dltmqm -z QMstrmqm 启动队列管理器(Start Queue Manager)[-c] 启动队列管理器,覆盖重建所有的系统对象,再停止该队列管理器[-z] 抑止出错信息[QMgrName] 缺省为系统的缺省队列管理器例:strmqm -c QMendmqm 停止队列管理器(End Queue Manager)[-c | -w | -i | -p]-c Controlled (or quiesced) shutdown。
缺省值。
等到所有的应用MQDISC,Queue Manager 停止,当即显示命令提交的提示。
-w Wait shutdown与-c 效果相同,只是命令提示一直等到Queue Manager 停止后才出来。
-i Immediate shutdown等到当前的所有MQ API 都执行完毕,Queue Manager 停止。
以后的MQ API 全都失败,当前的交易在下次重启后自动回滚。
提示等到Queue Manager 停止后出现.-p Preemptive shutdown。
强制停止。
不会等待MQDISC 或MQ API 执行完毕,所以队列可能会出现异常。
提示等到Queue Manager 停止后出现。
[-z] 抑止出错信息QMgrName 队列管理器名例:endmqm -c QMendmqm -i QMdspmq 显示队列管理器(Display Queue Manager)[-m QMgrName] 缺省为系统的缺省队列管理器[-s] 显示运行状态例:dspmqQMNAME(QM) STATUS(正在运行)QMNAME(QM1) STATUS(正常结束)QMNAME(QM2) STATUS(正常结束)dspmq -s -m QMQMNAME(QM) STATUS(正在运行)命令服务器(Command Server)strmqcsv 启动命令服务器(Start Command Server)[QMgrName] 缺省为系统的缺省队列管理器例:strmqcsv QMendmqcsv 停止命令服务器(End Command Server)[-c | -i]-c Controlled,允许已经开始处理的Command 消息完成。
缺省值-i Immediately,中止正在处理的Command 任务QMgrName 队列管理器例:endmqcsv QMendmqcsv -i QMdspmqcsv 显示命令服务器(Display Command Server)[QMgrName] 缺省为系统的缺省队列管理器返回的Command Server 状态可能是:l Startingl Runningl Running with MAND.QUEUE not enabled for getsl Endingl Stopped例:dspmqcsv QMListener (监听器)runmqlsr 运行监听器(Run Listener)-t tcp[-p Port] Port 口,缺省为1414[-i IPAddr] IP 地址,如果不指定,Listener 会监听所有的IP 地址[-b Backlog] 允许的并发连接请求数-t lu62-n TpName 交易名,如果不指定,从Queue Manager 的配置中取-t netbios-a Adapter NetBIOS Adapter Number。
缺省为0-l LocalName NetBIOS Local Name。
缺省从队列管理器的配置中取-e Names Listener 可用的Name 数量。
缺省从队列管理器的配置中取-s Sessions Listener 可用的Session 数量。
缺省从队列管理器的配置中取-o Commands Listener 可用的Command 数量。
缺省从队列管理器的配置中取-t spx-x Socket 缺省为0x5E86-b Backlog 允许的并发连接请求数-t udp[-p Port] Port 口,缺省为1414[-m QMgrName]缺省为系统的缺省队列管理器备注:-t 为必选项,其它为可选项例:runmqlsr -t tcp -p 1414 -m QMendmqlsr 停止监听器(End Listener)[-w] 等到命令完成后才返回控制[-m QMgrName] 缺省为系统的缺省队列管理器触发监控器(Trigger Monitor)runmqtmc 启动Client 端触发监控器(Run Trigger Monitor for Client) [-m QMgrName] 缺省为系统的缺省队列管理器[-q InitiationQName] 初始化队列名字,缺省为SYSTEM.DEFAULT.INITIATION.QUEUErunmqtrm 启动Server 端触发监控器(Run Trigger Monitor for Server) [-m QMgrName] 缺省为系统的缺省队列管理器[-q InitiationQName] 初始化队列名字,缺省为SYSTEM.DEFAULT.INITIATION.QUEUETracestrmqtrc 启动Trace (Start Trace,Windows 平台)[-t TraceType][-x TraceType][-l MaxSize]解释同后strmqtrc 启动Trace (Start Trace,HP-UX,Solaris,Linux 平台) [-m QMgrName] 缺省为系统的缺省队列管理器[-e] Early Tracing。
可以Trace 队列管理器的创建与启动.[-t TraceType] Trace 的部分,可以有多个-t 选项[-x TraceType] 不要Trace 的部分,可以有多个-x 选项TraceType 可以是以下的组合:all 全部,是以下全部选项的叠加api MQI 调用和主要队列管理器部件相关信息commentary 部件中的评注信息comms 网络通信上的数据流csdata 通用服务的内部数据csflows 通用服务的控制过程detail 控制过程的细节数据lqmdata 本地队列管理器的内部数据lqmflows 本地队列管理器的控制过程otherdata 其它部件的内容数据otherflows 其它部件的控制过程parms 激活trace 控制过程remotedata 通信部件的内部数据remoteflows 通信部件的控制过程servicedata 服务部件的内部数据serviceflows 服务部件的控制过程ssl 用GSKit 与SSL Channel 安全数据,不支持WebSphere MQ forWindowsversiondata WebSphere MQ 版本信息[-l MaxSize] Trace 文件(AMQnnnn.TRC) 的上限。
以MB 为单位。
如果达到上限,Trace 文件会更名为AMQnnnn.TRS,且创建出新的Trace 文件AMQnnnn.TRC。
如果原来存在AMQnnnn.TRS,则原来的文件被删除。
例:strmqtrc -m QMstrmqtrc -m QM -estrmqtrc -m QM -t all -x sslendmqtrc 停止Trace (End Trace,Windows 平台)解释同后endmqtrc 停止Trace (End Trace,HP-UX,Solaris,Linux 平台)[-m QMgrName] 缺省为系统的缺省队列管理器[-e] Early Tracing.[-a] All Tracing。