安裝最新的weblogic版本,版本號爲 12.1.X(12.1.2,12.1.3)。開始覺得和舊版安裝同樣,使用控制檯的方式,下載bin文件,而後一步步在console執行下來就好了。萬萬沒想到,從12C版本後,bin文件不提供了,改爲全系統通用的jar文件 (generic.jar)。試了半天原來那種安裝方式不能用了,非得用圖形界面安裝。因爲服務器只能遠程登陸,因而各類百度、各類找材料,最後終於找到一種靜默方式的安裝。請看下文。java
weblogic12C各版本所支持的JDK版本:linux
fmw_12.1.3.0.0_wls.jar 須要jdk1.7.0_15以上的版本web
wls_121200.jar 須要jdk1.7版本;1.8版本不可用bash
weblogic在安裝的時候會對系統進行嚴格的檢查,服務器
包括jdk版本,cpu性能,swap空間,磁盤空間,tmp臨時空間[軟件在安裝時會產生大約1G的日誌以及其餘必須的文件]等;oracle
一、建立weblogic用戶和組dom
root用戶jvm groupadd weblogicide useradd -g weblogic -m -d /home/weblogic weblogicpost passwd weblogic NEW PASS :weblogic1@4 |
二、配置JDK1.8
解壓 jdk-8u111-linux-i586.tar.gz,而後移動到/usr/local目錄下 su - weblogic vi .bash_profile export JAVA_HOME=/usr/local/jdk1.8 export JRE_HOME=/usr/local/jdk1.8/jre export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH export ORACLE_HOME=/u02/bea java -version java version "1.8.0_111" Java(TM) SE Runtime Environment (build 1.8.0_111-b14) Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode) |
三、建立響應文件 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=/u02/bea #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= |
四、建立Loc文件 oraInst.loc
inventory_loc=/home/weblogic/oraInventory inst_group=weblogic |
六、保證所須要得目錄weblogic用戶要用讀寫權限
/ghca/bea文件用戶weblogic必需要有讀寫權限
oraInst.loc,wls.rsp,fmw_12.1.3.0.0_wls.jar 文件用戶weblogic必需要有讀寫權限
七、安裝 wls.rsp,oraInst.loc必須指定絕對路徑 java -jar fmw_12.1.3.0.0_wls.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc
$ java -jar fmw_12.1.3.0.0_wls.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc 啓動程序日誌文件爲/tmp/OraInstall2016-12-07_11-28-48AM/launcher2016-12-07_11-28-48AM.log。 正在提取文件........ Java HotSpot(TM) Server VM warning: You have loaded library /tmp/orcl3700411247043593693.tmp/Disk1/install/linux/libjni.so which might have disabled stack guard. The VM will try to fix the stack guard now. It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'. 啓動 Oracle Universal Installer 檢查 CPU 速度是否大於 300 MHz。 實際爲 2128.009 MHz 經過 檢查交換空間: 必須大於 512 MB。 實際爲 8388604 MB 經過 檢查此平臺是否須要 64 位 JVM。 實際爲32 經過 (不須要 64 位) 檢查臨時空間: 必須大於 300 MB。 實際爲 3559 MB 經過 準備從/tmp/OraInstall2016-12-07_11-28-48AM啓動 Oracle Universal Installer Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 ---可忽略 日誌:/tmp/OraInstall2016-12-07_11-28-48AM/install2016-12-07_11-28-48AM.log 版權全部 (c) 1996, 2014, Oracle 和/或其附屬公司。保留全部權利。 正在讀取響應文件... 開始檢查: CertifiedVersions 預期的結果: enterprise-4,enterprise-5,enterprise-6,redhat-6,redhat-4,redhat-5,SuSE-11之一 實際結果: (未知操做系統版本) 檢查完成。這次檢查的整體結果爲: 未經過 <<<< 可忽略 問題: 此 Oracle 軟件未經當前操做系統認證。 建議案: 確保在正確的平臺上安裝軟件。 警告: 檢查:CertifiedVersions 失敗。 開始檢查: CheckJDKVersion 預期的結果: 1.7.0_15 實際結果: 1.8.0_111 檢查完成。這次檢查的整體結果爲: 經過 CheckJDKVersion 檢查: 成功。 已啓用此會話的驗證。 正在驗證數據... 正在複製文件... 能夠在如下位置找到本次安裝會話的日誌: /tmp/OraInstall2016-12-07_11-28-48AM/install2016-12-07_11-28-48AM.log -----------20%----------40%----------60%----------80%--------100% Oracle Fusion Middleware 12c WebLogic Server 和 Coherence 12.1.3.0.0 的 安裝 已成功完成。 日誌已成功複製到/home/weblogic/oraInventory/logs。 -----打印此信息,說明weblogic安裝成功了。 |
八、 建立domain域名
A、經過控制檯安裝 export MW_HOME="/u02/bea" export WL_HOME="/u02/bea/oracle_common" [root@WAAA-NM1 bin]# pwd /ghca/bea/wlserver/common/bin [root@WAAA-NM1 bin]# ./commEnv.sh [root@WAAA-NM1 bin]# ./wlst.sh Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 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('/u02/bea/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('weblogic123') wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('OverwriteDomain', 'true') wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/u02/bea/user_projects/domains/base_domain') closeTemplate() exit() PS:最後一步等待時間稍微較長; |
B、經過參數文件實現靜默安裝 建立文件: create_domain.rsp read template from "/u02/bea/wlserver/common/templates/wls/wls.jar"; set JavaHome "/usr/local/jdk1.8"; set ServerStartMode "dev";
find Server "AdminServer" as AdminServer; set AdminServer.ListenAddress ""; set AdminServer.ListenPort "7001"; set AdminServer.SSL.Enabled "true"; set AdminServer.SSL.ListenPort "7002";
//create a new user create User "weblogic2" as u2; set u2.password "weblogic123";
write domain to "/u02/bea/user_projects/domains/base_domain/";
// The domain name will be "demo-domain"
close template; |
九、啓動
$cd /u02/bea/user_projects/domains/base_domain/bin
$./startWeblogic.sh
參考官網資料:
https://docs.oracle.com/middleware/1213/core/OUIRF/silent.htm#OUIRF337
十、安裝部署中遇到的問題
一、wls.rsp 文件內容有錯誤 [weblogic@model ~]$ java -jar fmw_12.1.3.0.0_wls.jar -silent -responseFile /u02/wls.rsp -invPtrLoc /u02/oraInst.loc Launcher log file is /tmp/OraInstall2016-12-06_10-52-14PM/launcher2016-12-06_10-52-14PM.log. Extracting files........................................ Starting Oracle Universal Installer Checking if CPU speed is above 300 MHz. Actual 2294.749 MHz Passed Checking swap space: must be greater than 512 MB. Actual 511992 MB Passed Checking if this platform requires a 64-bit JVM. Actual 32 Passed (64-bit not required) Checking temp space: must be greater than 300 MB. Actual 3066 MB Passed Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2016-12-06_10-52-14PM Log: /tmp/OraInstall2016-12-06_10-52-14PM/install2016-12-06_10-52-14PM.log Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. Reading response file.. Parse Error at line number:1 NE] Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No "="found! Error: An error occured while reading the response file. Ensure that the response file exists and is in correct format. oracle.as.install.engine.modules.response.exception.ResponseFiError in reading response file. Aborting Install.leFormatException: Parse error at line no:1:NE] at oracle.as.install.engine.modules.response.action.INIFileReader.parseError(INIFileReader.java:299) at oracle.as.install.engine.modules.response.action.INIFileReader.parse(INIFileReader.java:234) at oracle.as.install.engine.modules.response.action.INIFileReader.getModel(INIFileReader.java:121) at oracle.as.install.engine.modules.response.ResponseFileProcessor$ThreadReader.run(ResponseFileProcessor.java:205) Logs are located here: /tmp/OraInstall2016-12-06_10-52-14PM. ============================================== [weblogic@model ~]$ java -jar wls_121200.jar -silent -responseFile /u02/wls.rsp -invPtrLoc /u02/oraInst.loc Extracting files............................................. Starting Oracle Universal Installer Checking if CPU speed is above 300 MHz. Actual 2294.749 MHz Passed Checking swap space: must be greater than 512 MB. Actual 511992 MB Passed Checking if this platform requires a 64-bit JVM. Actual 32 Passed (64-bit not required) Checking temp space: must be greater than 300 MB. Actual 2135 MB Passed Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2016-12-06_10-54-11PM Log: /home/weblogic/oraInventory/logs/install2016-12-06_10-54-11PM.log Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. Reading response file.. Error in reading response file. Aborting Install. The Oracle Universal Installer failed. Exiting. =========================== java -jar fmw_12.1.3.0.0_wls.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc 啓動程序日誌文件爲/tmp/OraInstall2016-12-07_03-13-54PM/launcher2016-12-07_03-13-54PM.log。 正在提取文件........ Java HotSpot(TM) Server VM warning: You have loaded library /tmp/orcl5751875612080729079.tmp/Disk1/install/linux/libjni.so which might have disabled stack guard. The VM will try to fix the stack guard now. It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'. 啓動 Oracle Universal Installer 檢查 CPU 速度是否大於 300 MHz。 實際爲 2128.021 MHz 經過 檢查交換空間: 必須大於 512 MB。 實際爲 8388604 MB 經過 檢查此平臺是否須要 64 位 JVM。 實際爲32 經過 (不須要 64 位) 檢查臨時空間: 必須大於 300 MB。 實際爲 4596 MB 經過 準備從/tmp/OraInstall2016-12-07_03-13-54PM啓動 Oracle Universal Installer Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 產品清單指針文件無效: /home/weblogic/oraInst.loc 日誌位於此處: /tmp/OraInstall2016-12-07_03-13-54PM。 二、不能用root用戶安裝 [root@model weblogic]# java -jar fmw_12.1.3.0.0_wls.jar -silent -responseFile /u02/wls.rsp -invPtrLoc /u02/oraInst.loc Launcher log file is /tmp/OraInstall2016-12-07_04-51-55PM/launcher2016-12-07_04-51-55PM.log. Extracting files.......................................... The current user is root or has superuser privilege. The Oracle Universal Installer cannot continue installation. 三、linux系統32位,64位JDK也必須使用同樣的版本 java -version -bash: /usr/local/jdk1.8/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 四、weblogic啓動的時候報網卡錯誤 ./startWeblogic ....... <Dec 7, 2016 10:28:33 PM CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.1.3.0.0 Wed May 21 18:53:34 PDT 2014 1604337 > <Dec 7, 2016 10:28:38 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> <Dec 7, 2016 10:28:39 PM CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.> <Dec 7, 2016 10:28:39 PM CST> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.> <Dec 7, 2016 10:28:39 PM CST> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: A MultiException has 2 exceptions. They are: 1. java.lang.AssertionError: Could not obtain the localhost address. The most likely cause is an error in the network configuration of this machine. 2. java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.rjvm.RJVMService A MultiException has 2 exceptions. They are: 1. java.lang.AssertionError: Could not obtain the localhost address. The most likely cause is an error in the network configuration of this machine. 2. java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.rjvm.RJVMService at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:447) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:456) at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:225) at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:82) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2488) Truncated. see log file for complete stacktrace Caused By: java.lang.AssertionError: Could not obtain the localhost address. The most likely cause is an error in the network configuration of this machine. at weblogic.utils.net.AddressUtils$AddressMaker.getLocalHost(AddressUtils.java:39) at weblogic.utils.net.AddressUtils$AddressMaker.<clinit>(AddressUtils.java:34) at weblogic.utils.net.AddressUtils.getIPForLocalHost(AddressUtils.java:207) at weblogic.rjvm.JVMID.setLocalID(JVMID.java:241) at weblogic.rjvm.RJVMService.setJVMID(RJVMService.java:69) Truncated. see log file for complete stacktrace Caused By: java.net.UnknownHostException: MASTERR: MASTERR: Name or service not known at java.net.InetAddress.getLocalHost(InetAddress.java:1505) at weblogic.utils.net.AddressUtils$AddressMaker.getLocalHost(AddressUtils.java:37) at weblogic.utils.net.AddressUtils$AddressMaker.<clinit>(AddressUtils.java:34) at weblogic.utils.net.AddressUtils.getIPForLocalHost(AddressUtils.java:207) at weblogic.rjvm.JVMID.setLocalID(JVMID.java:241) Truncated. see log file for complete stacktrace Caused By: java.net.UnknownHostException: MASTERR: Name or service not known at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) at java.net.InetAddress.getLocalHost(InetAddress.java:1500) at weblogic.utils.net.AddressUtils$AddressMaker.getLocalHost(AddressUtils.java:37) Truncated. see log file for complete stacktrace > weblogic啓動的時候報網卡錯誤: 解決辦法: hostname MASTERR 修改hosts或者主機名 vi /etc/hosts vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 MASTERR 修改/etc/sysconfig/network中的hostname vi /etc/sysconfig/network [root@MASTERR ~]# cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=MASTERR |