---
title: "WAS6.1管理实践总结"
author: "zior"
date: "2009-09-25T10:59:56Z"
tags: []
slug: "was6-1"
draft: false
lastmod: "2009-10-12T21:17:44Z"
id: 477078
url: "https://zior.iteye.com/blog/477078"
---

结合WAS管理员认证资料和WAS实际使用经验，整理出WAS基础理论和实践步骤。


未能传图，详细版本参见 原文 [http://zior.org/archives/89.html](http://zior.org/archives/89.html)


1       架构拓扑





重要概念：

1． 概要文件（Profile）

所有受管节点，非受管节点，Dmgr，都是概要文件。

概要文件只是管理意义，在物理上讲，所有概要文件既可以在同一机器上，也可以一个概要文件一台机器。

2． 节点（Node）

一个节点（Node）即一个概要文件（Profile），Profile默认目录名为Appsrv01、AppSrv02，建议目录名为Profile01、Profile02，避免概念混淆。每次新建应用服务器概要表时，会自动创建一个server1，可以通过管理方式自己添加server2….

受管节点(managed Node)：能受Dmgr统一管理的节点，能自动启动和更新配置，统一部署应用环境和应用系统。

非受管节点(unmanaged Node)：一般应用于非IHS的Web Server，需要手动更新配置，启动，停止等等维护操作。

3． 部署管理器（Dmgr）

特殊节点。用来统一控制、管理节点，配置集群环境。节点加入Dmgr后，节点的所有配置以Dmgr为主（Master配置），配置更改时，由Dmgr将配置xml同步到节点中。

4． 节点代理（NodeAgent）

节点代理负责节点与DMgr间的通信。一个节点唯一能对应一个节点代理。节点代理只能通过手动命令（startNode）或windows服务启动。

5． 节点独立运行与Dmgr运行方式的异同

a)     独立节点通过addNode命令添加到Dmgr中

从Dmgr1添加server1所属节点Node1

Dmgr1\bin\&gt; addNode  Node1主机名   Node1SOAP 端口  （-includeApp）

从Server1添加到Dmgr1

Profile01\bin\&gt; addNode  Dmgr1主机名  Dmgr1 SOAP端口  （-includeApp）

b)    普通节点加入Dmgr后，不能再作为独立AppServer启动。而且启动时，必须先启动NodeAgent，才能启动server1， 但其所属Dmgr1的启动与前二者无关。

c)     节点加入Dmgr时，配置会被备份保存，当removeNode脱离Dmgr时，恢复备份。





2       架构运行拓扑


3       WAS安装
静默安装 $WASRoot\ bin\ProfileCreator\&gt;

修改配置模板文件responsefile.pct.NDmanagedProfile.txt，主要更改各端口和节点名称等配置
启动概要表创建向导
\&gt;pctWindows.exe –options “myresponsefile.txt” -silent



脚本执行安装 $WASRoot\ bin\&gt;

\&gt;wasprofile –create –templaePath … -profileName… -nodeName … -cellName … -hostName…



wasprofile 概要表管理命令，6.1版本改名为manageProfiles，

概要表删除：\&gt;wasprofile –delete –profileName Profile01

全部删除：  \&gt;wasprofile -deleteAll



4       应用部署
a)     环境/Websphere变量，配置JAVA_HOME, Oracle, DB2驱动路径等等环境变量。



JVM初始堆栈大小设置的位置

/server1/Java and process Management/process Definition/JVM …



b)    安全性à全局安全性àJAAS配置àJ2C数据认证,, 配置用户密码组(数据库的)

c)     JDBCà数据源,,  创建数据源, 组件管理认证用上面建的J2C

d)    部署EAR



WAS有种增强性EAR(Enhanced EAR), 可以将数据源配置等等文件打包进去。由RAD打包，功能强大但超级的慢，一般机器跑不动。其简化版AST（Websphere Application Server Toolit）



5       集群


集群就是把各节点的服务器给打包，享用共同的资源环境，如数据源，复制域等等。

集群所有配置操作都是通过Dmgr进行的，所以只有将Node加入Dmgr后才能配置集群。

集群创建后需要重新同步节点配置，和重新生成HttpServer的Plugin



工作量管理（WorkLoad Management， WLM）













6       系统管理










管理命令wsadmin，功能强大，所有控制台的操作最后都是转为执行wsadmin



脚本语言

JACL,  TCL演化而来

Jyphon，Python演化二来，仿Java语法



bin\&gt;wsadmin.bat

wsadmin\&gt;$Help help

wsadmin\&gt;$AdminConfig getNode



直接执行命令

bin\&gt;wsadmin –c “$AdminConfig getNode”



直接执行脚本文件

bin\&gt;wsadmin –f  “c:/xxx.script”







7       WRD
快速开发部署工具， 开发环境中自动部署

\&gt;Set WORKSPACE= d:\wrd

\&gt;wrd-config –project “Back.ear” –style “autoappinstall”

\&gt;wrd –monitor

当把ear或class文件复制到project目录时， wrd自动部署。



8       常用命令


dumpNameSpace：  查看节点，JNDI等信息

collector：信息收集器，包括系统，网络状情况，was使用情况，节点配置信息等等用于服务器健康巡检和再现服务器上的问题。

该命令不能在was目录中运行，需另建目录执行：

C:\tempp\&gt;d:\ibm\was\bin\collector.bat

resources.xml    JDBC等信息

virtualhosts.xml  虚拟主机

serverIndex.xml  包含SOAP端口



startServer/stopServer server1 –profileName Profile01  启动、停止服务器

如果在profileName的bin目录下执行命令，则可省去参数profileName



startNode/stopNode –profileName Profile01  启动、停止节点代理



$DmgrProfile\&gt;addNode/removeNode Node-HostName Node-SOAP-Port –includeApp

Dmgr添加、删除节点



JspBatchCompliler.bat –ear path    “…ear”

JSP预编译



backConfig

restorConfig

备份、回复Profiles，默认路径为Profile1/bin/webshpereConfig_日期.zip



Waslogbr 分析、诊断activity.log



9       日志、配置文件介绍


日志目录 Profile01/logs/

pctLog.txt

ivt_config.log

portdef.props

backupConfig.log

restorConfig.log



日志目录 Profile01/logs/server1/…

activity.log





日志目录 $WASRoot/logs/

Log.txt   记录was安装状态

../wasprofile/.. profile创建日志， xml格式



配置文件

\ecurity.xml

\virtualhosts.xml



\serverindex.xml 定义节点名等应用和各端口，包括soap, http(s),,

\server.xml   server配置



各节点resources.xml, variables.xml, 作用域由主到次，如果应用为Enhanced EAR，则以EAR包中定义的变量为主（针对重复变量）



\profiles

Sas.client.props 客户端安全配置信息，wsadmin使用



\Properties

profileregistry.xml  所有profiles及其profile属性列表

wasprofile.properties  记录如profile安装日志路径，日志级别