×
新网 > 虚机资讯 > 正文

WebSphere7集群部署实践与总结

WebSphere(简称WAS)集群一般由一组应用服务器组成,每个服务器上部署了同样的应用程序。通过集群可以实现可扩展性、负载均衡、高可用性(提供故障恢复和补偿机制,在关键性业务中提供容错功能)。WAS提供水平集群和垂直集群两种形式,垂直集群是指同一机器上部署多个服务器,充分利用硬件资源,而水平集群利用多台机器资源,每台机器部署相同的应用。本案例主要侧重水平集群,但是其中的很多概念对于垂直集群也是

WebSphere(简称WAS)集群一般由一组应用服务器组成,每个服务器上部署了同样的应用程序。通过集群可以实现可扩展性、负载均衡、高可用性(提供故障恢复和补偿机制,在关键性业务中提供容错功能)。WAS提供水平集群和垂直集群两种形式,垂直集群是指同一机器上部署多个服务器,充分利用硬件资源,而水平集群利用多台机器资源,每台机器部署相同的应用。本案例主要侧重水平集群,但是其中的很多概念对于垂直集群也是适用的。

timg (46).jpg

一、安装环境和文件版本

操作系统:SUSE LINUX 10 SP3 企业版

Websphere版本:WAS7.0

安装部署环境:一台DM+APP 另一台APP 还有两个IHS服务器(或者也可装在两个APP上)
 

二、集群部署方案图

如图所示

中间件平台主要包括两大部分:

负载分发层:

包括两台服务器,通过Heartbeat实现HA,提供浮动IP给客户端,保证了系统不存在单点故障问题

负载分发软件采用IBM HTTP Server实现

通过IBM HTTP Server配置虚拟主机,实现对不同应用的请求分发到不同的后台WAS中间件集群。

WAS中间件集群:

包括两台服务器,每个服务器上通过水平扩展可以启动多个WAS服务器。

基于应用部署要求,为每个应用建立一个集群,逻辑上实现应用之间的隔离。

保证一个集群至少包括2个WAS实现,并且这两个实例分别在不同的物理服务器上,这样才能保证不出现单点故障。
 

三、WebSphere7集群安装

1、安装前的检查

集群安装时,确认所有机子的时间日期要一致

确认磁盘空间足够

安装目录都是安装于默认的/opt目录下

确认管理域之内的所有的服务器主机名和ip地址相互能够ping通

在安装前,要确保四台机的/etc/hosts文件里面增加四台机的ip与主机名,修改如下

**.**.**.1 app1

**.**.**.2 app2

**.**.**.3 server1

**.**.**.4 server2

(对于初次安装系统后的主机,因为没有在HOSTS文件中增加此类记录,会导致安装失败,现象是安装后生成的profiles不完整,并且startManager.sh执行失败,启动不了管理服务。另外,安装完WAS后,不能随意修改主机名,否则WAS的服务启动不了,需要重新安装)

2、开始安装

上传安装的软件介质到指定的服务器,配置服务器能够用xmanager或VNC进行图形化安装。如不能进行图形化安装,则需要修改was或his下的responsefile.txt文件中的各参数,工作量大而且易出错。
 

进入suse linux环境,打开终端,打开文件系统,在was安装目录下找到launchpad.sh脚本 ,./launchpad.sh运行

安装成功完成后,在app1主机下的/opt/IBM/WebServer/AppServer/profiles目录下可看到DMGR01,APPSRV01两个目录。其中DMGR01是管理台概要文件,只在app1主机上有。

 

同样,在主机app2机上安装was后,在app2下的/opt/IBM/WebServer/AppServer/profiles目录下可看到APPSRV01一个目录。

 

在app1主机下的profilesDMGR01FIRSTSTEPS目录下,

运行firststeps.sh,可进行安装后检测
 

检测结果如果正常,则DMGR服务可正常启动,访问端口是9060

此时到IE,可打开WAS控制台

http://**.**.**.**:9060/ibm/console

 

输入用户名和密码,进入主控画面

此时在服务器可以看到一个SERVER1,但没有启动代理服务前,前台是不能启动的。

需到服务器下运行。

# cd Profiles/AppSrv01/bin

# ./startNode.sh

节点代理启动

ADMU0116I: Tool information is being logged in file

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/startServer.log

ADMU0128I: Starting tool with the AppSrv01 profile

ADMU3100I: Reading configuration for server: nodeagent

ADMU3200I: Server launched. Waiting for initialization status.

ADMU3000I: Server nodeagent open for e-business; process id is 330

 

此时再到前控制台,可正常启动server1了

 

(或者在服务器下运行命令./startServer.sh Server1 ,同样可以启动服务)

 

至此,主机APP1安装并验证完毕。

 

在APP2上:

过程同app1机,不同处只是在概要文件创建里不选择cell,只选择一个application server就行了。

安装执行完成后,检查profiles下,已有appsrv01

至其下的bin执行如下脚本,关联节点NODE2到主机app1(server1)的DMGR服务节点

cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin

./addNode.sh **.**.**.** 8879

其中IP地址是主机app1的IP,后面的8879是SOP端口。

 

输入app1上DMGR01管理用户wasadmin,口令******

 

执行成功

# ./addNode.sh **.**.**.** 8879

ADMU0116I: Tool information is being logged in file

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/addNode.log

ADMU0128I: Starting tool with the AppSrv01 profile

CWPKI0308I: Adding signer alias "CN=APP1, OU=Root Cer" to local

keystore "ClientDefaultTrustStore" with the following SHA digest:

B5:37:07:88:00:A4:78:10:95:B0:56:17:3C:8D:A9:A7:C0:BD:76:3F

Realm/Cell Name: <default>

Username: admin

Password:

CWPKI0308I: Adding signer alias "datapower" to local keystore

"ClientDefaultTrustStore" with the following SHA digest:

A9:BA:A4:B5:BC:26:2F:5D:2A:80:93:CA:BA:F4:31:05:F2:54:14:17

ADMU0001I: Begin federation of node AAAAAPP2-******Node01 with Deployment

Manager at **.**.**.36:8879.

ADMU0009I: Successfully connected to Deployment Manager Server:

**.**.**.36:8879

ADMU0505I: Servers found in configuration:

ADMU0506I: Server name: server1

ADMU2010I: Stopping all server processes for node AAAAAPP2-******Node01

ADMU0512I: Server server1 cannot be reached. It appears to be stopped.

ADMU0024I: Deleting the old backup directory.

ADMU0015I: Backing up the original cell repository.

ADMU0012I: Creating Node Agent configuration for node: AAAAAPP2-******Node01

ADMU0014I: Adding node AAAAAPP2-******Node01 configuration to cell:

APP1Cell01

ADMU0016I: Synchronizing configuration between node and cell.

ADMU0018I: Launching Node Agent process for node: AAAAAPP2-******Node01

ADMU0020I: Reading configuration for Node Agent process: nodeagent

ADMU0022I: Node Agent launched. Waiting for initialization status.

ADMU0030I: Node Agent initialization completed successfully. Process id is:

6848

ADMU0300I: The node AAAAAPP2-******Node01 was successfully added to the

APP1Cell01 cell.

ADMU0306I: Note:

ADMU0302I: Any cell-level documents from the standalone APP1Cell01

configuration have not been migrated to the new cell.

ADMU0307I: You might want to:

ADMU0303I: Update the configuration on the APP1Cell01 Deployment

Manager with values from the old cell-level documents.

ADMU0306I: Note:

ADMU0304I: Because -includeapps was not specified, applications installed on

the standalone node were not installed on the new cell.

ADMU0307I: You might want to:

ADMU0305I: Install applications onto the APP1Cell01 cell using

wsadmin $AdminApp or the Administrative Console.

ADMU0003I: Node AAAAAPP2-******Node01 has been successfully federated.

 

此时再到app1主机的DMGR控制台可以看到节点app2主机的SERVR1

 

可以启动app2机上的SERVER1。(在app2机上的profiles/appsvr01/bin下执行./startServer.sh server1也可)

 

四、WebSphere7集群配置

把app1与app2的应用服务放在集群中

1、删除两个应用服务器下的单个SERVER。

停止两个服务后,删除,保存设置。

把单个服务器删除

 

2、建集群,起名HR_cluster

注意:把配置HTTP会话内存到内存的复制勾上

 

下一步分别对应两应用服务主机,各一个SERVER,分别名称为

app1

app2

集群建完后如下

 

进入系统管理->节点中同步各节点

 

然后启动集群,集群可正常启动

 

至此,两台应用服务器的集群安装完毕!

 

五、安装IHS HTTP WEB服务器

安装IHS HTTP SERVER与PLUGINS插件

解压程序安装包后,执行http_ins/ihs/目录下的install.sh文件,用xmanager来执行该文件进行安装。

 

安装画面如下:

第一步设置端口,选择默认的

Web1机的http port 80

http administration port 8008

 

后面一步,在设置插件安装目录与应用服务器主机名称那里,

app1对应的插件安装目录是默认的/opt/IBM/HTTPServer/plugins

对应的应用服务主机名设为 app1

(注意:app2那台机安装httpserver时,选择对应的应用服务主机设为app2,其他过程都相同)

注意在管理用户与口令那里设置为admin,******

注意:因为这两个web服务器要通过另外一台应用服务器的dmgr来管理,所以这里的安全管理用户与口令要设。否则dmgr上无法管理启停。

 

下面这一步,设置用户与组分别为nobody,nobody

(注意:这个用户与组在etc/group,passwd,shadow中要有)

两台IHS HTTP WEB服务器的启动过程

正常过程:

在两台WEB服务器下,HTTPServer/bin目录下,执行如下脚本,启停apache服务

./apachectl start

提示./adminctl start: admin http started

 

回到app1的DMGR主控制台,建立WEB服务节点与启动管理。

选择系统管理->节点,增加非受管制的两个WEB节点(前面两个app节点是受管制节点)

 

点添加,选择非受管节点

为WEB1机上的节点命名并设置主机名称

非受管节点名称:servernode01

主机名:server1

 

第一个节点添加成功

 

再同样操作继续添加第二个非受管节点

非受管节点名称:servernode02

主机名:server2

 

然后回到服务器类型下,选择WEB服务器,选择两个非受管节点,分别去创建WEBSERVER

 

下一步后,增加设置属性,管理用户与口令 .用户与口令是在WEB机上安装IHS HTTP SERVER时的设置admin,admin

 

完成第一个WEB节点上WEBSERVER的创建

 

同上操作再去完成第二个web服务节点的webserver创建。

两个都创建完毕后。选择生成插件(Generate plug-in)和传播插件(Propagate Plug-in)

 

生成插件成功,提示如下:

PLGC0005I: Plug-in configuration file =

 

/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/APP1Cell01/nodes/webnode1/servers/webserver1/plugin-cfg.xml

PLGC0052I: Plug-in configuration file generation is complete for the Web server. APP1Cell01.webnode1.webserver1.

PLGC0005I: Plug-in configuration file =

 

/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/APP1Cell01/nodes/webnode2/servers/webserver1/plugin-cfg.xml

PLGC0052I: Plug-in configuration file generation is complete for the Web server. APP1Cell01.webnode2.webserver1.

 

传播插件成功,提示如下:

PLGC0062I: The plug-in configuration file is propagated from

 

/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/APP1Cell01/nodes/webnode1/servers/webserver1/plugin-cfg.xml to

 

/opt/IBM/HTTPServer/Plugins/config/webserver1/plugin-cfg.xml on the Web server computer.

PLGC0048I: The propagation of the plug-in configuration file is complete for the Web server. APP1Cell01.webnode1.webserver1.

PLGC0062I: The plug-in configuration file is propagated from

 

/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/APP1Cell01/nodes/webnode2/servers/webserver1/plugin-cfg.xml to

 

/opt/IBM/HTTPServer/Plugins/config/webserver1/plugin-cfg.xml on the Web server computer.

PLGC0048I: The propagation of the plug-in configuration file is complete for the Web server. APP1Cell01.webnode2.webserver1.

 

两个WEB服务已建立,并可通过DMGR 来控制启停。

 

最后安装补丁加强系统的安全性。至此整个部署过程完毕。

 

  • 相关专题

免责声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,也不承认相关法律责任。如果您发现本社区中有涉嫌抄袭的内容,请发送邮件至:operations@xinnet.com进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。

免费咨询获取折扣

Loading