MB开发环境安装手册(Linux)
(最终版已经丢失,现将以前放在网上的初稿贴过来)
一. 安装环境
操作系统:
fedora5
数据库:
DB2 8.2
开发环境:
Websphere Message Broker Runtime 6.0 ,MQ Series 6.0
二. 软件安装及参数配置
OS…………(fedora5) 安装mq后会有错误:
AMQ8101: WebSphere MQ error (893) has occurred.
以下内容OS为redhat9.0
首先解包,将software中的mb,mq,db2分别解包到mb,mq,db2文件夹中
1. Db2在linux上的安装:
./install
选择第一个和第三个包
Useradd db2ins1
Passwd db2ins1
修改文件opt/IBM/db2/V8.1/instance/db2iutil中的tail为tail –n (版本不一样,限于fedora5,rh9.0无此问题)
opt/IBM/db2/V8.1/instance/db2icrt -u db2ins1 db2ins1
su – db2ins1
db2start(此时如果说权限不够,是因为db2icrt执行失败)
db2 create database jjjj
验证安装是否正确可用connect to database,然后选择表查看
2.安装mq
mqlicense.sh –text_only …??
rpm -ivh MQSeriesRuntime-5.3.0-1.i386.rpm
rpm -ivh MQSeriesSDK-5.3.0-1.i386.rpm
rpm -ivh MQSeriesServer-5.3.0-1.i386.rpm
/opt/mqm/bin/amqiclen -x
//也可以安装man 用于了解命令
配置脚本:
crtmqm -lc -lf 8192 -lp 2 -ls 1 -q MB00
strmqm MB00
runmqsc MB00
define channel(SYSTEM.ADMIN.SVRCONN) chltype(SVRCONN) trptype(TCP)
define channel(CHANNEL1) chltype(SVRCONN) TRPTYPE(TCP)
def ql(deadq) defpsist(yes) maxdepth(20000) replace
def ql(ERRMSG) defpsist(yes) maxdepth(20000) replace
alter qmgr deadq(deadq)
def ql(in) maxdepth(10000) defpsist(yes) maxmsgl(1048576) replace
def ql(out) maxdepth(10000) defpsist(yes) maxmsgl(1048576) replace
def qr(99_IN) rname(IN) rqmname(MB99) xmitq(MB00_99) defpsist(yes) replace
def ql(MB00_99) usage(xmitq) defpsist(yes) maxdepth(10000) maxmsgl(1048576) trigger trigtype(first) trigdata(00_99) initq(system.channel.initq) replace
def chl(00_99) chltype(sdr) discint(1800) conname('192.168.1.199(6666)') xmitq(MB00_99) trptype(tcp) shortrty(10000) shorttmr(30) longtmr(300) longrty(999999999) batchsz(50) replace
def chl(99_00) chltype(rcvr) trptype(tcp) replace
def listener(MB00) trptype(tcp)
alter listener(MB00) trptype(tcp) port(6666) control(qmgr)
alter qmgr ccsid(819)
end
如果不通可以复位接收方的通道
3.安装MB runtime
Setup 即可
准备mb runtime参数:
1. 创建实例: /opt/IBM/db2/V8.1/instance/db2icrt –u kongpeng kongpeng
2. 创建数据库: su – kongpeng
db2start
db2 create database MBDB
db2 connect to MBDB
db2 bind ~/sqllib/bnd/@db2cli.lst grant public CLIPKG 5db2
db2 update database configuration for MBDB using dbheap 900
edit .odbc.ini
export ODBCINI
(odbc环境变量参数已经在profile中设定,因此无需再次设定.)
set lib path add ~/instance dir/sqllib/lib32
export LANG=EN (放入profile中)
将mqbrk里边的profile拷贝到root下,合并原先的默认profile.
将root用户加入组mqm,mqbrkrs就ok了
DB2 authorization ???
mqsicreatebroker MB -i kongpeng -a kongpeng -q MB00 -n MBDB -u kongpeng -p kongpeng
mqsicreateconfigmgr MB_MANAGER -i kongpeng -a kongpeng -q MB00
mqsistart MB
mqsistart MB_MANAGER
db2set db2codepage=1386
db2 terminate
db2 connect to sample
mqsilist
mqsilist brokername (此命令验证执行组是否能部署到此broker中)
(如果显示BIP8029E错误,说明broker没有建好,toolkit发布的信息不能部署到执行组中)
为什么mqsistop/mqsideletebroker会无响应呢? 可能是一开始建立broker的时候有错误………….
验证:
用本机上的toolkit建立一个简单的项目,消息流为从IN放入消息,OUT队列会收到消息,归档部署,linux机器上amqsput放入,amqsget查看!
注意:
因为用命令方式建立的队列名称默认是大写,所以toolkit中控件的属性名称以及linux中进行队列操作时要注意队列名称要大写,否则会找不到相应的队列.
4.安装cvs
rpm –ivh cvs-1.11.2-17.i386.rpm
groupadd cvs
useradd –g cvs –G cvs –d /cvsroot cvsroot
passwd cvsroot
chmod –R 770 /cvsroot
su - cvsroot
cd /cvsroot
mkdir project1
cvs –d /cvsroot/project1 init
cd /etc/xinetd.d
vi cvspserver (root)
将server_args去掉,server改为server = /cvsroot/cvs.run
su – cvsroot
建立cvs.run文件:
#!/bin/bash
/usr/bin/cvs –f --allow-root=/cvsroot/project1 pserver
chmod +x cvs.run
加入cvs服务:
vi /etc/services
cvspserver 2666/tcp #pserver cvs service
cvspserver 2666/udp #pserver cvs service
/etc/init.d/xinetd restart
/cvsroot/passwdgen.pl 生成密码的脚本
#!/usr/bin/perl
srand (time());
my $randletter = "(int (rand(26)) + (int (rand(1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt ($plaintext, $salt);
print "${crypttext}\n";
/cvsroot/project/passwd username:passwd:cvsroot
验证: cvs -d :pserver:username@192.168.1.31:/cvsroot/project1 login
三. 系统配置
(Aix分区/安装,用户的建立,权限的分配,密码… …安装mq,db2,mb runtime,agent controller可能还要涉及到cvs的安装,使用
安装mq的时候要先装eclipse,java1.4.2,环境变量的设置,安装db2的时候要将计算机用户加入到db2admin组中)
=====原始数据=====
本机配置:
========MQ===========
crtmqm -lc -lf 8192 -lp 2 -ls 1 -q MB99
strmqm MB99
runmqsc MB99
define channel(SYSTEM.ADMIN.SVRCONN) chltype(SVRCONN) trptype(TCP) mcauser('mqm')
define channel(CHANNEL1) chltype(SVRCONN) TRPTYPE(TCP) mcauser('mqm')
def ql(deadq) defpsist(yes) maxdepth(20000) replace
def ql(ERRMSG) defpsist(yes) maxdepth(20000) replace
alter qmgr deadq(deadq)
def ql(in) maxdepth(10000) defpsist(yes) maxmsgl(1048576) replace
def qr(29_IN) rname(IN) rqmname(MB) xmitq(MB) defpsist(yes) replace //29的远程队列
def qr(00_IN) rname(IN) rqmname(MB00) xmitq(MB00) defpsist(yes) replace //00的远程队列
def ql(MB) usage(xmitq) defpsist(yes) maxdepth(10000) maxmsgl(1048576) trigger trigtype(first) trigdata(99_29) initq(system.channel.initq) replace //29传输队列
def ql(MB00) usage(xmitq) defpsist(yes) maxdepth(10000) maxmsgl(1048576) trigger trigtype(first) trigdata(99_00) initq(system.channel.initq) replace //00传输队列
def chl(99_29) chltype(sdr) discint(1800) conname('192.168.1.29(6666)') xmitq(MB) trptype(tcp) shortrty(10000) shorttmr(30) longtmr(300) longrty(999999999) batchsz(50) replace
def chl(29_99) chltype(rcvr) trptype(tcp) replace //29的发送及接受通道
def chl(99_00) chltype(sdr) discint(1800) conname('192.168.1.31(6666)') xmitq(MB00) trptype(tcp) shortrty(10000) shorttmr(30) longtmr(300) longrty(999999999) batchsz(50) replace
def chl(00_99) chltype(rcvr) trptype(tcp) replace //00的发送及接受通道
def listener(MB99) trptype(tcp)
alter listener(MB99) trptype(tcp) port(6666) control(qmgr)
alter qmgr ccsid(819)
end
============MB=========
mqsicreateconfigmgr -i kongpeng -a $$ -q MB99 MB_MANAGER
mqsistart MB_MANAGER
192.168.1.29配置:
========MQ===========
crtmqm -lc -lf 8192 -lp 2 -ls 1 -q MB
strmqm MB
runmqsc MB
define channel(SYSTEM.ADMIN.SVRCONN) chltype(SVRCONN) trptype(TCP) mcauser('mqm')
define channel(CHANNEL1) chltype(SVRCONN) TRPTYPE(TCP) mcauser('mqm')
def ql(deadq) defpsist(yes) maxdepth(20000) replace
def ql(ERRMSG) defpsist(yes) maxdepth(20000) replace
alter qmgr deadq(deadq)
def ql(in) maxdepth(10000) defpsist(yes) maxmsgl(1048576) replace
def qr(99_IN) rname(IN) rqmname(MB99) xmitq(MB99) defpsist(yes) replace
def ql(MB99) usage(xmitq) defpsist(yes) maxdepth(10000) maxmsgl(1048576) trigger trigtype(first) trigdata(29_99) initq(system.channel.initq) replace
def chl(29_99) chltype(sdr) discint(1800) conname('192.168.1.199(6666)') xmitq(MB99) trptype(tcp) shortrty(10000) shorttmr(30) longtmr(300) longrty(999999999) batchsz(50) replace
def chl(99_29) chltype(rcvr) trptype(tcp) replace
def listener(MB) trptype(tcp)
alter listener(MB) trptype(tcp) port(6666) control(qmgr)
alter qmgr ccsid(819)
end
============MB=========
mqsicreatebroker MB -i kongpeng -a $$ -q MB -n MBDB
mqsistart MB
mqsicreateconfigmgr -i kongpeng -a $$ -q MB MB_MANAGER
mqsistart MB_MANAGER
---------------------------------------------------------------------------------------------------------------------
mqsicreateaclentry MB_MANAGER -u kongpeng -a -x F -p
Add an access control list (ACL) entry to the Configuration Manager for the user with the Message Brokers Toolkit local user ID. For example, if USERA connects to the Message Brokers Toolkit on COMPUTERA, which belongs to DOMAINA, and is trying to connect to Configuration Manager CMA:
USERA must exist as a user on the Configuration Manager system and belong to the mqm group
USERA could have one of the following ACL entries:
To create an ACL entry for USERA to connect with full Configuration Manager Proxy authority from any computer or domain, issue the following command:
mqsicreateaclentry CMA -u USERA -a -x F -p
To create an ACL entry for USERA to connect with full Configuration Manager Proxy authority from COMPUTERA only, issue the following command:
mqsicreateaclentry CMA -u USERA -m COMPUTERA -x F -p
To create an ACL entry for USERA to connect with full Configuration Manager Proxy authority from DOMAINA only, issue the following command:
mqsicreateaclentry CMA -u USERA -m DOMAINA -x F -p
If a domain name and computer name match, and an ACL entry specified the -m parameter, connection from either the domain or computer is acceptable because they are not considered to be different users.
ACLs are necessary for all connections to the Configuration Manager so the user who issues a command such as mqsideploy from the command line must also have appropriate ACL entries.
setmqaut -m MB -t qmgr -p kongpeng +all
dspmqaut -m MB -t qmgr -p kongpeng
没有评论:
发表评论