was 8.5.5.3 使用命令行方式部署应用:
1、cd /data/middleware/WebSphere/AppServer/profiles/AppSrv01/bin/
2、sh wsadmin.sh -user was -password Was123 -f wasdeploy.jacl
wasdeploy.jacl内容如下:
# 以下步骤中的hfcell,hfnode,server1,war包路径,war包名称 在使用时请替换为实际的值
# 应用部署命令参考:
# /data/middleware/WebSphere/AppServer/profiles/AppSrv01/bin/wsadmin.sh -user was -password Was123 -f wasdeploy.jacl
# STEP 1 停止应用
# 识别应用程序所在的服务器的应用程序管理器 MBean,并将其指定给 appManager 变量
set appManager [$AdminControl queryNames cell=hfcell,node=hfnode,type=ApplicationManager,process=server1,*]
# 停止单个应用
# myapp:被停止的服务名
# $AdminControl invoke $appManager stopApplication webTest
# STEP 2 卸载应用
# myapp:被卸载的服务名
# $AdminApp uninstall webTest
# 卸载后需要保存配置
# $AdminConfig save
# STEP 3 安装应用
# 安装应用分为2种,使用程序内部数据源的,和使用WAS数据源的
# 使用WAS数据源,使用-MapResRefToEJB来指定JNDI
# myjndi为使用JNDI名称,myJ2C为数据源中使用的认证数据
# $AdminApp install /tmp/webTest.war {-appname webTest -target WebSphere:cell=hfcell,node=hfnode