您创建的每个概要都会在概要注册中心注册:
<was_home>/properties/profileRegistry.xml
您已经看到如何用 Profile Management 工具创建概要。这个向导的核心是 manageprofi les 命令。这个命令为您提供了对概要进行普通的维护活动的方法。例如,您可以调用这个命令,创建(采用本机方式或静默方式)、列出、删除概要,验证概要注册中心,和完成其他功能。
使用 manageprofiles 命令
manageprofi les 命令可以在 <was_home>/bin 目录下找到。
语法
manageprofi les 命令使用下列语法:
对于 Windows,使用 manageprofi les.bat -模式 -参数
对于 UNIX,使用 manageprofiles.sh -模式 -参数
可以使用表中的下列模式。
表manageprofiles 的模式
模式 用途
-create: 创建一个新的概要。
-augment 使用给定的概要模板,扩充某个特定的概要。
-delete 删除一个概要。
-unaugment: 取消对概要的扩充。
-deleteAll 删除所有已注册的概要。
-listProfile 列出概要注册中心中的概要。
-getName 返回指定路径下的概要的名称。
-getPath 返回指定概要名称的路径。
-validateRegistry 验证概要注册中心,并返回一个无效概要的列表。
-validateAndUpdateRegistry 验证概要注册中心,列出被清除的无效概要。
-getDefaultName 返回缺省概要的名称。
-setDefaultName 设置缺省概要。
-backupProfile 将指定的概要备份到一个 zip 文件。
-restoreProfile 从 zip 文件中恢复指定的概要。
-response 在一个响应文件中管理概要。
-help 显示帮助。
输入 manageprofiles -<mode> -help,以显示每种模式的详细帮助。请参阅示例 3-2,查看 manageprofiles -create -help 命令的示例。
C:\Program Files\IBM\WebSphere\AppServer\bin>manageprofiles -create -helpThe following command line arguments are required for this mode.Command-line arguments are case sensitive. create: Creates a new profile. Specify -help -create -templatePath <path> to get template-specific help information. templatePath: The fully qualified path name of the profile template that is located on the file system. The following example selects a template: templatePath <app_server_home>/profileTemplates/<Template_name> profileName: The name of the profile. profilePath: The intended location of the profile in the file system. The following command line arguments are optional, and have no default values. Command-line arguments are case sensitive. isDefault: Make this profile the default target of commands that do not use their profile parameter.
输入 manageprofiles -listProfiles,查看注册中心的概要列表。下面是 -listProfiles 的一个输出结果示例:
C:\Program Files\IBM\WebSphere\AppServer\bin>manageprofiles -listProfiles[Dmgr01, AppSrv01, Custom01, Custom02, Dmgr02]
创建一个概要
您可以使用 manageprofiles 命令而不是 Profile Management 工具创建概要。Profile 模板:概要是根据随产品提供的模板创建的。这些模板位于 <was_home>/profileTemplates。每个模板都由一组提供概要初始设置的文件和概要创建后将采取的操作列表组成。目前还没有为您提供修改这些模板以及创建新模板的方法。当您使用 manageprofiles 创建概要时,您需要指定下列模板中的一个:
Default(对于应用程序服务器概要)
Dmgr(对于部署管理器概要)
Managed(对于自定义概要)
Cell(对于单元概要)
例如,示例 显示了如果要在主机 kcgg1d7.itso.ibm.com 的 sacell1 单元中,在节点 sanodel 下创建一个名为 saserver1 的应用程序服务器,应在命令行中使用的命令。
示例用 manageprofiles 命令创建一个概要
cd $WAS_HOME\bin{asuming WAS_HOME was set to some value, for example to "C:\Program Files\IBM\WebSphere\AppServer"}manageprofiles -create -profileName saserver1 -profilePathC:\myWAS61Profiles\appSrvrProfiles\saserver1 -templatePath$WAS_HOME\profileTemplates\default -nodeName sanode1 -cellName sacell1-hostName kcgg1d7.itso.ibm.com
在静默模式下创建一个概要
可以在静默模式下使用响应文件创建概要。使用的命令为:
<profile_management_tool> -options <response_file> -silent
在这个示例中,<profile_management_tool> 是启动 Profile Management 工具时需要的命令。用来启动向导的命令与平台有关,该命令位于 <was_home>/bin/ProfileManagement 下。在表中选择您的平台所用的命令。
表 特定于平台的创建向导
平台(32 位) Profile Management 工具命令
Linux/HP-UX/Solaris/AIX pmt.sh
Windows pmt . bat
示例响应文件存储在 <was_home>/bin/profileCreator 目录中。
删除概要
要删除一个概要,您必须按下列方法操作:
1. 如果您要移除一个已经与某个单元联合的自定义概要或应用程序服务器概要:
停止节点上的应用程序服务器。使用管理控制台或 removeNode 命令,将节点从单元中移除。移除一个节点并不会删除它,只是使它恢复到联合前的配置,该配置以前是作为联合过程的一部分予以保存的。
执行 removeNode.sh -profileName $profileName
执行两次 ./manageprofiles.sh -unaugment -profileName $profileName 取消对概要的扩充。
使用 manageprofiles -delete 删除概要。使用 manageprofiles -validateAndUpdateRegistry 命令清除概要注册中心。
删除 <profile_home> 目录。
2. 如果您要移除一个未与某个单元联合的应用程序服务器概要:
停止应用程序服务器。
执行 removeNode.sh -profileName $profileName
使用 manageprofiles -validateAndUpdateRegi stry 命令清除概要注册中心。
删除 <profile_home> 目录。
3. 如果您要移除某个部署管理器概要:
使用管理控制台或 removeNode 命令,移除与单元联合的所有节点。移除一个节点并不会删除它,只是使它恢复到联合前的配置,该配置以前是作为联合过程的一部分予以保存的。停止部署管理器。
执行 removeNode.sh -profileName $profileName
使用 manageprofiles -validateAndUpdateRegi stry 命令清除概要注册中心。
删除 <profile_home> 目录。
用 manageprofiles 删除一个概要
要删除一个概要,请使用 manageprofiles -delete 命令。其格式是: manageprofiles -delete -profileName <profile>
当该命令完成后,概要将从概要注册中心中移除,除了日志文件之外的运行时组件也将从 <profile_home> 目录中移除。
如果在删除概要时出现了错误,请检查下列日志: <was_home>/logs/manageprofile/<profile_name>_delete.log
例如,在示例中,您可以看到用 manageprofiles 命令删除名为 Node06 的概要。
示例用 manageprofiles 删除一个概要
C:\WebSphere\ND\profiles\Dmgr01\bin>manageprofiles -delete -profileNameNode06 INSTCONFSUCCESS: Success: The profile no longer exists.
为保证注册中心已被正确更新的一个额外的步骤,您可以列出概要,以确保概要已从注册中心去除,并对注册中心进行验证。请参阅示例。
示例验证删除概要的结果
C:\WebSphere\ND\profiles\Dmgr01\bin>manageprofiles -listProfiles [Dmgr01,AppSrv01, AppSrv02, SamplesServer, WebServer2Node, DmgrSecure]C:\WebSphere\ND\profiles\Dmgr01\bin> manageprofiles-validateAndUpdateRegistry []
注意:如果在删除过程中出现问题,您可以手动删除概要。与此相关的详细信息,请参阅"Information Center"中的 Deleting a profile 主题。