实战部署weblogic集群及发布应用(5)
-----构建weblogic高可用系列(共7篇)
经过前面的操作,我们已经将把weblogic安装、手工建域都操作完毕了!此篇文章让我们了解一下管理节点吧!
Administration Server :
管理服务器是控制整个域配置的中心操作节点,管理服务器维护着整个域 Domain 的配置并将配置分配到每个被管理服务器 Managed Server 中,每个域中都必须有一个Administration Server。我们可以通过三个渠道访问管理服务器:Admin Server console、Oracle WebLogic Scripting Tool WLST、JMX客户端(通过WebLogic提供的API来实现),最后我们还可以通过SNMP协议来监控Admin Server的状态。
手工操作管理节点如下:
认证管理
cd/app/sinova/domains/base_domain/servers/AdminServer #进入目录 mkdir security #创建目录 cd security/ vi boot.properties #编程配置文件,并追加如下内容 username=weblogic #用户名 password=weblogic010 #密码
创建目录 //启动脚本会使用到
mkdir -p /app/sinova/bin mkdir -p /app/sinova/logs/www
编写管理服务器启动脚本 //管理节点给1G内存
(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 #执行启动脚本
登录控平台 //查看管理节点
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
解决办法
以上错误提示,内存不够,使用我上面编写的启动脚本就不会报错了!