CentOS7静默安装WebLogic 12c

环境:
系统版本:CentOS7 静默安装
JDK版本:1.8.0_131
Weblogic版本:12.2.1.3

一、前期准备
1、创建用户和组
[root@test06 tools]# groupadd web
[root@test06 tools]# useradd -g web weblogic
[root@test06 tools]# passwd weblogic
Changing password for user weblogic.
New password: 123456
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 123456
passwd: all authentication tokens updated successfully.
[root@test06 tools]#

2、JDK安装
在oralce官网下载jdk,自行安装,网上资料很多,这里不再赘述。

[root@test06 tools]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
[root@test06 tools]#

二、开始安装
1、创建ORACLE_HOME
使用root账户创建目录,并将所有权赋予weblogic
[root@test06 tools]# mkdir -p /weblogic/bea
[root@test06 tools]# chown -R weblogic /weblogic

2、创建weblogic目录,并将安装包复制到目录下
[root@test06 tools]# su weblogic
[weblogic@test06 tools]$ cd /tools/
[weblogic@test06 tools]$ ls
fmw_12.2.1.3.0_wls_quick.jar myweb-dep.yaml
jdk-8u131-linux-x64.rpm myweb-svc.yaml
mysql-dep.yaml python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm
mysql-svc.yaml
[weblogic@test06 tools]$

3、创建wls.rsp和oraInst.loc文件
wls.rsp文件内容:
[weblogic@test06 tools]$ cp fmw_12.2.1.3.0_wls_quick.jar /home/weblogic/
[weblogic@test06 tools]$ cd /home/weblogic/
[weblogic@test06 ~]$ ll
total 236756
-rw-r--r--. 1 weblogic web 242434874 Nov 2 14:31 fmw_12.2.1.3.0_wls_quick.jar
[weblogic@test06 ~]$ vi wls.rsp
[ENGINE]
Response File Version=1.0.0.0.0
[GENERIC]
ORACLE_HOME=/home/weblogic
INSTALL_TYPE=WebLogic Server

oraInst.loc文件内容:
[weblogic@test06 ~]$ pwd
/home/weblogic
[weblogic@test06 ~]$ vi oraInst.loc
inventory_loc=/home/weblogic/oraInventory
inst_group=weblogic

[weblogic@test06 ~]$ ll
total 236764
-rw-r--r--. 1 weblogic web 242434874 Nov 2 14:31 fmw_12.2.1.3.0_wls_quick.jar
-rw-r--r--. 1 weblogic web 62 Nov 2 14:35 oraInst.loc
-rw-r--r--. 1 weblogic web 108 Nov 2 14:34 wls.rsp

注意:确保 oraInst.loc wls.rsp fmw_12.2.1.3.0_wls_quick.jar 三个文件weblogic用户必须要有读写权限

4、开始安装
[weblogic@test06 ~]$ java -jar fmw_12.2.1.3.0_wls_quick.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc
Launcher log file is /tmp/OraInstall2020-11-02_02-37-01PM/launcher2020-11-02_02-37-01PM.log.
Extracting the installer . . . . . Done
Checking if CPU speed is above 300 MHz. Actual 2399.998 MHz Passed
Checking swap space: must be greater than 512 MB. Actual 2047 MB Passed
Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required)
Checking temp space: must be greater than 300 MB. Actual 13208 MB Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2020-11-02_02-37-01PM
Log: /tmp/OraInstall2020-11-02_02-37-01PM/install2020-11-02_02-37-01PM.log

*****************************************************

Distribution Name : Oracle Fusion Middleware 12c WebLogic and Coherence Developer
Distribution Version : 12.2.1.3.0

Oracle Inventory : /home/weblogic/oraInventory

Oracle Home : /home/weblogic/wls12213
Java Home : /usr/java/jdk1.8.0_131

Note: Oracle Home not supplied (defaulted to <present working dir>/wls12213)

*****************************************************

Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Skipping Software Updates
Starting check : CertifiedVersions
Expected result: One of oracle-6, oracle-7, redhat-7, redhat-6, SuSE-11, SuSE-12
Actual Result: redhat-null
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.

Starting check : CheckJDKVersion
Expected result: 1.8.0_131
Actual Result: 1.8.0_131
Check complete. The overall result of this check is: Passed
CheckJDKVersion Check: Success.

Validations are enabled for this session.
Verifying data
Copying Files
Percent Complete : 10
Percent Complete : 20
Percent Complete : 30
Percent Complete : 50
Percent Complete : 60
Percent Complete : 70
Percent Complete : 80
Percent Complete : 90
Percent Complete : 100

The installation of Oracle Fusion Middleware 12c WebLogic and Coherence Developer 12.2.1.3.0 completed successfully.
Logs successfully copied to /home/weblogic/wls12213/cfgtoollogs/oui.
[weblogic@test06 ~]$

5、设置环境变量

[weblogic@test06 ~]$ find /home/weblogic/ -name setWLSEnv.sh
/home/weblogic/wls12213/inventory/Templates/wlserver/server/bin/setWLSEnv.sh
/home/weblogic/wls12213/wlserver/server/bin/setWLSEnv.sh

方式(推荐):
[weblogic@test06 ~]$ sh /home/weblogic/wls12213/wlserver/server/bin/setWLSEnv.sh
CLASSPATH=/usr/java/jdk1.8.0_131/lib/tools.jar:/home/weblogic/wls12213/wlserver/modules/features/wlst.wls.classpath.jar:%JAVA_HOME%/lib:%JAVA_HOME%/jre/lib

PATH=/home/weblogic/wls12213/wlserver/server/bin:/home/weblogic/wls12213/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.9.8.0.0/apache-ant-1.9.8/bin:/usr/java/jdk1.8.0_131/jre/bin:/usr/java/jdk1.8.0_131/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.8.0_131/bin:/usr/java/jdk1.8.0_131/jre/bin:/root/bin:/home/weblogic/wls12213/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin

Your environment has been set.
[weblogic@test06 ~]$

6、创建Domain域名
方式1:通过命令行交互创建
[weblogic@test06 ~]$ cd /home/weblogic/wls12213/wlserver/common/bin/
[weblogic@test06 bin]$ ll
total 68
-rwxr-x---. 1 weblogic web 583 Aug 10 2017 config.sh
-rwxr-x---. 1 weblogic web 578 Aug 10 2017 pack.sh
-rwxr-x---. 1 weblogic web 582 Aug 10 2017 unpack.sh
-rwxr-x---. 1 weblogic web 35171 Aug 21 2017 wlscontrol.sh
-rwxr-x---. 1 weblogic web 16286 Aug 21 2017 wlsifconfig.sh
-rwxr-x---. 1 weblogic web 807 Aug 10 2017 wlst.sh
[weblogic@test06 bin]$ ./wlst.sh
WARNING: This is a deprecated script. Please invoke the wlst.sh script under oracle_common/common/bin.

Initializing WebLogic Scripting Tool (WLST) ...

Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> readTemplate('/home/weblogic/wls12213/wlserver/common/templates/wls/wls.jar')
WARNING: The readTemplate is deprecated. Use selectTemplate followed by loadTemplates in place of readTemplate.
wls:/offline/base_domain>cd('Servers/AdminServer')
wls:/offline/base_domain/Server/AdminServer>set('ListenAddress','192.168.0.8')
wls:/offline/base_domain/Server/AdminServer>set('ListenPort',7001)
wls:/offline/base_domain/Server/AdminServer>cd('../..')
wls:/offline/base_domain>cd('Security/base_domain/User/weblogic')
wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setPassword('weblogic123')
wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('OverwriteDomain','true')
wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('ServerStartMode', 'prod')
wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/home/weblogic/wls12213/user_projects/domains/base_domain')
wls:/offline/base_domain/Security/base_domain/User/weblogic>closeTemplate()
wls:/offline>exit()
Exiting WebLogic Scripting Tool.

[weblogic@test06 bin]$

方式2:通过py脚本来创建(自行参考)
创建create_domains.py,添加内容:
readTemplate('/home/weblogic/wls12213/wlserver/common/templates/wls/wls.jar')
cd('Servers/AdminServer')
set('ListenAddress','ip地址')
set('ListenPort', 7001)
cd('../..')
cd('/Security/base_domain/User/weblogic')
cmo.setPassword('weblogic123')
setOption('OverwriteDomain', 'true')
setOption('ServerStartMode', 'prod')
writeDomain('/home/weblogic/wls12213/user_projects/domains/base_domain')
closeTemplate()
exit()

执行安装 ./wlst.sh ./create_domains.py

7、启动weblogic
[weblogic@test06 bin]$ pwd
/home/weblogic/wls12213/wlserver/common/bin
[weblogic@test06 bin]$ cd ../..
[weblogic@test06 wlserver]$ ll
total 28
drwxr-x---. 10 weblogic web 130 Nov 2 14:39 common
drwxr-x---. 6 weblogic web 24576 Nov 2 14:39 modules
drwxr-x---. 3 weblogic web 21 Nov 2 14:38 orasocket
drwxr-x---. 4 weblogic web 37 Nov 2 14:38 plugins
drwxr-x---. 10 weblogic web 185 Nov 2 14:39 server
[weblogic@test06 wlserver]$ cd ..
[weblogic@test06 wls12213]$ ll
total 16
drwxr-x---. 4 weblogic web 35 Nov 2 14:41 cfgtoollogs
drwxr-x---. 5 weblogic web 62 Nov 2 14:38 coherence
-rw-r-----. 1 weblogic web 213 Nov 2 14:59 domain-registry.xml
drwxr-x---. 19 weblogic web 4096 Nov 2 14:41 inventory
drwxr-x---. 11 weblogic web 265 Nov 2 14:39 OPatch
drwxr-x---. 9 weblogic web 103 Nov 2 14:38 oracle_common
-rw-r-----. 1 weblogic web 133 Nov 2 14:40 oraInst.loc
drwxr-x---. 8 weblogic web 129 Nov 2 14:40 oui
-rwx------. 1 weblogic web 10 Nov 2 14:37 root.sh
drwxr-x---. 3 weblogic web 21 Nov 2 14:59 user_projects
drwxr-x---. 7 weblogic web 81 Nov 2 14:38 wlserver
[weblogic@test06 wls12213]$ pwd
/home/weblogic/wls12213
[weblogic@test06 wls12213]$ cd user_projects/domains/base_domain/bin/
[weblogic@test06 bin]$ ll
total 72
-rwxr-x---. 1 weblogic web 2655 Nov 2 14:59 generateArchive.sh
drwxr-x---. 2 weblogic web 27 Nov 2 14:59 nodemanager
drwxr-x---. 2 weblogic web 61 Nov 2 14:59 patching
drwxr-x---. 2 weblogic web 28 Nov 2 14:59 server_migration
drwxr-x---. 2 weblogic web 24 Nov 2 14:59 service_migration
-rwxr-x---. 1 weblogic web 14698 Nov 2 14:59 setDomainEnv.sh
-rwxr-x---. 1 weblogic web 901 Nov 2 14:59 setNMJavaHome.sh
-rwxr-x---. 1 weblogic web 794 Nov 2 14:59 setStartupEnv.sh
-rwxr-x---. 1 weblogic web 2279 Nov 2 14:59 startComponent.sh
-rwxr-x---. 1 weblogic web 2812 Nov 2 14:59 startManagedWebLogic.sh
-rwxr-x---. 1 weblogic web 1125 Nov 2 14:59 startNodeManager.sh
-rwxr-x---. 1 weblogic web 703 Nov 2 14:59 startRSDaemon.sh
-rwxr-x---. 1 weblogic web 7306 Nov 2 14:59 startWebLogic.sh
-rwxr-x---. 1 weblogic web 1943 Nov 2 14:59 stopComponent.sh
-rwxr-x---. 1 weblogic web 2646 Nov 2 14:59 stopManagedWebLogic.sh
-rwxr-x---. 1 weblogic web 1071 Nov 2 14:59 stopNodeManager.sh
-rwxr-x---. 1 weblogic web 847 Nov 2 14:59 stopRSDaemon.sh
-rwxr-x---. 1 weblogic web 2135 Nov 2 14:59 stopWebLogic.sh
[weblogic@test06 bin]$ ./startWebLogic.sh
.
.
JAVA Memory arguments: -Xms256m -Xmx512m
.
CLASSPATH=/usr/java/jdk1.8.0_131/lib/tools.jar:/home/weblogic/wls12213/wlserver/server/lib/weblogic.jar:/home/weblogic/wls12213/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/home/weblogic/wls12213/wlserver/modules/features/oracle.wls.common.nodemanager.jar::/home/weblogic/wls12213/wlserver/common/derby/lib/derbynet.jar:/home/weblogic/wls12213/wlserver/common/derby/lib/derbyclient.jar:/home/weblogic/wls12213/wlserver/common/derby/lib/derby.jar:%JAVA_HOME%/lib:%JAVA_HOME%/jre/lib
.
PATH=/home/weblogic/wls12213/user_projects/domains/base_domain/bin:/home/weblogic/wls12213/wlserver/server/bin:/home/weblogic/wls12213/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.9.8.0.0/apache-ant-1.9.8/bin:/usr/java/jdk1.8.0_131/jre/bin:/usr/java/jdk1.8.0_131/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.8.0_131/bin:/usr/java/jdk1.8.0_131/jre/bin:/root/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 WLS with line:
/usr/java/jdk1.8.0_131/bin/java -server -Xms256m -Xmx512m -cp /home/weblogic/wls12213/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=AdminServer -Djava.security.policy=/home/weblogic/wls12213/wlserver/server/lib/weblogic.policy -Dweblogic.ProductionModeEnabled=true -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/home/weblogic/wls12213/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/home/weblogic/wls12213/wlserver/server -Dweblogic.home=/home/weblogic/wls12213/wlserver/server weblogic.Server
<Nov 2, 2020 3:03:21 PM CST> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<Nov 2, 2020 3:03:21 PM CST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<Nov 2, 2020 3:03:22 PM CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.131-b11 from Oracle Corporation.>
<Nov 2, 2020 3:03:23 PM CST> <Info> <RCM> <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.>
<Nov 2, 2020 3:03:23 PM CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.2.1.3.0 Thu Aug 17 13:39:49 PDT 2017 1882952>
<Nov 2, 2020 3:03:26 PM CST> <Info> <Security> <BEA-090065> <Getting boot identity from user.>
Enter username to boot WebLogic server:weblogic
Enter password to boot WebLogic server:weblogic123
<Nov 2, 2020 3:03:48 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<Nov 2, 2020 3:03:49 PM CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.>
<Nov 2, 2020 3:03:49 PM CST> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.>
<Nov 2, 2020 3:03:50,748 PM CST> <Notice> <Log Management> <BEA-170019> <The server log file weblogic.logging.FileStreamHandler instance=2070647217
Current log file=/home/weblogic/wls12213/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log
Rotation dir=/home/weblogic/wls12213/user_projects/domains/base_domain/servers/AdminServer/logs
is opened. All server side log events will be written to this file.>
<Nov 2, 2020 3:03:51,519 PM CST> <Notice> <Security> <BEA-090946> <Security pre-initializing using security realm: myrealm>
<Nov 2, 2020 3:08:48,173 PM CST> <Notice> <Security> <BEA-090947> <Security post-initializing using security realm: myrealm>
<Nov 2, 2020 3:08:51,006 PM CST> <Notice> <Security> <BEA-090082> <Security initialized using administrative security realm: myrealm>
<Nov 2, 2020 3:08:51,930 PM CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.0.8:7001/jndi/weblogic.management.mbeanservers.runtime.>
<Nov 2, 2020 3:15:34,078 PM CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.0.8:7001/jndi/weblogic.management.mbeanservers.edit.>
<Nov 2, 2020 3:15:34,143 PM CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.0.8:7001/jndi/weblogic.management.mbeanservers.domainruntime.>
<Nov 2, 2020 3:15:36,433 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.>
<Nov 2, 2020 3:15:36,434 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.>
<Nov 2, 2020 3:15:36,572 PM CST> <Notice> <Log Management> <BEA-170036> <The Logging monitoring service timer has started to check for logged message counts every 30 seconds.>
<Nov 2, 2020 3:15:44,363 PM CST> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.>
<Nov 2, 2020 3:15:46,976 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.>
<Nov 2, 2020 3:15:47,117 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.>
<Nov 2, 2020 3:15:47,440 PM CST> <Notice> <WebLogicServer> <BEA-000329> <Started the WebLogic Server Administration Server "AdminServer" for domain "base_domain" running in production mode.>
<Nov 2, 2020 3:15:47,443 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.0.8:7001 for protocols iiop, t3, ldap, snmp, http.>
<Nov 2, 2020 3:15:47,444 PM CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.0.8:7001 for protocols iiop, t3, ldap, snmp, http.>
<Nov 2, 2020 3:15:47,487 PM CST> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.>
<Nov 2, 2020 3:15:47,527 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.>

显示:Server state changed to RUNNING,表示weblogic服务启动成功。
8、验证
http://192.168.0.8:7001/console

账户:weblogic
密码:weblogic123

上一篇:使用正则表达式


下一篇:12c OCP考试专项 [1z0-071]-Q13: 操作符优先级(2020.06.17)