https://pan.baidu.com/s/1QB7DTpW2XDXdNEp7wFOd_g
mkdir /ait
chmod 777 /ait
1)创建管理用户weblogic ,并添加密码(root)
useradd weblogic
password weblogic
2)weblogic自定义配置 (weblogic)
~/.bash_profile,
umask 002
ulimit -c unlimited
#(不限制core文件的大小)
cd
1) 安装jdk1.8.0_131 (root)
tar -zxvf jdk-8u131-linux-x64.tar.gz -C /usr/java/
java -version //查看jdk版本
2)配置java环境变量:(weblogic )
vi ~/.bash_profile
export PATH
export JAVA_HOME=/usr/java/jdk1.8.0_131
export JRE_HOME=/usr/java/jdk1.8.0_131/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export PATH=$JAVA_HOME/bin:$PATH
重新加载
source .bash_profile
1)创建初始化文件
mkdir /ait/oraInventory
mkdir /ait/install
mkdir /ait/weblogic
把weblogic的安装包放在 /ait/install里,解压出来的包名是fmw_12.2.1.2.0_wls.jar
cd /ait/install
vi /ait/install/oraInst.loc
inventory_loc=/ait/oraInventory
#产品清单目录;注意不能放在 weblogic安装目录下,要保证安装目录为空
inst_group=weblogic
#用户的组名称,根据实际的修改,注意用什么用户安装weblogic这里就写什么用户名,我用的是weblogic用户按的。
2)创建响应文件(注意文件内容格式,都是定格的)
vi /ait/install/wls.rsp
[ENGINE]
#DO NOT CHANGE THIS
Response File Version=1.0.0.0.0
[GENERIC]
#weblogic的安装路径
ORACLE_HOME=/ait/weblogic
#Set this variable value to the Installation Type selected.e.g. WebLogic Server, Coherence, Complete with Examples.
INSTALL_TYPE=WebLogic Server
DECLINE_SECURITY_UPDATES=true
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
3)安装
java -jar fmw_12.2.1.2.0_wls.jar-silent -responseFile/ait/install/wls.rsp -invPtrLoc /ait/install/oraInst.loc
注意:初始化文件和响应文件一定要是全路径,(自定义的)。
安装中耐心等待,出现Percent Complete : 100时安装完成安装信息如下
[weblogic@mcl install]$ java -jar fmw_12.2.1.2.0_wls.jar -silent -responseFile /ait/install/wls.rsp -invPtrLoc /ait/install/oraInst.loc
Launcher log file is/tmp/OraInstall2017-09-01_03-19-37PM/launcher2017-09-01_03-19-37PM.log.
Extracting the installer . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . Done
Checking if CPU speed is above 300 MHz. Actual 2711.997MHz Passed
Checking swap space: must be greater than 512 MB. Actual 2047MB Passed
Checking if this platform requires a 64-bit JVM. Actual64 Passed (64-bit not required)
Checking temp space: must be greater than 300 MB. Actual 11672MB Passed
Preparing to launch the Oracle Universal Installer from/tmp/OraInstall2017-09-01_03-19-37PM
Log: /tmp/OraInstall2017-09-01_03-19-37PM/install2017-09-01_03-19-37PM.log
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rightsreserved.
Reading response file..
Skipping Software Updates
Starting check : CertifiedVersions
Expected result: One oforacle-6,oracle-7,redhat-7,redhat-6,SuSE-11,SuSE-12
Actual Result: redhat-6.4
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.
Starting check : CheckJDKVersion
Expected result: 1.8.0_101
Actual Result: 1.8.0_131
Check complete. The overall result of this check is: Passed
CheckJDKVersion Check: Success.
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
Visit http://www.oracle.com/support/policies.html for Oracle TechnicalSupport policies.
Percent Complete : 100
The installation of Oracle Fusion Middleware 12c WebLogic Server andCoherence 12.2.1.2.0 completed successfully.
Logs successfully copied to /ait/oraInventory/logs.
1)创建domain前,在/ait/weblogic/oracle_common/common/bin/config.sh 中添加随机数加快domin的创建
JVM_ARGS="-Djava.security.egd=file:///dev/urandom-Dpython.cachedir=/tmp/cachedir ${JVM_D64} ${UTILS_MEM_ARGS}${SECURITY_JVM_ARGS} ${CONFIG_JVM_ARGS}"
2)采用wlst脚本来建立domain
vi /ait/install/create_domain.py
readTemplate('/ait/weblogic/wlserver/common/templates/wls/wls.jar')
cd('Servers/AdminServer')
set('ListenPort',7001)
cd('/')
cd('Security/base_domain/User/weblogic')
#如果需要修改管理员用户名为weblogic,则需要cmo.setName('weblogic')
cmo.setName('weblogic')
#用户名
cmo.setPassword('weblogic123')
#密码
setOption('ServerStartMode','prod')
setOption('OverwriteDomain','true')
writeDomain('/ait/weblogic/user_projects/proddomain')
#自定义的domin路径
closeTemplate()
exit()
(以上脚本也可以执行wlst.sh后,一条条执行create_domain.py里的命令)
如果创建失败有报错指向这个文件,请仔细修改文件不要出现多余的字符,可以把没用的注释行删掉
sh /ait/weblogic/oracle_common/common/bin/wlst.sh /ait/install/create_domain.py
注:过程可能较慢耐心等待。
3)安装信息
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Exiting WebLogic Scripting Tool.
1)查询当前补丁
sh /ait/weblogic/OPatch/opatch lsinventory
2)打补丁
mkdir /ait/weblogic/PATCH_TOP
unzip -d /ait/weblogic/PATCH_TOP p25388866_122120_Generic.zip
cd /ait/weblogic/PATCH_TOP/25388866
sh /ait/weblogic/OPatch/opatch apply
1)修改句柄数 自己环境可以不用操作此步
vim /etc/security/limits.conf(root即可)
wlsoper hard nofile 10240
wlsoper soft nofile 10240
2)domain相关配置
(1)添加domain随机数,指定编码方式
vi /ait/weblogic/user_projects/proddomain/bin/setDomainEnv.sh
JAVA_OPTIONS="${JAVA_OPTIONS} -Dfile.encoding=utf-8 -Djava.security.egd=file:///dev/urandom"
export JAVA_OPTIONS
(2)vi /ait/weblogic/user_projects/proddomain/bin/startWebLogic.sh
修改umask 037为umask 002
(3)vi /ait/weblogic/user_projects/proddomain/bin/stopWebLogic.sh,加入部分参数,加速 Admin Server 停止:
echo "shutdown('${SERVER_NAME}','Server', ignoreSessions='true',timeOut=0,force='true' )" >>"shutdown.py"
sh /ait/weblogic/user_projects/proddomain/bin/startWebLogic.sh //这是在前台运行,后边有后台运行的脚本。
启动信息
[weblogic@mcl bin]$ sh startWebLogic.sh
.
.
JAVA Memory arguments: -Xms256m -Xmx512m
.
CLASSPATH=/usr/java/jdk1.8.0_131/lib/tools.jar:/ait/weblogic/wlserver/server/lib/weblogic.jar:/ait/weblogic/wlserver/../oracle_common/modules/net.sf.antcontrib_1.1.0.0_1-0b3/lib/ant-contrib.jar:/ait/weblogic/wlserver/modules/features/oracle.wls.common.nodemanager.jar::/ait/weblogic/wlserver/common/derby/lib/derbynet.jar:/ait/weblogic/wlserver/common/derby/lib/derbyclient.jar:/ait/weblogic/wlserver/common/derby/lib/derby.jar:.:/usr/java/jdk1.8.0_131/lib/dt.jar:/usr/java/jdk1.8.0_131/lib/tools.jar:/usr/java/jdk1.8.0_131/jre/lib
.
PATH=/ait/weblogic/user_projects/proddomain/bin:/ait/weblogic/wlserver/server/bin:/ait/weblogic/wlserver/../oracle_common/modules/org.apache.ant_1.9.2/bin:/usr/java/jdk1.8.0_131/jre/bin:/usr/java/jdk1.8.0_131/bin:/usr/java/jdk1.8.0_131/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/weblogic/bin
.
***************************************************
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http://hostname:port/console *
***************************************************
Starting WLS with line:
/usr/java/jdk1.8.0_131/bin/java -server -Xms256m-Xmx512m -Dweblogic.Name=AdminServer-Djava.security.policy=/ait/weblogic/wlserver/server/lib/weblogic.policy -Dweblogic.ProductionModeEnabled=true -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/ait/weblogic/wlserver/server/lib/debugpatch-agent.jar -da-Dwls.home=/ait/weblogic/wlserver/server-Dweblogic.home=/ait/weblogic/wlserver/server -Dfile.encoding=utf-8 -Djava.security.egd=file:///dev/urandom weblogic.Server
Enter username to boot WebLogic server:填用户名即weblogic
Enter password to boot WebLogic server:密码即weblogic123
。
。
。
。
0.1, 172.16.107.101, 0:0:0:0:0:0:0:1.>
出现 RUNNING启动成功,可以去网页去控制台http://ip:7001/console
出现报错,原因是hosts文件没有指定
报错信息如下
Enter password to boot WebLogic server:
1. java.lang.AssertionError: Could not obtain the localhost address. Themost likely cause is an error in the network configuration of this machine.
2. java.lang.IllegalStateException: Unable to perform operation: postconstruct on weblogic.rjvm.RJVMService
3. java.lang.IllegalArgumentException: While attempting to resolve thedependencies of weblogic.protocol.ProtocolRegistrationService errors were found
4. java.lang.IllegalStateException: Unable to perform operation: resolveon weblogic.protocol.ProtocolRegistrationService
A MultiException has 4 exceptions. They are:
1. java.lang.AssertionError: Could not obtain the localhost address. Themost likely cause is an error in the network configuration of this machine.
2. java.lang.IllegalStateException: Unable to perform operation: postconstruct on weblogic.rjvm.RJVMService
3. java.lang.IllegalArgumentException: While attempting to resolve thedependencies of weblogic.protocol.ProtocolRegistrationService errors were found
4. java.lang.IllegalStateException: Unable to perform operation: resolveon weblogic.protocol.ProtocolRegistrationService
atorg.jvnet.hk2.internal.Collector.throwIfErrors(Collector.java:89)
at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:249)
atorg.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:357)
atorg.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:232)
Truncated. see log file for complete stacktrace
Caused By: java.lang.AssertionError: Could not obtain the localhostaddress. The most likely cause is an error in the network configuration of thismachine.
atweblogic.utils.net.AddressUtils$AddressMaker.getLocalHost(AddressUtils.java:36)
atweblogic.utils.net.AddressUtils$AddressMaker.
at weblogic.utils.net.AddressUtils.getIPForLocalHost(AddressUtils.java:163)
at weblogic.rjvm.JVMID.setLocalID(JVMID.java:277)
at weblogic.rjvm.RJVMService.setJVMID(RJVMService.java:72)
Truncated. see log file for complete stacktrace
Caused By: java.net.UnknownHostException: mcl: mcl: Name or service notknown
at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
atweblogic.utils.net.AddressUtils$AddressMaker.getLocalHost(AddressUtils.java:34)
atweblogic.utils.net.AddressUtils$AddressMaker.
atweblogic.utils.net.AddressUtils.getIPForLocalHost(AddressUtils.java:163)
at weblogic.rjvm.JVMID.setLocalID(JVMID.java:277)
Truncated. see log file for complete stacktrace
Caused By: java.net.UnknownHostException: mcl: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(NativeMethod)
atjava.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
atjava.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
atweblogic.utils.net.AddressUtils$AddressMaker.getLocalHost(AddressUtils.java:34)
Truncated. see log file for complete stacktrace
>
***************************************************************************
The WebLogic Server encountered a critical failure
Reason: Assertion violated
***************************************************************************
Stopping Derby server...
Derby server stopped.
解决办法
[root@mcl install]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4localhost4.localdomain4
::1 localhost localhost.localdomainlocalhost6 localhost6.localdomain6
172.16.107.101 localhost localhost.localdomain mcl
1).Adminserver启动时就不需要输入密码
mkdir /ait/weblogic/user_projects/proddomain/servers/AdminServer/security
vi /ait/weblogic/user_projects/proddomain/servers/AdminServer/security/boot.properties
username=weblogic
password=weblogic123
2)Adminserver启动脚本 //注意所有启动停止脚本要放在 /ait/weblogic/user_projects/proddomain下
mkdir /ait/weblogic/user_projects/proddomain/logs
cd /ait/weblogic/user_projects/proddomain/
vi/ait/weblogic/user_projects/proddomain/strAdminServer.sh
脚本内容
cd ./bin
mv ../logs/AdminServer.out ../logs/AdminServer`date +%Y-%m-%d-%H:%M:%S`.out
mv ../logs/AdminServer.err ../logs/AdminServer`date +%Y-%m-%d-%H:%M:%S`.err
mv ../logs/AdminServer_gc.out ../logs/AdminServer_gc`date +%Y-%m-%d-%H:%M:%S`.out
export USER_MEM_ARGS="-Xms2048m -Xmx2048m -Xmn768m -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError -verbose:gc -Xloggc:./logs/AdminServer_gc.out -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dweblogic.threadpool.MinPoolSize=100 -Dweblogic.threadpool.MaxPoolSize=300 -Dweblogic.management.disableManagedServerNotifications=true"
nohup ./startWebLogic.sh 1> ../logs/AdminServer.out 2> ../logs/AdminServer.err &
tail -f ../logs/AdminServer.out
3)Adminserver停止脚本
vi /ait/weblogic/user_projects/proddomain/stpAdminServer.sh
cd ./bin
./stopWebLogic.sh
4)server 启动脚本
vi /ait/weblogic/user_projects/proddomain/startappserver1.sh
cd ./bin
mv ../logs/appserver1.out ../logs/appserver1`date +%Y-%m-%d-%H:%M:%S`.out
mv ../logs/appserver1.err ../logs/appserver1`date +%Y-%m-%d-%H:%M:%S`.err
mv ../logs/appserver1_gc.out ../logs/appserver1_gc`date +%Y-%m-%d-%H:%M:%S`.out
export USER_MEM_ARGS="-Xms2048m -Xmx2048m -Xmn768m -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError -verbose:gc -Xloggc:./logs/appserver1_gc.out -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dweblogic.threadpool.MinPoolSize=100 -Dweblogic.threadpool.MaxPoolSize=300"
nohup ./startManagedWebLogic.sh shappserver1 t3://172.16.107.101:7001 1> ../logs/appserver1.out 2> ../logs/appserver1.err &
#tail -f ../logs/appserver1.out
注:启动脚本里的 appserver1要和后边控制台添加的服务器名一致
5)serverde 停止脚本
vi /ait/weblogic/user_projects/proddomain/stopappserver1.sh
cd ./bin
./stopManagedWebLogic.sh appserver1 t3://172.16.107.101:7001
1).在浏览器输入http://172.16.107.101:7001/console 登陆控制台
环境---->服务器--->点击锁定并编辑--->点击新建
服务器名:appserver1(自定义)
服务器监听地址:172.16.107.101 (这是adminserver的地址,如果server放在别的服务器上就填那台服务器的ip地址)
服务器监听端口: 8001
别忘了点激活更改,不点的话配置信息就不能写到config.xml里,要不启动server时会报错。
2)启动脚本
sh startappserver1.sh
看启动信息报错,没有起来,主要是没有写boot.properties,启动过程中要去找控制台用户名和密码,在Adminserver那复制过来就可以了
cd /ait/weblogic/user_projects/proddomain
[weblogic@mcl proddomain]$ cp -r servers/AdminServer/security/ servers/appserver1/
下