安装最新的weblogic版本,版本号为 12.1.X(12.1.2,12.1.3)。开始以为和旧版安装一样,使用控制台的方式,下载bin文件,然后一步步在console执行下来就行了。万万没想到,从12C版本后,bin文件不提供了,改成全系统通用的jar文件 (generic.jar)。试了半天原来那种安装方式不能用了,非得用图形界面安装。由于服务器只能远程登录,于是各种百度、各种找材料,最后终于找到一种静默方式的安装。请看下文。
weblogic12C各版本所支持的JDK版本:
fmw_12.1.3.0.0_wls.jar 需要jdk1.7.0_15以上的版本
wls_121200.jar 需要jdk1.7版本;1.8版本不可用
weblogic在安装的时候会对系统进行严格的检查,
包括jdk版本,cpu性能,swap空间,磁盘空间,tmp临时空间[软件在安装时会产生大约1G的日志以及其他必须的文件]等;
1、创建weblogic用户和组
root用户 groupadd weblogic useradd -g weblogic -m -d /home/weblogic weblogic passwd weblogic NEW PASS :weblogic1@4 |
2、配置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) |
3、创建响应文件 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= #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= #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= |
4、创建Loc文件 oraInst.loc
inventory_loc=/home/weblogic/oraInventory inst_group=weblogic |
6、保证所需要得目录weblogic用户要用读写权限
/ghca/bea文件用户weblogic必须要有读写权限
oraInst.loc,wls.rsp,fmw_12.1.3.0.0_wls.jar 文件用户weblogic必须要有读写权限
7、安装 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 启动 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安装成功了。 |
8、 创建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; |
9、启动
$cd /u02/bea/user_projects/domains/base_domain/bin
$./startWeblogic.sh
参考官网资料:
https://docs.oracle.com/middleware/1213/core/OUIRF/silent.htm#OUIRF337
10、安装部署中遇到的问题
1、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 启动 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。 2、不能用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. 3、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 4、weblogic启动的时候报网卡错误 ./startWeblogic ....... 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. 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. 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 |