Here we are going to see a Scenario which is very common but troublesome. Many times we observe that while trying to restart the Managed Servers the Servers move to ADMIN State rather than moving to the RUNNING State. This usually happens If it is unable to activate some of the Modules which are deployed on this Server. usually it happens If any Application is Not getting activated properly or a Datasource or JTA recovery or a JMS System / SubSystem is not getting activated properly then also it moves into the Admin State. So To find out the Root cause we need to keenly observer the Logs. Specially we need to check what configuration changes we made on the Server recently.
More Alerts On the same Monitoring: http://middlewaremagic.com/weblogic/?p=5838
Most Probable Cause: Most of the cases it happens if any of the Database is down and WebLogic tries to create the Connection Pool at the boot up time. One way to avoid this kind of scenario is to set the InitialCapacity of the DataSource to 0 (Zero) so that weblogic will not try to create any JDBC Connection object at the start up time so like this we can avoid Connection creation failure conditions and avoid moving our server to ADMIN State.
NOTE: We have an option to forcibily move our WLS Server to the RUNNING State (from ADMIN State) which works almost 80% cases….Still it is must that we find the root cause of Why the Server is moving to ADMIN State. So please consider this article as a Workaround …And not as a solution. Because even if we can bring our server in RUNNING state …still we have to find out why the Server Moved to ADMIN State.
In this Demonstration we will see a simple WLST script which will check if any of the server present inside Domain is in ADMIN State or not? If YES then it will try to force them to move to RUNNING State.
Step1). Create a Directory somewhere in your file system like : “C:\WLST_AdminStateCheck”
Step2). Write a Properties file “domain.properties” inside “C:\WLST_AdminStateCheck” like following:
domain.name=7001_Plain_Domain
admin.url=t3://localhost:7001
admin.userName=weblogic
admin.password=weblogic1
totalServersToMonitor=2
server.1.url=t3://localhost:7001
server.2.url=t3://localhost:7003
Step3). Write the WLST Script “serverAdminState.py” inside “C:\WLST_AdminStateCheck” directory.
#############################################################################
#
# @author Copyright (c) 2010 - 2011 by Middleware Magic, All Rights Reserved.
#
#############################################################################
from java.io import FileInputStream
propInputStream = FileInputStream("domain.properties")
configProps = Properties()
configProps.load(propInputStream)
domainName=configProps.get("domain.name")
adminURL=configProps.get("admin.url")
adminUserName=configProps.get("admin.userName")
adminPassword=configProps.get("admin.password")
totalServerToMonitor=configProps.get("totalServersToMonitor")
i=1
while (i <= int(totalServerToMonitor)) :
url=configProps.get("server."+ str(i)+".url")
connect(adminUserName,adminPassword,url)
serverRuntime()
state=cmo.getState()
name=cmo.getName()
if state == 'ADMIN' :
print "ALERT::::::::Server Name: " + name + " Is currently in State: " + state
try:
print 'Resuming Server: .....'
cmo.resume()
print "Server: "+name +"Moved to State : " + cmo.getState()
except:
print "NOTE:::::::::Unable to Move Server: " + name + " To good State"
else:
print ''
print ''
print "GOOD::::::::> Server Name: " + name + " Is currently in State: " + state + ' <img src="http://middlewaremagic.com/weblogic/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"> '
i = i + 1
Step4). Run the “. ./setWLSEnv.sh” by adding two DOTs separated by a single space …..before the actual script like following : (use ‘cd’ command to move inside the <BEA_HOME>/wlserver_10.3/server/bin) then run the following command….
. ./setWLSEnv.sh
Note: the first DOT represents that set the Environment in the current Shell, AND the second ./ represents execute the script from the current directory.
Step5). Now run the WLS Script like following:
java weblogic.WLST serverAdminState.py
Following would be the output:
java weblogic.WLST serverAdminState.py
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain '7001_Plain_Domain'.
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.
Location changed to serverRuntime tree. This is a read-only tree with ServerRuntimeMBean as the root.
For more help, use help(serverRuntime)
GOOD::::::::> Server Name: AdminServer Is currently in State: RUNNING <img src="http://middlewaremagic.com/weblogic/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley">
Connecting to t3://localhost:7003 with userid weblogic ...
Successfully connected to managed Server 'ManagedServer-1' that belongs to domain '7001_Plain_Domain'.
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.
ALERT::::::::Server Name: ManagedServer-1 Is currently in State: ADMIN
Resuming Server: .....
Server: ManagedServer-1Moved to State : RUNNING
Regards,
Jay SenSharma
转载自:http://middlewaremagic.com/weblogic/?p=6407
http://blog.csdn.net/weiyangcau/article/details/7411638
分享到:
相关推荐
Oracle Weblogic Server 11gR1 PS2: Administration Essentials
Oracle WebLogic Server 10g R3: Troubleshooting Methodologies Duration: 3 Days What you will learn This course teaches the steps to identify the symptoms and causes of the issues, the method of ...
weblogicp培训考试必备资料 基本上是从零开始 高清文字版 很全 排版正常
Oracle WebLogic Server 11g: Administration Essentials 教材。 包含两本学生指导教材和一本实验指导教材。 是Oracle训练课程的正式教材
Oracle WebLogic Server 11g: Diagnostics and Troubleshooting
BEA WebLogic Server 开发WebLogic Server 应用.doc
64-weblogic server 安装 linux,64-weblogic server 安装 linux
第四章 使用 WebLogic Server JSP 第五章 WebLogic Server JDBC 和 JTA 第六章 远程方法调用和分布式命名 第七章 使用 Java 消息服务进行企业消息传递 第八章 使用会话企业 JavaBean 第九章 实体 EJB 第十章 使用...
Oracle WebLogic Server 11g: Administration Essentials Student Guide 2 Edition 2.1
关于weblogic server10的文章
本书是WebLogic开发人员的权威参考手册,书中深入探讨了WebLogic Server所提供的功能,并列举了一些最佳开发实践。本书全面介绍了WebLogic在J2EE应用程序的各个方面所完成的任务:从使用servlet、JSP和EJB,到管理...
Oracle WebLogic Server 11g下载 Oracle WebLogic Server 10.3.1 包括两个文件: oepe11_ccjk_wls1031_linux32.bin oepe11_wls1031.exe
Weblogic Server Tools for eclipse 3.5
Oracle 公司的Oracle WebLogic Server 的培训ppt
weblogic server安装与配置,ppt希望对大家有用
《J2EE应用与BEA WebLogic Server(第2版)》探讨了J2EE的BEA实现。全书共分为18章,每章分别对应于使用J2EE和WebLogic Server开发Web应用程序的各个阶段,并且都围绕特定的Java Enterprise技术来组织,包括模型-视图-...
BEA WebLogic Server 8.1 Unleashed
Oracle正在为使用WebLogic Server的组织寻找方法来运行重要的工作负载,并将这些工作负载转移到云中。 通过对Docker和Kubernetes等行业标准进行认证,WebLogic现在可以在云中性基础架构中运行。 此外,我们提供了一...
WebLogic Server10.3的安装和配置
bea weblogic server 管理指南