Administration, troubleshooting, and performance tuning in Weblogic

Server Lifecycle Management:


# Start Admin Server
$DOMAIN_HOME/startWebLogic.sh  # Unix
%DOMAIN_HOME%\startWebLogic.cmd  # Windows

# Start Managed Server
$DOMAIN_HOME/bin/startManagedWebLogic.sh <server_name> <admin_url>

# Graceful stop
$DOMAIN_HOME/bin/stopWebLogic.sh  # Admin
$DOMAIN_HOME/bin/stopManagedWebLogic.sh <server_name> t3://admin_host:port

Force Kill (if hung):


kill -9 $(pgrep -f "weblogic.Name=<server_name>")  # Unix
taskkill /F /PID <pid>  # Windows

Deployment Commands:


WLST (WebLogic Scripting Tool):


# Deploy app
deploy('my_app', '/path/to/app.ear', targets='AdminServer')

# List deployments
ls('/AppDeployments')

# Undeploy
undeploy('my_app', targets='AdminServer')

Command-Line (weblogic.Deployer):


java weblogic.Deployer -adminurl t3://localhost:7001 -deploy /path/app.war


Log Inspection:


Tail Logs in Real-Time


tail -f $DOMAIN_HOME/servers/AdminServer/logs/AdminServer.log

Search for Errors:


grep -i "ERROR" $DOMAIN_HOME/servers/*/logs/*.log

Thread Dump Generation:


kill -3 <weblogic_pid>  # Unix (creates dump in stdout/logs)

jstack <pid> > thread_dump.txt  # Alternative


JDBC & DataSource Diagnostics

Test Connection Pool

java weblogic.Admin -url t3://localhost:7001 -username weblogic -password <pwd> \TESTPOOL myDataSource

Reset Connection Pool (WLST)


connect('weblogic','password','t3://localhost:7001')
cd('/JDBCSystemResources/myDS/JDBCResource/myDS/JDBCDriverParams/myDS')
cmo.reset()

Comments

Popular posts from this blog

Interview question for File and FTP Adapter

What is boot.properties file and how to create

SSL Exceptions in Admin Server and Node Manager.