引言
上一篇文章,主要讲解:weblogic的手工创建域。
在本篇文章中,我们接着介绍:weblogic的手工操作管理节点Administration Server。
管理节点Administration Server
管理服务器是控制整个域配置的中心操作节点,管理服务器维护着整个域 Domain 的配置并将配置分配到每个被管理服务器 Managed Server 中,每个域中都必须有一个Administration Server。我们可以通过三个渠道访问管理服务器:Admin Server console、Oracle WebLogic Scripting Tool WLST、JMX客户端(通过WebLogic提供的API来实现),最后我们还可以通过SNMP协议来监控Admin Server的状态。
认证管理
1、创建目录
[root@weblogic ~]# mkdir -p /app/sinova/domains/base_domain/servers/AdminServer/security
2、编辑资源配置文件
[root@weblogic ~]# cd /app/sinova/domains/base_domain/servers/AdminServer/security
[root@weblogic security]# vi boot.properties
增加用户和密码
管理节点的启动脚本
1、创建脚本中使用的目录
[root@weblogic ~]# mkdir -p /app/sinova/bin
[root@weblogic ~]# mkdir -p /app/sinova/logs/www
2、管理服务器启动脚本
此处,管理节点给了1G内存,如果机器配置高的话,可以自行修改
a.脚本统一位置存储
[root@weblogic ~]# cd /app/sinova/bin
b.编辑脚本
[root@weblogic bin]# 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 &
c.给脚本执行权限
[root@weblogic bin]# chmod +x restart-admin.sh
d.执行脚本
[root@weblogic bin]# ./restart-admin.sh
e.查看日志输出
[root@weblogic bin]# cat /app/sinova/logs/www/admin-20221015.log
发现日志中有报错,如下:
starting weblogic with Java version:
Unrecognized option: -jrockit
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Starting WLS with line:
f.解决错误
[root@weblogic bin]# vi /app/sinova/oracle/wlserver_10.3/common/bin/commEnv.sh
修改第152行内容
修改前JAVA_VM=-jrockit
修改后JAVA_VM=-server
g.重新执行脚本
[root@weblogic bin]# ./restart-admin.sh
h.查看日志输出
[root@weblogic bin]# cat /app/sinova/logs/www/admin-20221015.log
从日志输出中,可以看到端口已经被监听了,状态改为:RUNNING
登录图形化控制台
打开网页并访问:http://192.168.8.102:7001/console
用户:weblogic
密码:weblogic010
主界面如下所示
看到上界面这个图形界面,兄弟们管理节点的手工操作就成功了。
扩展之常见错误
启动报错1
错误提示
starting weblogic with Java version:
Unrecognized option: -jrockit
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Starting WLS with line:
/app/sinova/jdk1.7.0_45/bin/java -jrockit -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -Dweblogic.Name=AdminServer -Djava.security.policy=/app/sinova/oracle/wlserver_10.3/server/lib/weblogic.policy -Dweblogic.Productinotallow=true -da -Dplatform.home=/app/sinova/oracle/wlserver_10.3 -Dwls.home=/app/sinova/oracle/wlserver_10.3/server -Dweblogic.home=/app/sinova/oracle/wlserver_10.3/server -Dweblogic.management.discover=true -Dwlw.iterativeDev=false -Dwlw.testCnotallow=false -Dwlw.logErrorsToCnotallow=false -Dweblogic.ext.dirs=/app/sinova/oracle/patch_wls1033/profiles/default/sysext_manifest_classpath:/app/sinova/oracle/patch_ocp353/profiles/default/sysext_manifest_classpath weblogic.Server
Unrecognized option: -jrockit
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
解决办法
vi /app/sinova/oracle/wlserver_10.3/common/bin/commEnv.sh修改第152行内容,修改前JAVA_VM=-jrockit,修改后JAVA_VM=-server
148 # Set up JVM options base on value of JAVA_VENDOR
149 if [ "$PRODUCTION_MODE" = "true" ]; then
150 case $JAVA_VENDOR in
151 oracle)
152 JAVA_VM=-server
153 MEM_ARGS="-Xms128m -Xmx256m"
启动报错2
错误提示
<Jan 29, 2015 11:57:23 AM CST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: java.lang.ExceptionInInitializerError.
weblogic.security.service.SecurityServiceException: java.lang.ExceptionInInitializerError
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:342)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:221)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(CommonSecurityServiceManagerDelegateImpl.java:1783)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:442)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:840)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ExceptionInInitializerError
at com.octetstring.vde.util.guid.GuidGenerator.nextGuidInBytes(GuidGenerator.java:125)
at com.octetstring.vde.util.guid.Guid.<init>(Guid.java:84)
at com.octetstring.vde.backend.standard.BackendStandard.add(BackendStandard.java:379)
at com.octetstring.vde.backend.BackendHandler.add(BackendHandler.java:460)
at com.octetstring.vde.util.LDIF.importLDIF(LDIF.java:279)
Truncated. see log file for complete stacktrace
Caused By: java.lang.NullPointerException
at java.lang.System.arraycopy(Native Method)
at com.octetstring.vde.util.guid.GuidParamGenerator.generateNodeID(GuidParamGenerator.java:47)
at com.octetstring.vde.util.guid.GuidStateManager.initializeGUIDParameters(GuidStateManager.java:59)
at com.octetstring.vde.util.guid.GuidStateManager.<init>(GuidStateManager.java:30)
at com.octetstring.vde.util.guid.GuidStateManager.<clinit>(GuidStateManager.java:23)
Truncated. see log file 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
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:916)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1050)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:875)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
解决办法
修改 /etc/hosts,增加上本机IP及127.0.0.1
然后重新启动:Administration Server
启动报错3
错误提示
<Feb 14, 2015 3:43:56 AM CST> <Error> <JMX> <BEA-149500> <An exception occurred while registering the MBean com.bea:ServerRuntime=AdminServer,Name=AdminServer,Type=SingleSignOnServicesRuntime.
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
Truncated. see log file for complete stacktrace
>
<Feb 14, 2015 3:43:58 AM CST> <Error> <JMX> <BEA-149500> <An exception occurred while registering the MBean com.bea:ServerRuntime=AdminServer,Name=DataRetirementWorkManager,Type=MaxThreadsConstraintRuntime.
java.lang.OutOfMemoryError: PermGen space
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)
at java.lang.Class.getConstructor0(Class.java:2803)
at java.lang.Class.getDeclaredConstructor(Class.java:2053)
at weblogic.management.provider.internal.BeanInfoAccessImpl.buildBeanInfo(BeanInfoAccessImpl.java:400)
Truncated. see log file for complete stacktrace
解决办法
此处报错,就是因为内存不够,使用我上面编写的启动脚本,控制占用的内在资源大小,就不会报错了。
结束语
至此,weblogic洞若观火第5篇之手工操作管理节点就结束了。本篇文章中主要讲解了weblogic的手工操作管理节点,涉及到:认证管理、启动脚本、常见启动报错。
本篇文章内容并不多,因为我知道有太多的新手兄弟了,我们要把weblogic的技术掰开揉碎了说。后续的内容更精彩,敬请期待,感谢兄弟们的关注!!