Domain简单定义为:是一个逻辑管理单元,Domain下面包含着weblogic应用服务器中的所有东西,weblogic应用服务器的启动,停止都是以domain为单位进行管理的。

概述:
本次操作是通过拷贝已有域的方式创建一个新的域名,weblogic的版本为10.3.6,Linux操作系统。

1、通过已有域拷贝出一个新的域:
本例子中,已经存在了一个域base_domain,通过拷贝这个域,也就是直接拷贝base_domain文件夹为test_domain的方式:
[wengjixi@host1 domains]$ pwd
/home/wengjixi/app/oracle/Middleware/user_projects/domains
[wengjixi@host1 domains]$ ll base_domain/ -d
drwxr-x---. 12 wengjixi wengjixi 4096 Jun 26 23:01 base_domain/
[wengjixi@host1 domains]$ cp -r base_domain/ test_domain

2、修改监听端口:
2.1、修改config.xml配置文件:
$ pwd
/home/wengjixi/app/oracle/Middleware/user_projects/domains
$ vim test_domain/config/config.xml
<server>
<name>AdminServer</name>
<listen-port>7110</listen-port>
<listen-address></listen-address>
</server>

2.2、修改脚本配置文件:
test_domain/bin/startManagedWebLogic.sh
test_domain/bin/startManagedWebLogic.sh
test_domain/bin/stopManagedWebLogic.sh
test_domain/bin/stopWebLogic.sh
方法很简单,通过grep 原来的端口 脚本配置文件,然后打开相应的脚本配置文件,修改对应的端口就行。
效果:
3、修改配置文件的域名字:
因为配置文件里保存的是base_domain这个域名字,所以需要修改为test_domain。
涉及的配置文件:
test_domain/config/config.xml
test_domain/bin/setDomainEnv.sh
test_domain/bin/startManagedWebLogic.sh
test_domain/bin/startWebLogic.sh
test_domain/bin/stopManagedWebLogic.s
test_domain/bin/stopWebLogic.sh
修改后的效果:
4、删除配置文件缓存文件夹
$ pwd
/home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/config
$ rm -rf configCache/ config.lok

5、修改用户密码信息
如果不修改的话,启动不了域服务,报如下错误:
<Jun 28, 2018 10:03:58 PM CST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: weblogic.security.SecurityInitializationException: Authentication denied: Boot identity not valid; The user name and/or password from the boot identity file (boot.properties) is not valid. The boot identity may have been changed since the boot identity file was created. Please edit and update the boot identity file with the proper values of username and password. The first time the updated boot identity file is used to start the server, these new values are encrypted.
weblogic.security.SecurityInitializationException: Authentication denied: Boot identity not valid; The user name and/or password from the boot identity file (boot.properties) is not valid. The boot identity may have been changed since the boot identity file was created. Please edit and update the boot identity file with the proper values of username and password. The first time the updated boot identity file is used to start the server, these new values are encrypted.
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:960)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1054)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:873)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
Truncated. see log file for complete stacktrace
Caused By: javax.security.auth.login.FailedLoginException: [Security:090303]Authentication Failed: User weblogic weblogic.security.providers.authentication.LDAPAtnDelegateException: [Security:090295]caught unexpected exception
at weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl.login(LDAPAtnLoginModuleImpl.java:251)
at com.bea.common.security.internal.service.LoginModuleWrapper$1.run(LoginModuleWrapper.java:110)
at java.security.AccessController.doPrivileged(Native Method)
at com.bea.common.security.internal.service.LoginModuleWrapper.login(LoginModuleWrapper.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Truncated. see log file for complete stacktrace


修改方法:
  • 修改boot.properties配置文件,把原来的用户名和密码写上去,这里是明文,但是weblogic启动加载该文件后,会自动通过加密处理。
$ pwd
/home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/servers/AdminServer/security
$ cat boot.properties
#Thu Jun 28 22:15:44 CST 2018
password=weblogic
username=weblogic

  • 5.2 删除data文件夹或改名字:
$ pwd
/home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/servers/AdminServer
$ mv data data-bak/


6、启动域服务:
$ cd /home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/bin
$ ./startWebLogic.sh
.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m
.
WLS Start Mode=Development
.
CLASSPATH=/home/wengjixi/app/oracle/Middleware/patch_wls1036/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/wengjixi/app/oracle/Middleware/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/wengjixi/app/oracle/Middleware/jdk160_29/lib/tools.jar:/home/wengjixi/app/oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/home/wengjixi/app/oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/home/wengjixi/app/oracle/Middleware/modules/features/weblogic.server.modules_10.3.6.0.jar:/home/wengjixi/app/oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/home/wengjixi/app/oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/home/wengjixi/app/oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/home/wengjixi/app/oracle/Middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/home/wengjixi/app/oracle/Middleware/wlserver_10.3/server/lib/xqrl.jar
.
PATH=/home/wengjixi/app/oracle/Middleware/wlserver_10.3/server/bin:/home/wengjixi/app/oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/home/wengjixi/app/oracle/Middleware/jdk160_29/jre/bin:/home/wengjixi/app/oracle/Middleware/jdk160_29/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/wengjixi/.local/bin:/home/wengjixi/bin:/home/wengjixi/app/maven/bin
.
***************************************************
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http://hostname:port/console *
***************************************************
starting weblogic with Java version:
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode)
Starting WLS with line:
/home/wengjixi/app/oracle/Middleware/jdk160_29/bin/java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m -Dweblogic.Name=AdminServer -Djava.security.policy=/home/wengjixi/app/oracle/Middleware/wlserver_10.3/server/lib/weblogic.policy -Xverify:none -da -Dplatform.home=/home/wengjixi/app/oracle/Middleware/wlserver_10.3 -Dwls.home=/home/wengjixi/app/oracle/Middleware/wlserver_10.3/server -Dweblogic.home=/home/wengjixi/app/oracle/Middleware/wlserver_10.3/server -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/home/wengjixi/app/oracle/Middleware/patch_wls1036/profiles/default/sysext_manifest_classpath:/home/wengjixi/app/oracle/Middleware/patch_ocp371/profiles/default/sysext_manifest_classpath weblogic.Server
<Jun 28, 2018 10:23:01 PM CST> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true>
<Jun 28, 2018 10:23:01 PM CST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
<Jun 28, 2018 10:23:01 PM CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 20.4-b02 from Sun Microsystems Inc.>
<Jun 28, 2018 10:23:01 PM CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.6.0 Tue Nov 15 08:52:36 PST 2011 1441050 >
<Jun 28, 2018 10:23:02 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<Jun 28, 2018 10:23:02 PM CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
<Jun 28, 2018 10:23:02 PM CST> <Notice> <LoggingService> <BEA-320400> <The log file /home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/servers/AdminServer/logs/AdminServer.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.>
<Jun 28, 2018 10:23:02 PM CST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/servers/AdminServer/logs/AdminServer.log00006. Log messages will continue to be logged in /home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/servers/AdminServer/logs/AdminServer.log.>
<Jun 28, 2018 10:23:02 PM CST> <Notice> <Log Management> <BEA-170019> <The server log file /home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/servers/AdminServer/logs/AdminServer.log is opened. All server side log events will be written to this file.>
<Jun 28, 2018 10:23:03 PM CST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <LoggingService> <BEA-320400> <The log file /home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/servers/AdminServer/logs/test_domain.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <LoggingService> <BEA-320401> <The log file has been rotated to /home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/servers/AdminServer/logs/test_domain.log00002. Log messages will continue to be logged in /home/wengjixi/app/oracle/Middleware/user_projects/domains/test_domain/servers/AdminServer/logs/test_domain.log.>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
<Jun 28, 2018 10:23:04 PM CST> <Warning> <Server> <BEA-002611> <Hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 127.0.0.1>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.1.105:7110 for protocols iiop, t3, ldap, snmp, http.>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 192.168.122.1:7110 for protocols iiop, t3, ldap, snmp, http.>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7110 for protocols iiop, t3, ldap, snmp, http.>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "test_domain" running in Development Mode>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<Jun 28, 2018 10:23:04 PM CST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

从红色字体中可以看出,weblogic域已经启动成功,可以通过管理控制台访问了:


参考:









Logo

更多推荐