欢迎来到魔幻小生的博客

CentOS安装部署Weblogic12.1.3

开始以为和旧版安装一样,使用控制台的方式,下载bin文件,然后一步步在console执行下来就行了。万万没想到,从12C版本后,bin文件不提供了,改成全系统通用的jar文件 (generic.jar)。试了半天原来那种安装方式不能用了,非得用图形界面安装。各种找材料,最后终于找到一种静默方式的安装(同样适用于SUSE 12 SP5)。

下载地址

链接:https://pan.baidu.com/s/18G-twUHz6hToHi4oKLpmaQ
提取码:o3rs

fmw_12.1.3.0.0_wls.jar     需要jdk1.7.0_15以上的版本

也可以自行去官网下载

创建weblogic用户和组

groupadd weblogic
useradd -g weblogic -m -d /home/weblogic weblogic
passwd weblogic
NEW PASS:12345678

配置JDK

自行下载解压JDK (如jdk-8u111-linux-x86.tar.gz),并移动至/usr/local目录(不支持 OpenJDK)

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=/home/weblogic/u02/bea

source .bash_profile

java -version提示:
-bash: /usr/local/jdk1.8.0_144/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: 没有那个文件或目录

说明我安装错jdk版本了,不应该安装linux-i586的- -
需要sudo yum install glibc.i686使之兼容

离线安装glibc.i686:
链接:https://pan.baidu.com/s/1mXxregN0B2qinDRvTwdyFg
提取码:g7od
执行install.sh文件

创建响应文件 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=/home/weblogic/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

赋予读写权限

/home/weblogic/u02/bea文件用户weblogic必须要有读写权限
oraInst.loc,wls.rsp,fmw_12.1.3.0.0_wls.jar 文件用户weblogic必须要有读写权限

安装weblogic

安装需要使用之前新建的weblogic用户,无法使用root用户安装

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域名

cd ~
echo 'export MW_HOME="/home/weblogic/u02/bea"' >> .bash_profile
echo 'export WL_HOME="/home/weblogic/u02/bea/oracle_common"' >> .bash_profile

source .bash_profile

[root@WAAA-NM1 bin]# pwd
/home/weblogic/u02/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('/home/weblogic/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('12345678')
wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('OverwriteDomain', 'true')
wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/home/weblogic/u02/bea/user_projects/domains/base_domain')     # 需要等待一会儿

closeTemplate()
exit()

启动weblogic

$ cd /home/weblogic/u02/bea/user_projects/domains/base_domain/bin
$ nohup ./startWeblogic.sh &

访问 http://IP:7001/console ,看到如图页面则启动成功

image

点击左侧“部署”,安装相关war包进行使用

image

weblogic清除缓存

找到下面3个目录,然后将里面的文件删除即可:

……/user_projects/domains/base_domain/servers/AdminServer/tmp/ 
……/user_projects/domains/base_domain/servers/AdminServer/cache/ 
……/user_projects/domains/base_domain/config/deployments/

注意:在cache目录下如发现有security 文件夹,该文件夹为安全认证文件,不可删除。通常测试模式的服务自动会生成该文件,而生产模式则需人为创建

遇到的问题

我在实际部署过程中,最后启动weblogic服务时遇到过如下问题:

<2022-11-2 下午03时51分52秒 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: linux-38s9: linux-38s9: 未知的名称或服务
        at java.net.InetAddress.getLocalHost(InetAddress.java:1506)
        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: linux-38s9: 未知的名称或服务
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1501)
        at weblogic.utils.net.AddressUtils$AddressMaker.getLocalHost(AddressUtils.java:37)
        Truncated. see log file for complete stacktrace
> 
***************************************************************************
The WebLogic Server encountered a critical failure
Reason: Assertion violated
***************************************************************************
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class weblogic.protocol.ServerIdentityManager$Initializer
        at weblogic.protocol.ServerIdentityManager.findServerIdentity(ServerIdentityManager.java:66)
        at weblogic.protocol.URLManager.findAdministrationURL(URLManager.java:174)
        at weblogic.server.ServerLifeCycleRuntime.getLifeCycleOperationsRemote(ServerLifeCycleRuntime.java:1166)
        at weblogic.t3.srvr.ServerRuntime.sendStateToAdminServer(ServerRuntime.java:433)
        at weblogic.t3.srvr.ServerRuntime.updateRunState(ServerRuntime.java:419)
        at weblogic.t3.srvr.T3Srvr.setState(T3Srvr.java:231)
        at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:531)
        at weblogic.Server.main(Server.java:65)

image

解决方法:需要修改host文件

查看主机名:hostname

image

修改host文件

linux-38s9:~ # vi /etc/hosts

# 添加下面内容
127.0.0.1 linux-38s9        # 配置本地ip地址与主机名的映射关系

问题解决!

posted @ 2022-08-24 14:49  魔幻小生  阅读(757)  评论(0编辑  收藏  举报