ce97
作者ce972015-03-31 18:14
软件开发工程师, 某某某

websphere_wsadmin.sh

字数 21265阅读 2618评论 0赞 0

websphere 6.0.2

/app1/ibm/IBM/WebSphere/AppServer/bin/wsadmin.sh

wsadmin命令行管理

[@more@]

./wasprofile.sh
-create -profileName bladetcb6profile
-profilePath /usr/IBM/WebSphere/AppServer/profiles/bladetcb6profile
-templatePath /usr/WebSphere/AppServer/profileTemplates/default
-nodeName bladetcb6node
-cellName bladetcb6Cell
-hostName bladetcb6.rtp.raleigh.ibm.com

AppSrv01

./wasprofile.sh -create
-profileName AppSrv01
-profilePath /app1/ibm/IBM/WebSphere/AppServer/profiles/AppSrv01
-templatePath /app1/ibm/IBM/WebSphere/AppServer/profileTemplates/default
-nodeName NXYD-APP2Node01
-cellName NXYD-APP2Node01Cell01
-hostName NXYD-APP2

AppSrv02

./wasprofile.sh -create
-profileName AppSrv02
-profilePath /app1/ibm/IBM/WebSphere/AppServer/profiles/AppSrv02
-templatePath /app1/ibm/IBM/WebSphere/AppServer/profileTemplates/default
-nodeName NXYD-APP2Node02
-cellName NXYD-APP2Node01Cell02
-hostName NXYD-APP2

Dmgr01

./wasprofile.sh -create
-profileName Dmgr01
-profilePath /app1/ibm/IBM/WebSphere/AppServer/profiles/Dmgr01
-templatePath /app1/ibm/IBM/WebSphere/AppServer/profileTemplates/dmgr
-nodeName NXYD-APP2CellNode01
-cellName NXYD-APP2Cell01
-hostName NXYD-APP2

Custom01

./wasprofile.sh -create
-profileName Custom01
-profilePath /app1/ibm/IBM/WebSphere/AppServer/profiles/Custom01
-templatePath /app1/ibm/IBM/WebSphere/AppServer/profileTemplates/managed
-nodeName NXYD-APP2Custom01Node01
-cellName NXYD-APP2Node01Cell01
-hostName NXYD-APP2

cd /app1/ibm/IBM/WebSphere/AppServer/bin/
列出现有的概要文件:
./wasprofile.sh -listProfiles

删除概要文件:
./wasprofile.sh -delete -profileName profile_name

从现有概要文件的路径获取其名称:
./wasprofile.sh -getName -profilePath profile_path

从现有概要文件的名称获取其路径:
./wasprofile.sh -getPath -profileName profile_name [-debug]

检查概要文件注册表的完整性:
./wasprofile.sh -validateRegistry
[-debug]
检查概要文件注册表的完整性,除去未找到的概要文件:
./wasprofile.sh -validateAndUpdateRegistry
[-backup file_name]
[-debug]

除去概要文件的最新扩充:
./wasprofile.sh -unaugment
-profileName profile_name

支持的参数包括:
-augment
使用 augment 参数以通过扩充模板对现有概要文件进行更改。augment 参数导致 wasprofile 使用 templatePath 参数中的模板更新或扩充在 profileName 参数中标识的概要文件。您可以使用哪些扩充模板取决于您的环境中安装的 IBM 产品及其版本。
注: 随 WebSphere Application Server 附带的模板只能用于创建概要文件,不能用于扩充现有的概要文件。此外,不要手工修改 install_dir/ profileTemplates 目录中的文件。例如,如果要在创建概要文件期间修改端口,则使用“概要文件创建”向导,或对 wasprofile 命令使用 -startingPort 或 -portsFile 参数,而不要修改概要文件模板目录中的文件。
当调用扩充操作时,wasprofile 命令尝试访问指定的模板路径中的 actionRegistry.xml 文件。然后对指定的概要文件应用在操作注册表文件中的 Config Actions 节中定义的操作。

请对 -templatePath 指定标准文件路径。对 -templatePath 参数指定相对文件路径会导致不能充分扩充指定的概要文件。

另请参阅 unaugment 参数。

-cellname cell_name
指定概要文件的单元名。请对每个概要文件使用唯一单元名。
这是 WebSphere Application Server 的可选参数。

如果您省略该参数,则将指定缺省单元名。

-create
创建概要文件。
指定 wasprofile -create -templatePath fully_qualified_file_path_to_template -help 以获取关于创建概要文件的特定信息。可用的模板包括:
dmgr - Deployment Manager
缺省值 - 独立应用程序服务器
受管 - 定制节点
-debug
打开 wasprofile 命令使用的 Ant 实用程序的调试功能。
-delete
删除概要文件。删除概要文件不会删除概要文件目录。例如,假定您在 /usr/WebSphere/AppServer/profiles/managedProfile 目录中创建一个概要文件。在您删除概要文件之后,该目录仍然存在。
删除概要文件之前,请缩小已执行的任何扩充。

您可以删除或保留该目录。然而,profile_dir/logs 目录包含关于卸载概要文件的信息。例如,您可以保留 _nodeuninst.log 文件以确定在卸载过程中发生的任何问题的原因。

delete 参数不会自动执行缩小。必须在删除概要文件之前手工执行缩小。

-getName
获取以给定的 -profilePath 参数注册的概要文件的名称。
-getPath
获取给定名称的概要文件的文件系统位置。需要 -profileName 参数。
-help
显示命令语法。
-hostName host_name
指定您创建概要文件的主机名。这应该与您在初始产品安装过程中指定的主机名相匹配。
-isDefault
指定由一起使用的 -profileName 参数标识的概要文件在注册后将成为缺省概要文件。当发出针对缺省概要文件的命令时,则不必使用命令的 -profileName 属性。
-listProfiles
列出所有定义的概要文件。
-nodeName node_name
指定用新概要文件创建的节点的节点名。在或机器上使用唯一值。每个共享同一个产品二进制文件集的概要文件必须具有唯一节点名。
-portsFile file_path
指定文件路径的可选参数,该文件定义新概要文件的端口设置。省略时,wasprofile 工具查找 app_server_root/profileTemplates/profile_type /actions/portsUpdate/bin/portdef.props 文件。
不要在使用 -startingPort 参数时使用此参数。

-profileName profile_name
指定概要文件的名称。创建概要文件时使用唯一值。每个共享同一个产品二进制文件集的概要文件必须具有唯一名称。
-profilePath profile_path
指定到概要文件的标准路径。

AIX
-templatePath /usr/WebSphere/AppServer/profileTemplates/default

LINUX
-templatePath /opt/IBM/WebSphere/AppServer/profileTemplates/default

unaugment
扩充是将已更改的模板应用到现有概要文件的能力。当您缩小已扩充的现有概要文件时,将根据先前指定的概要文件模板撤消更改。如果执行了一系列 wasprofile 扩充,则缩小操作将首先撤消最后的扩充操作。
当调用缩小操作时,wasprofile 尝试访问在扩充命令中指定的模板路径中的 deleteRegistry.xml 文件。然后对指定的概要文件应用在删除注册表文件中的 Config Actions 节中定义的操作。

另请参阅 augment 参数。

-validateAndUpdateRegistry
检查概要文件注册表中列出的所有概要文件,以查看文件系统中是否存在这些概要文件。从注册表除去任何缺少的概要文件。返回从注册表删除的缺少的概要文件列表。
-validateRegistry
检查概要文件注册表中列出的所有概要文件,以查看文件系统中是否存在这些概要文件。返回缺少的概要文件的列表。

用例方案
用例是工具使用的一般任务的描述。

方案:删除概要文件
为了可读性,以下命令位于多个行上。在一行输入命令来删除名为 shasti 的概要文件:
wasprofile.sh -delete
-profileName shasti
方案:使用预定义的端口号
当您使用不具有 -startingPort 参数的 wasprofile 工具时,该工具使用 app_server_root/profileTemplates/profile_type /actions/portsUpdate/bin/portdef.props 文件来设置初始端口。

示例
复制文件、编辑端口设置然后按以下示例所示使用 -portsFile 参数使用副本:
wasprofile.bat
-create
-profileName Wow_Profile
-profilePath
profile_root
-templatePath
app_server_rootprofileTemplatesdefault
-nodeName Wow_node
-cellName Wow_cell
-hostName lorriemb
-portsFile C:tempportsportdef.props

假设 portdef.props 文件具有以下值:
WC_defaulthost=39080
WC_adminhost=39060
WC_defaulthost_secure=39443
WC_adminhost_secure=39043
BOOTSTRAP_ADDRESS=32809
SOAP_CONNECTOR_ADDRESS=38880
SAS_SSL_SERVERAUTH_LISTENER_ADDRESS=39401
CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS=39403
CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS=39402
ORB_LISTENER_ADDRESS=39100
DCS_UNICAST_ADDRESS=39353
SIB_ENDPOINT_ADDRESS=37276
SIB_ENDPOINT_SECURE_ADDRESS=37286
SIB_MQ_ENDPOINT_ADDRESS=35558
SIB_MQ_ENDPOINT_SECURE_ADDRESS=35578

结果 serverindex.xml 文件看似以下示例:
<?xml version="1.0" encoding="UTF-8"?>
<serverindex:ServerIndex xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
...
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="BOOTSTRAP_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="lorriemb" port="32809"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="SOAP_CONNECTOR_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="lorriemb" port="38880"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="SAS_SSL_SERVERAUTH_LISTENER_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="lorriemb" port="39401"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="lorriemb" port="39403"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="lorriemb" port="39402"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="WC_adminhost">
<endPoint xmi:id="EndPoint_..." host="*" port="39060"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="WC_defaulthost">
<endPoint xmi:id="EndPoint_..." host="*" port="39080"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="DCS_UNICAST_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="lorriemb" port="39353"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="WC_adminhost_secure">
<endPoint xmi:id="EndPoint_..." host="*" port="39043"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="WC_defaulthost_secure">
<endPoint xmi:id="EndPoint_..." host="*" port="39443"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="SIB_ENDPOINT_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="*" port="37276"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="SIB_ENDPOINT_SECURE_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="*" port="37286"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="SIB_MQ_ENDPOINT_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="*" port="35558"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="SIB_MQ_ENDPOINT_SECURE_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="*" port="35578"/>
</specialEndpoints>
<specialEndpoints xmi:id="NamedEndPoint_..."
endPointName="ORB_LISTENER_ADDRESS">
<endPoint xmi:id="EndPoint_..." host="lorriemb" port="39100"/>
</specialEndpoints>
</serverEntries>
</serverindex:ServerIndex>
wasprofile 命令在 profile_rootlogs 目录中创建当前 portdefs.props 文件的副本。

不要在使用 startingPort 参数时使用 portsFile 参数。这两个参数相互排斥。

方案:从起始点增加缺省端口号
使用 -startingPort 参数,wasprofile 可以根据您在命令行给定的起始端口值指定端口号。继而,该工具从起始端口号值指定端口号。

端口指定的顺序是任意的。预测指定是不可能的。

例如,用 -startingPort 20002 创建的端口将与以下示例类似那样出现:

为 Application Server 概要文件指定端口

WC_defaulthost=20002
WC_adminhost=20003
WC_defaulthost_secure=20004
WC_adminhost_secure=20005
BOOTSTRAP_ADDRESS=20006
SOAP_CONNECTOR_ADDRESS=20007
SAS_SSL_SERVERAUTH_LISTENER_ADDRESS=20008
CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS=20009
CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS=20010
ORB_LISTENER_ADDRESS=20011
DCS_UNICAST_ADDRESS=20012
SIB_ENDPOINT_ADDRESS=20013
SIB_ENDPOINT_SECURE_ADDRESS=20014
SIB_MQ_ENDPOINT_ADDRESS=20015
SIB_MQ_ENDPOINT_SECURE_ADDRESS=20016
示例
以下是使用 wasprofile 命令从初始值 20002 创建端口的示例,附带前面的示例中显示的内容:
wasprofile.bat -create
-profileName shasti
-profilePath profile_root
-templatePath template_path
-nodeName W2K03
-cellName W2K03_Cell01
-hostName planetnt
-startingPort 20002

示例:使用命令来创建概要文件
以下示例显示如何使用 wasprofile 命令来创建概要文件。

请在一行上发出以下任何示例中的命令。每个示例都以多行显示命令来增加可读性。

创建独立应用程序服务器概要文件
app_server_root/bin/wasprofile.sh -create
-profileName Default01
-profilePath profile_root
-templatePath app_server_root/profileTemplates/default
-nodeName Default01Node
-cellName Default01Cell
-hostName myhost.mycity.mycompany.com
-isDefault
-startingPort 21000

------------------
websphere
nxydwebsphere=0924

71
websphere:501:
ibm:501

190
websphere:512
ibm:503

usersFile ${USER_INSTALL_ROOT}/customer_sample/users.props
users.props
# 5639-D57, 5630-A36, 5630-A37, 5724-D18
# (C) COPYRIGHT International Business Machines Corp. 1997, 2005
# All Rights Reserved * Licensed Materials - Property of IBM
#
# Format:
# name:passwd:uid:gids:display name
# where name = userId/userName of the user
# passwd = password of the user
# uid = uniqueId of the user
# gid = groupIds of the groups that the user belongs to
# display name = a (optional) display name for the user.
bob:bob1:123:567:bob
websphere:nxydwebsphere=0924:512:503:websphere


groupsFile ${USER_INSTALL_ROOT}/customer_sample/groups.props
groups.props
# 5639-D57, 5630-A36, 5630-A37, 5724-D18
# (C) COPYRIGHT International Business Machines Corp. 1997, 2005
# All Rights Reserved * Licensed Materials - Property of IBM
#
# Format:
# name:gid:users:display name
# where name = groupId of the group
# gid = uniqueId of the group
# users = list of all the userIds that the group contains
# display name = a (optional) display name for the group.
admins:567:bob:Administrative group
ibm:503:websphere:ibm group


定制注册表类名
指定实现 com.ibm.websphere.security.UserRegistry 接口的以点分隔的类名。

将定制注册表类名放入类路径。建议的位置是 %install_root%/lib/ext 目录。尽管定制注册表可以实现 com.ibm.websphere.security.UserRegistry 接口,但是为了实现向后兼容性,用户注册表可以改为实现 com.ibm.websphere.security.CustomRegistry 接口。

数据类型: 字符串
缺省值: com.ibm.websphere.security.FileRegistrySample


com.ibm.websphere.security.FileRegistrySample
com.ibm.websphere.security.CustomRegistry

========Error
com.ibm.ws.console.security.ConnectToRuntimeException:
null nested exception is com.ibm.websphere.security.CustomRegistryException:
users/groups information missing

=============手工清除应用
3.不正常的引用怎么手工清除
1.profiles/AppSrv01/config/cells/Nxyd-TestdbNode01Cell01/applications
2.安装目录中的web.ear
3.profiles/AppSrv01/wstemp
4.profiles/AppSrv01/temp


==============================
可以使用wsadmin工具,命令如下:
停止应用程序:
wsadmin>set appservername [$AdminControl queryNames type=ApplicationManager,node=PericlesNode(节点名),process=server1(WAS服务器名),*]
wsadmin>$AdminControl invoke $appservername stopApplication DefaultApplication(应用名)

启动应用程序:
wsadmin>set appservername [$AdminControl queryNames type=ApplicationManager,node=PericlesNode(节点名),process=server1(WAS服务器名),*]
wsadmin>$AdminControl invoke $appservername startApplication DefaultApplication(应用名)

或参见以下链接。
使用脚本编制启动应用程序:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/txml_startapplication.html


===================
# 列出所有的应用程序:
$AdminApp list

# 请先卸载该应用
$AdminApp uninstall services

保存配置:
$AdminConfig save

# Installing applications with the wsadmin tool
$AdminApp install e:/services.ear {-node ibm-42 -cell ibm-42 -server server1 -appname services -contextroot /service}
$AdminApp install c:/MyStuff/application1.ear {-cluster cluster -node ibm-42 -cell ibm-42 -server server1 -appname services }
$AdminConfig save

# 交互方式安装
$AdminApp installInteractive e:/services.war {-node ibm-42 -cell ibm-42 -server server1 -appname services -contextroot /services -installed.ear.destination d:websphere }
$AdminConfig save

# list Virtual Host
$AdminConfig list VirtualHost

# list taskinfo application
$AdminApp taskInfo /usr/WebSphere/webapps/YHXX_WEB_war.ear MapWebModToVH
$AdminApp view APPLICATION {-tasknames}
$AdminApp view adminconsole {-MapModulesToServers}

# View the application or module specified by the name parameter
$AdminApp view adminconsole

# Querying the server state using the wsadmin tool
set server [$AdminControl completeObjectName cell=ibm-42,node=ibm-42,name=server1,type=Server,*]
$AdminControl getAttribute $server state

# start a server using wsadmin
$AdminControl queryNames type=Server,*
$AdminControl startServer serverName mynode
$AdminControl startServer server1 ibm-42

# Stopping a server using wsadmin
$AdminControl queryNames type=Server,*
$AdminControl stopServer serverName nodeName
$AdminControl stopServer server1 ibm-42

# Query an application using wsadmin
$AdminControl queryNames type=Application,*
$AdminControl completeObjectName type=Application,name=services,*
$AdminControl completeObjectName type=Application,name=services,*process=nxyd-app1custom01node01

# Starting an application using wsadmin
set appManager [$AdminControl queryNames node=mynode,type=ApplicationManager,process=server1,*]
$AdminControl invoke $appManager startApplication services

# Stopping an application using wsadmin
set appManager [$AdminControl queryNames node=mynode,type=ApplicationManager,process=server1,*]
$AdminControl invoke $appManager stopApplication services

# Identifying running objects
$AdminControl queryNames *

# Querying the product identification using wsadmin
set server [$AdminControl completeObjectName type=Server,name=server1,node=ibm-42,*]
$AdminControl getAttribute $server serverVersion

# Starting a listener port using wsadmin
set lPorts [$AdminControl queryNames type=ListenerPort,cell=mycell,node=mynode,process=server1,*]
set state [$AdminControl getAttribute $lport started]
$AdminControl invoke $lPort start


# Uninstalling applications with the wsadmin tool
$AdminApp uninstall services
$AdminConfig save

# Editing application configurations with the wsadmin tool
$AdminApp editInteractive services
$AdminConfig save

# Configuring applications for enterprise bean modules using the wsadmin tool
set deployments [$AdminConfig getid /Deployment:services/]

set deploymentObject [$AdminConfig showAttribute $deployments deployedObject]
# To obtain a list of attributes you can set for session manager, use the attributes command:
$AdminConfig attributes SessionManager
set targetMappings [lindex [$AdminConfig showAttribute $deploymentObject targetMappings] 0]
$AdminConfig modify $targetMappings {{enable true}}
$AdminConfig save

# Create the shared library in the node, for example:
$AdminConfig list Library
set node [$AdminConfig getid /Cell:mycell/Node:mynode/]
set library [$AdminConfig create Library $node {{name mySharedLibrary} {classPath c:/mySharedLibraryClasspath}}]

# To use an existing shared library, issue the following command:
set library [$AdminConfig getid /Library:mySharedLibrary/]
set deployment [$AdminConfig getid /Deployment:myApp/]

# Retrieve the application deployment and assign it to the appDeploy variable:
set appDeploy [$AdminConfig showAttribute $deployment deployedObject]

# Identify the class loader in the application deployment and assign it to the classLoader variable:
set classLoader [$AdminConfig showAttribute $appDeploy classloader]

# Associate the shared library in the application through the class loader:
$AdminConfig create LibraryRef $classLoader {{libraryName MyshareLibrary} {sharedClassloader true}}
$AdminConfig save

# Starting a cluster using wsadmin
$AdminControl completeObjectName type=ClusterMgr,*
set clusterMgr [$AdminControl completeObjectName cell=NXYD-APP2Cell01,type=ClusterMgr,*]
$AdminControl invoke $clusterMgr retrieveClusters
$AdminControl completeObjectName cell=NXYD-APP2Cell01,type=Cluster,*
set cluster [$AdminControl completeObjectName cell=NXYD-APP2Cell01,type=Cluster,name=cluster,*]
$AdminControl invoke $cluster start

# Stopping a cluster using wsadmin
$AdminControl completeObjectName type=ClusterMgr,*
set clusterMgr [$AdminControl completeObjectName cell=NXYD-APP2Cell01,type=ClusterMgr,*]
$AdminControl invoke $clusterMgr retrieveClusters
$AdminControl completeObjectName cell=NXYD-APP2Cell01,type=Cluster,*
set cluster [$AdminControl completeObjectName cell=NXYD-APP2Cell01,type=Cluster,name=cluster,*]
$AdminControl invoke $cluster stop

# Querying cluster state using wsadmin
set cluster [$AdminControl completeObjectName cell=NXYD-APP2Cell01,type=Cluster,name=cluster,*]
$AdminControl getAttribute $cluster state

# Listing running applications on running servers using wsadmin
# ListAppON_Server.jacl
#----------------------------------------------------------------
# lines 4 and 5 find all the cell and process them one at a time
#----------------------------------------------------------------
set cells [$AdminConfig list Cell]
foreach cell $cells {
#-----------------------------------------------------------------------
# lines 10 and 11 find all the nodes belonging to the cell and
# process them at a time
#-----------------------------------------------------------------------
set nodes [$AdminConfig list Node $cell]
foreach node $nodes {
#--------------------------------------------------------------
# lines 16-20 find all the running servers belonging to the cell
# and node, and process them one at a time
#--------------------------------------------------------------
set cname [$AdminConfig showAttribute $cell name]
set nname [$AdminConfig showAttribute $node name]
set servs [$AdminControl queryNames type=Server,cell=$cname,node=$nname,*]
puts "Number of running servers on node $nname: [llength $servs]"
foreach server $servs {
#---------------------------------------------------------
# lines 25-31 get some attributes from the server to display;
# invoke an operation on the server JVM to display a property.
#---------------------------------------------------------
set sname [$AdminControl getAttribute $server name]
set ptype [$AdminControl getAttribute $server processType]
set pid [$AdminControl getAttribute $server pid]
set state [$AdminControl getAttribute $server state]
set jvm [$AdminControl queryNames type=JVM,cell=$cname,node=$nname,process=$sname,*]
set osname [$AdminControl invoke $jvm getProperty os.name]
puts " $sname ($ptype) has pid $pid; state: $state; on $osname"

#---------------------------------------------------------
# line 37-42 find the applications running on this server and
# display the application name.
#---------------------------------------------------------
set apps [$AdminControl queryNames type=Application,cell=$cname,node=$nname,process=$sname,*]
puts " Number of applications running on $sname: [llength $apps]"
foreach app $apps {
set aname [$AdminControl getAttribute $app name]
puts " $aname"
}
puts "----------------------------------------------------"
puts ""

}
}
}

wsadmin.sh -f ListAppON_Server.jacl

##################################################################################################################
# Managing generic servers using wsadmin
set template [$AdminConfig listTemplates Server server1]
set parent [$AdminConfig getid /Node:myNode/]
set gs [$AdminConfig createUsingTemplate Server $parent [list [list name myGenericServer]] $template]
set pd [lindex [$AdminConfig showAttribute $gs processDefinition] 0]
$AdminConfig modify $pd {{executableName generic1}}
# optionally executableArguments attribute can be modified to provide argument for executable set in executableName
# uncomment the following modify command and provide your argument here if argument is to be provided
# $AdminConfig modify $pd {{executableArguments yourArgumentHere;separatedbySemicolon;ifThereIsMoreThanOneArgument}}
#
# optionally you can also change workingDirectory to specify where the executable locates. The default is ${USER_INSTALL_ROOT}
# uncomment the following modify command to change workingDirectory value
# $AdminConfig modify $pd {{workingDirectory yourWorkingDirectoryHere}}
$AdminConfig save

# To start a generic server, use the launchProcess command, for example
set nodeagent [$AdminControl queryNames *:*,type=NodeAgent]
$AdminControl invoke $nodeagent launchProcess generic1

# To stop a generic server, use the terminate command, for example:
set nodeagent [$AdminControl queryNames *:*,type=NodeAgent]
$AdminControl invoke $nodeagent terminate generic1
To monitor the server state, use the getProcessStatus command, for example:

##################################

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

0

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广