七、linux基礎-jdk1.8和weblogic12.2.1.3.0安裝


1、環境探查與准備
  安裝jdk和weblogic前需要對進行安裝的linux系統硬件和軟件環境進行探查確認,以確保支持對jdk1.8.0_144_1和weblogic12.2.1.3和的安裝。weblogic12.2.1.3對於jdk及linux操作系統版本的要求在oracle官網上面有詳細的詳細全面介紹,可自己進行下載xls查閱。http://www.oracle.com/technetwork/middleware/ias/downloads/fusion-certification-100350.html
1.1 weblogic12.2.1.3升級前說明
a、root用戶無法安裝weblogic否則會報錯如下:
    [root@ODSDEVDB01 fmw_12.2.1.3.0_wls_jar]# java -jar fmw_12.2.1.3.0_wls.jar
    Launcher log file is /tmp/OraInstall2018-05-22_02-54-09PM/launcher2018-05-22_02-54-09PM.log.
    Extracting the installer . . . . . . . . . . Done
    The current user is root or has superuser privilege.
    The Oracle Universal Installer cannot continue.
    The log is located here: /tmp/OraInstall2018-05-22_02-54-09PM/launcher2018-05-22_02-54-09PM.log.
 為什么root用戶無法安裝weblogic?
  出於安全考慮,即使別人攻入了你的系統獲得了Weblogic的控制權,對於操作系統來說也只是一個普通的受限用戶。通過在用戶層面的分隔,即使有一個被破壞了也要盡量少影響其它的東西。
b、安裝最新的weblogic版本,版本號為 12.2.1.3,開始以為和舊版安裝一樣,使用控制台的方式,下載bin文件,然后一步步在console執行下來就行了但是,從12C版本后,bin文件不提供了,改成用全系統通用的jar文件 (generic.jar)進行安裝。參看博文  http://blog.51cto.com/chbinmile/1880433

2、配置jdk1.8.0_144_1
參看博文:https://www.cnblogs.com/kuoAT/p/7555298.html
2.1 解壓jdk1.8.0_144_1.tar到指定的文件目錄
# tar -xvf jdk1.8.0_144_1.tar -C /usr/java
2.2 備份系統配置文件
執行命令: cp /etc/profile  /usr/wls_12.2.1.3.0/bakProfile
2.3 編輯系統環境變量
    [root@ODSDEVDB01 ~]#vi /etc/profile     
    i
    #java
    JAVA_HOME=/usr/java/jdk1.8.0_144_1
    PATH=$JAVA_HOME/bin:$PATH
    CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar
    export PATH JAVA_HOME CLASSPATH
    按Esc+:+wq 保存退出;
    備注:編輯后可重新查看一下確保內容已經新增成功
2.4 重新加載系統配置文件
    source /etc/profile
2.5 檢查jdk 是否安裝成功
[root@ODSDEVDB01 ~]# java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
出現上面的顯示信息表示安裝成功

3、安裝weblogic
3.1 創建createWeblogic用戶和組web
    [root@ODSDEVDB01 /]# groupadd web
    [root@ODSDEVDB01 /]# useradd -g web createWeblogic
    [root@ODSDEVDB01 /]# passwd createWeblogic
                             weblogic12c
3.2 切換用戶進行安裝:
    su  createWeblogic
3.3 創建響應文件 wls.rsp  
    最好放在/home/createWeblogic的目錄下面而不是usr目錄下面,否則會導致創建域的權限問題在/home/createWeblogic目錄下確保有如下兩個文件並做相應的配置,否則安裝時候回報各種難以預知的錯誤。

[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   insure having all dir read and write authority

ORACLE_HOME=/usr/wls_12.2.1.3.0/wlsInstall

#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=
View Code

    備注:wls.rsp文件中需要修改的信息如下:ORACLE_HOME=/usr/wls_12.2.1.3.0/wlsInstall       (表示weblogic的安裝目錄) 響應文件中信息的編寫,否則會報奇怪的錯誤
3.4 創建Loc文件 oraInst.loc

inventory_loc=/home/createWeblogic/oraInventory

inst_group=web
View Code

     備注:oraInts.loc文件中修改如下信息:
     inventory_loc=/home/createWeblogic/oraInventory  (表示產品清單目錄)
  inst_group=web (web表示createWeblogic用戶所在的組名,查看用戶所屬組的命令: groups)
3.5 保證所需要得目錄weblogic用戶要用讀寫權限
    oraInst.loc,wls.rsp,fmw_12.2.1.3.0_wls.jar文件用戶createWeblogic必須要有讀寫權限
3.6 安裝weblogic
    cd /usr/wls_12.2.1.3.0/fmw_12.2.1.3.0_wls_jar/
    java -jar fmw_12.2.1.3.0_wls.jar  -silent  -responseFile  /home/createWeblogic/wls.rsp  -invPtrLoc /home/createWeblogic/oraInst.loc  
至此weblogic的安裝即完成
4、創建域app_domain
4.1 首先執行setWLSEnv.sh  來配置環境變量
    $ ./usr/wls_12.2.1.3.0/wlsInstall/wlserver/server/bin/setWLSEnv.sh    
    [createWeblogic@ODSDEVDB01 root]$ cd /usr/wls_12.2.1.3.0/wlsInstall
    [createWeblogic@ODSDEVDB01 user_projects]# mkdir domains
    [createWeblogic@ODSDEVDB01 user_projects]# cd domains
    [createWeblogic@ODSDEVDB01 domains]# mkdir pyfile
    [createWeblogic@ODSDEVDB01 domains]# cd pyfile
4.2 將basicWLSDomain.py復制到base_domain目錄下

#=======================================================================================
# This is an example of a simple WLST offline configuration script. The script creates 
# a simple WebLogic domain using the Basic WebLogic Server Domain template. The script 
# demonstrates how to open a domain template, create and edit configuration objects, 
# and write the domain configuration information to the specified directory.
#
# This sample uses the demo Derby Server that is installed with your product.
# Before starting the Administration Server, you should start the demo Derby server
# by issuing one of the following commands:
#
# Windows: WL_HOME\common\derby\bin\startNetworkServer.cmd
# UNIX: WL_HOME/common/derby/bin/startNetworkServer.sh
#
# (WL_HOME refers to the top-level installation directory for WebLogic Server.)
#
# The sample consists of a single server, representing a typical development environment. 
# This type of configuration is not recommended for production environments.
#
# Please note that some of the values used in this script are subject to change based on 
# your WebLogic installation and the template you are using.
#
# Usage: 
#      java weblogic.WLST <WLST_script> 
#
# Where: 
#      <WLST_script> specifies the full path to the WLST script.
#=======================================================================================

#=======================================================================================
# Open a domain template.
#=======================================================================================

readTemplate("/usr/wls_12.2.1.3.0/wlsInstall/wlserver/common/templates/wls/wls.jar")

#=======================================================================================
# Configure the Administration Server and SSL port.
#
# To enable access by both local and remote processes, you should not set the 
# listen address for the server instance (that is, it should be left blank or not set). 
# In this case, the server instance will determine the address of the machine and 
# listen on it. 
#=======================================================================================

cd('Servers/AdminServer')
set('ListenAddress','')
set('ListenPort', 7001)

create('AdminServer','SSL')
cd('SSL/AdminServer')
set('Enabled', 'false')
set('ListenPort', 7002)

#=======================================================================================
# Define the user password for weblogic.
#=======================================================================================

cd('/')
cd('Security/base_domain/User/weblogic')
# Please set password here before using this script, e.g. cmo.setPassword('value')
cmo.setPassword('weblogic1')
#=======================================================================================


#=======================================================================================
# Write the domain and close the domain template.
#=======================================================================================

setOption('OverwriteDomain', 'true')
writeDomain('/usr/wls_12.2.1.3.0/wlsInstall/user_projects/domains/app_domain')
closeTemplate()

#=======================================================================================
# Exit WLST.
#=======================================================================================

exit()
View Code

 cd  /usr/wls_12.2.1.3.0/wlsInstall/user_projects/domains/pyfile
   cp /usr/wls_12.2.1.3.0/wlsInstall/wlserver/common/templates/scripts/wlst/basicWLSDomain.py .
修改basicWLSDomain.py文件中的如下信息:
1)確定該服務的監聽端口7001
cd('Servers/AdminServer')
set('ListenAddress','')
set('ListenPort', 7001)
2)確定weblogic控制台的登錄密碼
cd('/')
cd('Security/base_domain/User/weblogic')
cmo.setPassword('weblogic123')
3)確定域名 antiMoney_domain域名
setOption('OverwriteDomain', 'true')
writeDomain('/usr/wls_12.2.1.3.0/wlsInstall/user_projects/domains/app_domain')
closeTemplate()
4.3 執行basicWLSDomain.py進行域的創建
[createWeblogic@ODSDEVDB01 pyfile]$ /usr/wls_12.2.1.3.0/wlsInstall/oracle_common/common/bin/wlst.sh basicWLSDomain.py .
出現如下信息表示安裝成功:
    Initializing WebLogic Scripting Tool (WLST) ...
    Welcome to WebLogic Server Administration Scripting Shell
    Type help() for help on available commands

    Exiting WebLogic Scripting Tool.   
4.4 啟動服務
    [createWeblogic@ODSDEVDB01 base_domain]$ cd ..
    [createWeblogic@ODSDEVDB01 app_domain]$ ./startWebLogic.sh
    備注:也可以通過 nohup sh startWebLogic.sh & 命令來啟動服務

上述每步都經本人親測無誤,如遇問題歡迎留言,謝謝!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM