was集群搭建部署

一、服务器环境搭建

准备两台服务器:

192.168.14.136

192.168.14.137

使用root用户修改主机名主机解析地址

(1)主机名修改:

192.168.14.136 主机名修改为:app1

192.168.14.137 主机名修改为:app2

[[email protected] ]# vi /etc/sysconfig/network

was集群搭建部署

(2)主机解析地址修改(两台服务器分别都要修改)

[[email protected] ]# vi  /etc/hosts

was集群搭建部署

(3)让修改的主机名生效(无需重启服务器)

[[email protected]]#hostname + 主机名

二、was集群搭建

(1)在app1服务器上创建DM概要文件命令,创建集群控制台

/was/WebSphere/AppServer/bin/manageprofiles.sh \
-create -profileName Dmgr01 \
-profilePath /was/WebSphere/AppServer/profiles/Dmgr01 \
-templatePath /was/WebSphere/AppServer/profileTemplates/dmgr \

-hostname app1

以上脚本路径调整和自己环境对应 、profiles名称等可自行修改

was集群搭建部署

(2)在app1服务器上节点1,创建应用概要文件

/was/WebSphere/AppServer/bin/manageprofiles.sh \
-create -profileName myapp1 \
-profilePath /was/WebSphere/AppServer/profiles/myapp1 \
-templatePath /was/WebSphere/AppServer/profileTemplates/default \

-hostname app1

以上脚本路径调整和自己环境对应 、profiles名称等可自行修改

(3)在app2服务器上节点1,创建应用概要文件

/was/WebSphere/AppServer/bin/manageprofiles.sh \
-create -profileName myapp2 \
-profilePath /was/WebSphere/AppServer/profiles/myapp2 \
-templatePath /was/WebSphere/AppServer/profileTemplates/default \

-hostname app2

以上脚本路径调整和自己环境对应 、profiles名称等可自行修改

(4)app1服务器启动DM

启动DM(进入到Dmgr01路径下执行)

cd /was/WebSphere/AppServer/profiles/Dmgr01/bin

启动命令:./startManager.sh

was集群搭建部署

(5) app1服务器启动server1(进入到AppSrv01路径下执行)

进入以下目录:

/was/WebSphere/AppServer/profiles/myapp/bin

执行命令:./startServer.sh server1

was集群搭建部署

(6) app2服务器启动server1

执行命令:./startServer.sh server1

 

was集群搭建部署

 

(6)联合节点  将app2服务器(myapp2)连接到app1服务器  (Dmgr01)

app2服务器上路径 /was/WebSphere/AppServer/profiles/myapp2/bin/ 执行:

./addNode.sh + app1服务器主机名

注意:如果没成功报错了可能是根目录下/tmp 的权限不够

用root执行:chmod 777 /tmp/

集群控制台:https://192.168.14.136:9043/ibm/console/logon.jsp

 

(7)查看节点状态是否正常

was集群搭建部署

(8)新建集群

was集群搭建部署

一个节点下可以创建多个成员

was集群搭建部署

was集群搭建部署

was集群搭建部署

 

(9)为服务器部署应用

was集群搭建部署

启动安装的引用为其他服务器分发程序

was集群搭建部署

was集群搭建部署

was集群搭建部署

(10)问题

1、请求程序地址报错  日志输出:

可能需要将新的虚拟主机别名 *:<your port> 添加至 [app2:80] 所在的虚拟主机。

新增主机别名+端口,如图

was集群搭建部署