本文主体借鉴了别人的,也加入了一些自己的经验吧,更全面一点,安装版本为12.2.1

参考地址 https://blog.csdn.net/liu__________/article/details/53581962

1、创建一个非root权限的用户,root用户是无法安装oracle产品的

The current user is root or has superuser privilege.
The Oracle Universal Installer cannot continue installation.

2、若没有swap分区,创建swap分区:

以下的操作都要在root用户下进行,首先先建立一个分区,采用dd命令比如

1)创建一个2个G的SWAP交换区空白文件

 

dd if=/dev/zero of=/home/swap bs=1M count=2048000

这样就会创建/home/swap这么一个分区文件。文件的大小是2048000个block,一般情况下1个block为1K,所以这里空间是2048M。接着再把这个分区变成swap分区。

2)使用mkswap格式化文件为swap文件系统

 mkswap -f /home/swap   

#-f 使用文件作为swap交换区

3)启用刚才创建的Swap文件

swapon /home/swap

4)如果有必要可以设置开机自动启用swap文件交换区,修改/etc/fstab,增加一行

/home/swap swap swap defaults 0 0 

#启动即启用swap

5)如果不需要启用swap或需要调整swap大小,可以使用swapoff命令关闭swap

swapoff /home/swap

ps: 如果要修改swap分区大小,重复操作即可。

3、检查jdk,没有就安装一个。

4、准备weblogic安装包  weblogic.jar

5、准备weblogic安装文件夹

1)/usr/work/install      用于装weblogic.jar安装文件,和wls.rsp,oraInst.loc文件  

2)/usr/work/oracleProducts      oracle产品清单的文件夹,orcale产品会安装到这个文件夹下

6、准备oraInst.loc文件

#Oracle Installer Location File Location
#组名称
inst_group=weblogicGroup
#产品清单目录
inventory_loc=/usr/work/oracleProducts

7、准备wls.rsp文件

[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/usr/work/oracleProducts
#Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples.
INSTALL_TYPE=WebLogic Server
#Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name.
MYORACLESUPPORT_USERNAME=
#Provide the My Oracle Support Password
MYORACLESUPPORT_PASSWORD=<SECURE VALUE>
#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration
DECLINE_SECURITY_UPDATES=true
#Set this to true if My Oracle Support Password is specified
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
#Provide the Proxy Host
PROXY_HOST=
#Provide the Proxy Port
PROXY_PORT=
#Provide the Proxy Username
PROXY_USER=
#Provide the Proxy Password
PROXY_PWD=<SECURE VALUE>
#Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http/Https]]://[repeater host]:[repeater port]
COLLECTOR_SUPPORTHUB_URL=

ps : oraInst.loc文件中inventory_loc的文件路径要包含wls.rsp中的ORACLE_HOME的路径,而且要先创建好,同时用于安装的用户weblogic需要对该路径拥有读写权限

8、执行安装

java -jar /usr/work/install/weblogic.jar -silent -invPtrLoc /usr/work/install/oraInst.loc -responseFile /usr/work/install/wls.rsp
[root@hf ~]# su weblogic
bash-4.2$ java -jar /usr/work/install/weblogic.jar -silent -invPtrLoc /usr/work/install/oraInst.loc -responseFile /usr/work/install/wls.rsp
Launcher log file is /tmp/OraInstall2018-04-15_08-50-36AM/launcher2018-04-15_08-50-36AM.log.
Extracting the installer . . . . . . . . . . . . . . . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2499.994 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 999 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 15325 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2018-04-15_08-50-36AM
Log: /tmp/OraInstall2018-04-15_08-50-36AM/install2018-04-15_08-50-36AM.log
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-7.4.1708
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.


Starting check : CheckJDKVersion
Problem: This JDK version was not certified at the time it was made generally available. It may have been certified following general availability.

Recommendation: Check the Supported System Configurations Guide (http://www.oracle.com/technetwork/middleware/ias/downloads/fusion-certification-100350.html) for further details. Press "Next" if you wish to continue.

Expected result: 1.8.0_131
Actual result: 1.8.0_101
Warning: Check:CheckJDKVersion completed with warnings.


Validations are enabled for this session.
Verifying data
Copying Files
Percent Complete : 10
Percent Complete : 20
Percent Complete : 30
Percent Complete : 40
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 Server and Coherence 12.2.1.3.0 completed successfully.
Logs successfully copied to /usr/work/oracleProducts/logs.

 

9、配置环境变量

 

vi /etc/profile

export MW_HOME=/usr/work/oracleProducts/weblogic

然后 加载配置 source /etc/profile

 

10.创建域,控制台启动慢问题

现象: 
1. 创建域的时候writeDomain需要很长时间(20分钟左右) 
2. 启动weblogic第一次进入控制台需要很长时间(10分钟左右) 
3. 启动weblogic server需要很长时间(5-10分钟)

修改: 
在创建域之前,先修改Linux下的Java生成随机数

cd $JAVA_HOME/jre/lib/security
vi java.security

securerandom.source=file:/dev/random
修改为
securerandom.source=file:/dev/./urandom

11.创建Domain/域

mkdir /usr/work/oracleProducts/domains    -- 创建域存放目录,注意读写权限
cd $MW_HOME/wlserver/common/bin
./commEnv.sh
./wlst.sh 

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> 


wls:/offline> readTemplate('/usr/work/oracleProducts/weblogic/wlserver/common/templates/wls/wls.jar')
wls:/offline/base_domain>cd('Servers/AdminServer')
wls:/offline/base_domain/Server/AdminServer>set('ListenAddress','')
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('weblogic12c')
wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('OverwriteDomain', 'true')
wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/usr/work/oracleProducts/domains/domain')   
wls:/offline/domain/Security/domain/User/weblogic>closeTemplate()
wls:/offline>exit()

12.启动weblogic

cd /usr/work/oracleProducts/domains/bin    -- 进入创建的域目录bin下
./startWebLogic.sh    -- 后台启动使用nohup ./startWebLogic.sh &
./stopWeblogic.sh    -- 关闭weblogic

 

 

 

 

 

Logo

更多推荐