文章目录
Weblogic WLST使用(命令行、调用jython脚本)
参考文档Fusion Middleware WebLogic Scripting Tool Command Reference
1. 调用脚本wlst.sh 执行相关操作
#<MIDDLEWARE_HOME>需替换成实际路径
cd <MIDDLEWARE_HOME>/oracle_common/common/bin
sh wlst.sh
-
connect 连接管理控制台
wls:/offline> connect('weblogic','welcome1','t3://localhost:8001') Connecting to weblogic server instance running at t3://localhost:8001 as username weblogic... Successfully connected to Admin Server 'AdminServer' that belongs to domain 'mydomain'. Warning: An insecure protocol was used to connect to the server. To ensure on-the-wire security, the SSL port or Admin port should be used instead. wls:/mydomain/serverConfig>
-
shutdown、start 重启服务器、集群、主节点
wls:/mydomain/serverConfig> start('myserver', 'Server', 't3://10.7.54.88:7001) Starting server myserver ... Server with name myserver started successfully. wls:/mydomain/serverConfig>
wls:/mydomain/serverConfig> shutdown('myserver','Server','true',0, 'ture','true')
-
deploy 部署项目 redeploy、undeploy
wls:/mydomain/serverConfig/Servers> progress= deploy(appName='businessApp', path='c:/myapps/business',createplan='true')
查看部署结果
wls:/mydomain/serverConfig/Servers> progress.printStatus() Current Status of your Deployment: Deployment command type: deploy Deployment State : completed Deployment Message : null wls:/mydomain/serverConfig/Servers>
-
disconnect* 断开连接
wls:/mydomain/serverConfig> disconnect() Disconnected from weblogic server: myserver wls:/offline>
命令参考:
This command… Enables you to… Use with WLST… deploy Deploy an application to a WebLogic Server instance. Online distributeApplication Copy the deployment bundle to the specified targets. Online getWLDM Return the WebLogic DeploymentManager
object.Online listApplications List all applications that are currently deployed in the WebLogic domain. Online loadApplication Load an application and deployment plan into memory. Online and Offline redeploy Redeploy a previously deployed application. Online