本文概述
- 停止和启动Deployment Manager, 节点代理和JVM
- 备份与还原
- 获取版本和修订包信息
- 清除缓存
并非所有这些脚本都有用, 而且如果你是学习者, 则可能不知道在日常工作中使用的一些功能强大的脚本。
我列出了一些最有用的脚本, 以简化你作为WebSphere Administrator的生活。
以下脚本已在IBM WAS ND 8.5.5环境中进行了测试, 看不出它在任何其他环境中均无法使用的任何原因。
停止和启动Deployment Manager, 节点代理和JVMstopManager.sh
你可以使用上述命令停止Deployment Manager。
[[email
protected] bin]# ./stopManager.shADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr/stopServer.logADMU0128I: Starting tool with the Dmgr01 profileADMU3100I: Reading configuration for server: dmgrADMU3201I: Server stop request issued. Waiting for stop status.ADMU4000I: Server dmgr stop completed.[[email
protected] bin]#
注意:这必须在DMGR配置文件路径中执行。
startManager.sh
你可以使用上述命令启动Deployment Manager。
[[email
protected] bin]# ./startManager.shADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/dmgr/startServer.logADMU0128I: Starting tool with the Dmgr01 profileADMU3100I: Reading configuration for server: dmgrADMU3200I: Server launched. Waiting for initialization status.ADMU3000I: Server dmgr open for e-business;
process id is 9183[[email
protected] bin]#
注意:这必须在DMGR配置文件路径中执行。
startServer.sh
要启动JVM, 可以将startServer.sh与服务器名称一起使用, 如下所示。
[[email
protected] bin]# ./startServer.sh server1ADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.logADMU0128I: Starting tool with the AppSrv01 profileADMU3100I: Reading configuration for server: server1ADMU3200I: Server launched. Waiting for initialization status.ADMU3000I: Server server1 open for e-business;
process id is 10633[[email
protected] bin]#
注意:必须先启动Node Agent, 然后再启动JVM。
stopServer.sh
【有用的WebSphere Application Server管理脚本】你可以通过执行上述命令以及JVM名称来关闭JVM。
[[email
protected] bin]# ./stopServer.sh server1ADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/stopServer.logADMU0128I: Starting tool with the AppSrv01 profileADMU3100I: Reading configuration for server: server1ADMU3201I: Server stop request issued. Waiting for stop status.ADMU4000I: Server server1 stop completed.
[[email
protected] bin]#
stopNode.sh
要停止相应的节点代理, 你必须转到该配置文件并执行stopNode.sh以停止节点代理。
[[email
protected] bin]# ./stopNode.shADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/stopServer.logADMU0128I: Starting tool with the AppSrv01 profileADMU3100I: Reading configuration for server: nodeagentADMU3201I: Server stop request issued. Waiting for stop status.ADMU4000I: Server nodeagent stop completed.
[[email
protected] bin]#
startNode.sh
转到相应的配置文件并执行startNode.sh以启动节点代理。
[[email
protected] bin]# ./startNode.shADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/nodeagent/startServer.logADMU0128I: Starting tool with the AppSrv01 profileADMU3100I: Reading configuration for server: nodeagentADMU3200I: Server launched. Waiting for initialization status.ADMU3000I: Server nodeagent open for e-business;
process id is 11363[[email
protected] bin]#
serverStatus.sh
要了解JVM的状态, 可以将此脚本与–all参数一起使用。
这必须在各自的配置文件级别执行。如果你在DMGR配置文件级别执行此操作, 它将仅显示DMGR的状态。
[[email
protected] bin]# ./serverStatus.sh -allADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/serverStatus.logADMU0128I: Starting tool with the AppSrv01 profileADMU0503I: Retrieving server status for all serversADMU0505I: Servers found in configuration:ADMU0506I: Server name: nodeagentADMU0506I: Server name: server1ADMU0508I: The Node Agent "nodeagent" is STARTEDADMU0508I: The Application Server "server1" is STARTED[[email
protected] bin]#
备份与还原backupConfig.sh
在生产支持中学习的第一件事就是如何进行备份。如果什么都不起作用–备份会有所帮助。
你可以使用此脚本来备份WebSphere环境配置。最佳做法是, 你可以使用” –nostop” 参数, 因此无需停止Deployment Manager即可进行备份。
[[email
protected] bin]# ./backupConfig.sh -nostopADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/backupConfig.logADMU0128I: Starting tool with the AppSrv01 profileADMU5001I: Backing up config directory
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config to file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/WebSphereConfig_2015-04-12.zip....................................................................................................................................................................................................................................................................ADMU5002I: 933 files successfully backed up[[email
protected] bin]#
restoreConfig.sh
如果更改了配置, 但情况与预期不符, 那么可以恢复一下配置了。好了, 你可以使用备份文件来还原配置。
[[email
protected] bin]# ./restoreConfig.sh WebSphereConfig_2015-04-12.zip -nostopADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/restoreConfig.logADMU0128I: Starting tool with the AppSrv01 profileADMU5502I: The directory /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config
already exists;
renaming to
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config.oldADMU5504I: Restore location successfully renamedADMU5505I: Restoring file WebSphereConfig_2015-04-12.zip to location
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config.........................................................................................................................................................................ADMU5506I: 933 files successfully restoredADMU6001I: Begin App Preparation -ADMU6009I: Processing complete.ADMU6002I: Begin Asset Preparation -ADMU6009I: Processing complete.[[email
protected] bin]#
到目前为止你喜欢吗?向下滚动以获得更多乐趣!
获取版本和修订包信息versionInfo.sh
要了解服务器上安装的WAS版本, 构建级别, 软件包, 体系结构和已安装的功能。
[[email
protected] bin]# ./versionInfo.shWVER0010I: Copyright (c) IBM Corporation 2002, 2012;
All rights reserved.WVER0012I: VersionInfo reporter version 1.15.1.48, dated 2/8/12
--------------------------------------------------------------------------------IBM WebSphere Product Installation Status Report--------------------------------------------------------------------------------
Report at date and time April 12, 2015 3:18:41 AM PDT
Installation--------------------------------------------------------------------------------Product Directory
/opt/IBM/WebSphere/AppServerVersion Directory
/opt/IBM/WebSphere/AppServer/properties/versionDTD Directory
/opt/IBM/WebSphere/AppServer/properties/version/dtdLog Directory
/var/ibm/InstallationManager/logs
Product List--------------------------------------------------------------------------------NDTRIAL
installedInstalled Product--------------------------------------------------------------------------------Name
IBM WebSphere Application Server Network DeploymentVersion
8.5.5.0ID
NDTRIALBuild Level
gm1319.01Build Date
5/14/13Package
com.ibm.websphere.NDTRIAL.v85_8.5.5000.20130514_1044Architecture
x86-64 (64 bit)Installed Features
IBM 64-bit WebSphere SDK for Java
WebSphere Application Server Full Profile
EJBDeploy tool for pre-EJB 3.0 modules
Embeddable EJB container
Stand-alone thin clients and resource adapters
--------------------------------------------------------------------------------End Installation Status Report--------------------------------------------------------------------------------[[email
protected] bin]#
注意:你可能对以下支持的参数感兴趣。
- -fixpacks:显示修订包信息
- -long:显示所有修订包和ifix
- -ifixes:显示ifixes信息
如果你正在执行审核, 或者只想列出组件, 修订, 带有日期的更新包, 则可以运行此命令, 它将在当前工作目录(通常是bin文件夹)中生成historyReport.html。
getVersionReport.sh
显示WebSphere安装的构建版本和构建日期。 IBM支持人员经常要求调查特定版本是否存在任何可疑问题。
清除缓存清除缓存可能有多种原因, 最明显的原因是升级后。你应该考虑清除两个缓存1)JVM 2)OSGi。
clearClassCache.sh
要清除JVM的类缓存, 你可以执行上述脚本。
注意:清除类缓存之前, 必须先停止JVM。
osgiCfgInit.sh
执行以上命令以清除OSGi配置文件和服务器缓存。
[[email
protected] bin]# ./osgiCfgInit.shOSGi profile cache successfully cleaned for /opt/IBM/WebSphere/AppServer/profiles/Dmgr01.OSGi server cache successfully cleaned for /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/servers/dmgr.[[email
protected] bin]#
注意:不要忘记在清除缓存之前停止正在运行的进程。
管理个人资料
managesdk.sh
如果已安装多个SDK, 则可以切换版本。你还可以使用此脚本找出与你的配置文件相关的可用SDK。以下示例显示了可用的SDK列表。
[[email
protected] bin]# ./managesdk.sh -listAvailableCWSDK1003I: Available SDKs :CWSDK1005I: SDK name: 1.6_64CWSDK1001I: Successfully performed the requested managesdk task.[[email
protected] bin]#
pmt.sh
PMT(概要文件管理工具)可用于以GUI模式创建WebSphere概要文件。使用PMT创建配置文件非常容易-你要做的就是创建所需级别的配置文件并按照向导进行操作。你一定要试试看!
syncNode.sh
由于某些原因, 如果你无法通过管理控制台执行节点同步, 则可以从配置文件级别使用syncNode.sh。使用此脚本之前, 必须停止Node Agent。
你必须传递DMGR主机和SOAP端口号的参数。
[[email
protected] bin]# ./syncNode.sh localhost 8879ADMU0116I: Tool information is being logged in file
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/syncNode.logADMU0128I: Starting tool with the AppSrv01 profileADMU0401I: Begin syncNode operation for node localhostNode01 with Deployment
Manager localhost: 8879ADMU0016I: Synchronizing configuration between node and cell.ADMU0402I: The configuration for node localhostNode01 has been synchronized
with Deployment Manager localhost: 8879[[email
protected] bin]#
- 本地主机= Deployment Manager主机名
- 8879 = DMGR SOAP端口号
推荐阅读
- WebSphere,WebLogic,Tomcat,TC Server,JBoss中的UTF-8配置
- 在WebSphere Application Server中设置TimeZone
- 什么是WebSphere健康管理()
- 如何在Linux上安装IBM Installation Manager 1.8
- P2P层无法绑定到WebSphere 8.5中的UDP端口
- 在JVM,Nodeagent和DMGR中修改WebSphere内存堆大小
- WebSphere Application Server 8.5.5 ND安装指南
- firebase phone auth android崩溃
- 如何在Android Studio中删除代码格式化中不必要的空白行