實戰部署weblogic集羣及發佈應用(5)java
-----構建weblogic高可用系列(共7篇)web
通過前面的操做,咱們已經將把weblogic安裝、手工建域都操做完畢了!此篇文章讓咱們瞭解一下管理節點吧!編程
Administration Server :bash
管理服務器是控制整個域配置的中心操做節點,管理服務器維護着整個域 Domain 的配置並將配置分配到每一個被管理服務器 Managed Server 中,每一個域中都必須有一個Administration Server。咱們能夠經過三個渠道訪問管理服務器:Admin Server console、Oracle WebLogic Scripting Tool WLST、JMX客戶端(經過WebLogic提供的API來實現),最後咱們還能夠經過SNMP協議來監控Admin Server的狀態。服務器
手工操做管理節點以下:
app
認證管理dom
cd/app/sinova/domains/base_domain/servers/AdminServer #進入目錄 mkdir security #建立目錄 cd security/ vi boot.properties #編程配置文件,並追加以下內容 username=weblogic #用戶名 password=weblogic010 #密碼
建立目錄 //啓動腳本會使用到ide
mkdir -p /app/sinova/bin mkdir -p /app/sinova/logs/www
編寫管理服務器啓動腳本 //管理節點給1G內存ui
(1) cd /app/sinova/bin #進入bin目錄 (2) vi restart-admin.sh #編寫啓動腳本,並追加以下內容 #!/bin/bash DATE=`date +%Y%m%d` USER_MEM_ARGS="-Xms1024m -Xmx1024m-XX:MaxPermSize=256m" export USER_MEM_ARGS JAVA_OPTIONS ps -ef | grep java | grep weblogic | grep AdminServer | awk'{print $2}' | xargs kill -9 > /dev/null 2>&1 nohup /app/sinova/domains/base_domain/bin/startWebLogic.sh> /app/sinova/logs/www/admin-${DATE}.log 2>&1 & (3) chmod+x restart-admin.sh #給腳本受權可執行權限 (4) ./restart-admin.sh #執行啓動腳本
登陸控平臺 //查看管理節點spa
http://192.168.101.166:7001/console 輸入用戶: weblogic 輸入密碼: weblogic010
附上:啓動管理節點時,常見出錯的3種狀況
啓動報錯1
Exception in thread "Timer-1" Exception: java.lang.OutOfMemoryError thrown from theUncaughtExceptionHandler in thread "Timer-1" Exception in thread "[STANDBY] ExecuteThread: '3' forqueue: 'weblogic.kernel.Default (self-tuning)'" Exception: java.lang.OutOfMemoryError thrown from theUncaughtExceptionHandler in thread "[STANDBY] ExecuteThread: '3' forqueue: 'weblogic.kernel.Default (self-tuning)'" Exception in thread "DynamicListenThread[Default]" Exception: java.lang.OutOfMemoryError thrown from theUncaughtExceptionHandler in thread "DynamicListenThread[Default]" ./startWebLogic.sh: line 175: 58635 Killed ${JAVA_HOME}/bin/java${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME}-Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS}${PROXY_SETTINGS} ${SERVER_CLASS}
解決辦法
vi/app/sinova/Oracle/wlserver_10.3/common/bin/commEnv.sh #修改第152行 舊 JAVA_VM=-jrockit 新 JAVA_VM=-server
啓動報錯2
<Jan 29, 2015 11:57:23 AM CST> <Error><Security> <BEA-090870> <The realm "myrealm" failed tobe loaded: weblogic.security.service.SecurityServiceException:java.lang.ExceptionInInitializerError. weblogic.security.service.SecurityServiceException:java.lang.ExceptionInInitializerError atweblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:342) atweblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:221) atweblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(CommonSecurityServiceManagerDelegateImpl.java:1783) atweblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:442) atweblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:840) Truncated. see logfile for complete stacktrace Caused By: java.lang.ExceptionInInitializerError atcom.octetstring.vde.util.guid.GuidGenerator.nextGuidInBytes(GuidGenerator.java:125) atcom.octetstring.vde.util.guid.Guid.<init>(Guid.java:84) atcom.octetstring.vde.backend.standard.BackendStandard.add(BackendStandard.java:379) atcom.octetstring.vde.backend.BackendHandler.add(BackendHandler.java:460) atcom.octetstring.vde.util.LDIF.importLDIF(LDIF.java:279) Truncated. see logfile for complete stacktrace Caused By: java.lang.NullPointerException atjava.lang.System.arraycopy(Native Method) atcom.octetstring.vde.util.guid.GuidParamGenerator.generateNodeID(GuidParamGenerator.java:47) atcom.octetstring.vde.util.guid.GuidStateManager.initializeGUIDParameters(GuidStateManager.java:59) at com.octetstring.vde.util.guid.GuidStateManager.<init>(GuidStateManager.java:30) atcom.octetstring.vde.util.guid.GuidStateManager.<clinit>(GuidStateManager.java:23) Truncated. see logfile for complete stacktrace > <Jan 29, 2015 11:57:23 AM CST> <Notice> <Security><BEA-090082> <Security initializing using security realm myrealm.> <Jan 29, 2015 11:57:23 AM CST> <Critical><WebLogicServer> <BEA-000362> <Server failed. Reason: There are 1 nested errors: weblogic.security.service.SecurityServiceRuntimeException:[Security:090399]Security Services Unavailable atweblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:916) atweblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1050) atweblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:875) atweblogic.security.SecurityService.start(SecurityService.java:141) at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64) atweblogic.work.ExecuteThread.execute(ExecuteThread.java:201) atweblogic.work.ExecuteThread.run(ExecuteThread.java:173)
解決辦法
vi /etc/hosts #增長以下內容 本機IP 主機名 127.0.0.1 主機名
啓動報錯3
<Feb 14, 2015 3:43:56 AM CST> <Error> <JMX><BEA-149500> <An exception occurred while registering the MBeancom.bea:ServerRuntime=AdminServer,Name=AdminServer,Type=SingleSignOnServicesRuntime. java.lang.OutOfMemoryError: PermGen space atjava.lang.ClassLoader.defineClass1(Native Method) atjava.lang.ClassLoader.defineClass(ClassLoader.java:800) atjava.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) atjava.net.URLClassLoader.defineClass(URLClassLoader.java:449) atjava.net.URLClassLoader.access$100(URLClassLoader.java:71) Truncated. seelog file for complete stacktrace > <Feb 14, 2015 3:43:58 AM CST> <Error> <JMX><BEA-149500> <An exception occurred while registering the MBeancom.bea:ServerRuntime=AdminServer,Name=DataRetirementWorkManager,Type=MaxThreadsConstraintRuntime. java.lang.OutOfMemoryError: PermGen space atjava.lang.Class.getDeclaredConstructors0(Native Method) atjava.lang.Class.privateGetDeclaredConstructors(Class.java:2493) atjava.lang.Class.getConstructor0(Class.java:2803) atjava.lang.Class.getDeclaredConstructor(Class.java:2053) atweblogic.management.provider.internal.BeanInfoAccessImpl.buildBeanInfo(BeanInfoAccessImpl.java:400) Truncated. seelog file for complete stacktrace
解決辦法
以上錯誤提示,內存不夠,使用我上面編寫的啓動腳本就不會報錯了!