目录:
一、安装weblogic软件
二、创建域
三、启动管理节点
四、创建被管理节点
五、部署应用
一、安装weblogic软件
一、关闭selinux和防火墙
service iptables stop //关闭防火墙
setenforce 0 //临时关闭selinux
vi /etc/selinux/config //永久关闭,要重启
将SELINUX=enforcing改为SELINUX=disabled
二、创建普通用户管理weblogic
groupadd app
mkdir /app
useradd -d /app/sinova -g app sinova
echo "sinova" | passwd --stdin sinova
三、安装JDK
1、解压、移动到/app/sinova/
tar fx jdk1.7.0_45.tar
mv jdk1.7.0_45 /app/sinova/
2、配置JDK【声明环境变量】
vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
JAVA_HOME=/app/sinova/jdk1.7.0_45
PATH=${JAVA_HOME}/bin:$PATH:$HOME/bin
export PATH JAVA_HOME
3、测试效果
执行:java -version
显示:
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
四、修改 打开文件最大个数、最大进程数【root用户操作】
1、编辑 vi /etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
sinova soft nproc 65535
sinova hard nproc 65535
2、校验
ulimit -a
五、修改 /etc/hosts 【追加上本机具体IP和127.0.0.1 对应本机主机名】
127.0.0.1 localhost
192.168.101.166 localhost
六、安装weblogic软件 【sinova用户 安装目录 /app/sinova/oracle】
********开始安装*********
java -jar wls1033_generic.jar
Extracting 0%............................100% 【解压缩、提取文件】
Enter [Exit][Next]> 回车【默认就是Next】
Enter new Middleware Home OR [Exit][Previous][Next]> /app/sinova/oracle 【重新定义安装目录】
"Middleware Home" = [/u02/weblogic]
Use above value or select another option:
1 - Enter new Middleware Home
2 - Change to default [/u02/weblogic/Oracle/Middleware]
Enter option number to select OR [Exit][Previous][Next]> 回车 【重新定义安装目录完毕,直接回车】
Warning
/u02/weblogic directory is not empty. Proceed with installation?
Enter [Exit][Previous][Next]> 回车【警告忽略】
Provide your email address for security updates and to initiate configuration manager.
1|Email:[]
2|Support Password:[]
3|Receive Security Update:[Yes]
Enter index number to select OR [Exit][Previous][Next]> 3 【修改第3项,安全更新】
Provide your email address for security updates and to initiate configuration manager.
"Receive Security Update:" = [Enter new value or use default "Yes"]
Enter [Yes][No]? No 【不接受,安全更新】
** Do you wish to bypass initiation of the configuration manager and
** remain uninformed of critical security issues in your configuration?
Enter [Yes][No]? Yes【确认上面的操作】
1|Email:[]
2|Support Password:[]
3|Receive Security Update:[No]
Enter index number to select OR [Exit][Previous][Next]> 回车【上面操作的回显,直接回车】
Select the type of installation you wish to perform.
->1|Typical
| Install the following product(s) and component(s):
| - WebLogic Server
| - Oracle Coherence
| - Oracle Enterprise Pack for Eclipse
2|Custom
| Choose software products and components to install and perform optional
|configuration.
Enter index number to select OR [Exit][Previous][Next]> 直接回车 第1个 典型安装
<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->
JDK Selection (Any * indicates Oracle Supplied VM):
---------------------------------------------------
JDK(s) chosen for use with this product installation will be installed. Supported defaults if not deselected will be used in script string-substitution.
1|Add Local Jdk
2|/app/sinova/jdk1.7.0_45[x]
*Estimated size of installation: 727.6 MB
Enter 1 to add or >= 2 to toggle selection OR [Exit][Previous][Next]>
<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->
Choose Product Installation Directories:
----------------------------------------
Middleware Home Directory: [/app/sinova/Oracle]
Product Installation Directories:
1|WebLogic Server: [/app/sinova/Oracle/wlserver_10.3]
2|Oracle Coherence: [/app/sinova/Oracle/coherence_3.5]
Enter index number to select OR [Exit][Previous][Next]> 直接回车
<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->
The following Products and JDKs will be installed:
--------------------------------------------------
WebLogic Platform 10.3.3.0
|_____WebLogic Server
| |_____Core Application Server
| |_____Administration Console
| |_____Configuration Wizard and Upgrade Framework
| |_____Web 2.0 HTTP Pub-Sub Server
| |_____WebLogic SCA
| |_____WebLogic JDBC Drivers
| |_____Third Party JDBC Drivers
| |_____WebLogic Server Clients
| |_____WebLogic Web Server Plugins
| |_____UDDI and Xquery Support
| |_____Evaluation Database
|_____Oracle Coherence
|_____Coherence Product Files
*Estimated size of installation: 727.7 MB
Enter [Exit][Previous][Next]> 直接回车
Enter [Exit][Previous][Next]>
Feb 14, 2015 3:32:30 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->
Installing files..
0% 25% 50% 75% 100%
[------------|------------|------------|------------]
[***************************************************]
Performing String Substitutions...
<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->
Configuring OCM...
0% 25% 50% 75% 100%
[------------|------------|------------|------------]
[***************************************************]
Creating Domains...
<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->
Installation Complete
Congratulations! Installation is complete.
Press [Enter] to continue or type [Exit]> exit【安装完毕,退出】
<-------------------- Oracle Installer - WebLogic 10.3.3.0 ------------------->
Clean up process in progress ...
二、创建域
[sinova@localhost ~]$ cd /app/sinova/Oracle/wlserver_10.3/common/bin
[sinova@localhost bin]$ ./config.sh
Unable to instantiate GUI, defaulting to console mode.
<------------------- Fusion Middleware Configuration Wizard ------------------>
Welcome:
--------
Choose between creating and extending a domain. Based on your selection,
the Configuration Wizard guides you through the steps to generate a new or
extend an existing domain.
->1|Create a new WebLogic domain
| Create a WebLogic domain in your projects directory.
2|Extend an existing WebLogic domain
| Use this option to add new components to an existing domain and modify |configuration settings.
Enter index number to select OR [Exit][Next]> 1 #第1选择创建一个新的domain,第2选择使用一个已经存在的domian
<------------------- Fusion Middleware Configuration Wizard ------------------>
Select Domain Source:
---------------------
Select the source from which the domain will be created. You can create the
domain by selecting from the required components or by selecting from a
list of existing domain templates.
->1|Choose Weblogic Platform components
| You can choose the Weblogic component(s) that you want supported in
|your domain.
2|Choose custom template
| Choose this option if you want to use an existing template. This
|could be a custom created template using the Template Builder.
Enter index number to select OR [Exit][Previous][Next]> 1 #第1选择weblogic的组件
<------------------- Fusion Middleware Configuration Wizard ------------------>
Application Template Selection:
-------------------------------
Available Templates
|_____Basic WebLogic Server Domain - 10.3.3.0 [wlserver_10.3]x
|_____WebLogic Advanced Web Services for JAX-RPC Extension - 10.3.3.0 [wlserver_10.3] [2]
|_____WebLogic Advanced Web Services for JAX-WS Extension - 10.3.3.0 [wlserver_10.3] [3]
** Invalid input, not selectable
Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> #直接回车
<------------------- Fusion Middleware Configuration Wizard ------------------>
Edit Domain Information:
------------------------
| Name | Value |
_|________|_____________|
1| *Name: | base_domain |
Enter value for "Name" OR [Exit][Previous][Next]> #更改域的名称,这里使用默认,直接回车。
<------------------- Fusion Middleware Configuration Wizard ------------------>
Select the target domain directory for this domain:
---------------------------------------------------
"Target Location" = [Enter new value or use default
"/app/sinova/Oracle/Middleware/user_projects/domains"]
Enter new Target Location OR [Exit][Previous][Next]> /app/sinova/domains #域的安装路径修改为 /app/sinova/domains
<------------------- Fusion Middleware Configuration Wizard ------------------>
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the
default administrator used to start development mode servers.
| Name | Value |
_|_________________________|_________________________________________|
1| *Name: | weblogic |
2| *User password: | |
3| *Confirm user password: | |
4| Description: | This user is the default administrator. |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "User password"
3 - Modify "Confirm user password"
4 - Modify "Description"
Enter option number to select OR [Exit][Previous][Next]> 2 #修改第2项,给weblogic用户设置密码。密码设置为weblogic010
Enter option number to select OR [Exit][Previous][Next]> 3 #修改第3项,确认密码。
<------------------- Fusion Middleware Configuration Wizard ------------------>
Configure Administrator User Name and Password:
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the
default administrator used to start development mode servers.
"*Confirm user password:" = []
Enter new *Confirm user password: OR [Exit][Reset][Accept]> weblogic010
-----------------------------------------------
Create a user to be assigned to the Administrator role. This user is the
default administrator used to start development mode servers.
| Name | Value |
_|_________________________|_________________________________________|
1| *Name: | weblogic |
2| *User password: | *********** |
3| *Confirm user password: | *********** |
4| Description: | This user is the default administrator. |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "User password"
3 - Modify "Confirm user password"
4 - Modify "Description"
5 - Discard Changes
Enter option number to select OR [Exit][Previous][Next]> #直接回车
<------------------- Fusion Middleware Configuration Wizard ------------------>
Domain Mode Configuration:
--------------------------
Enable Development or Production Mode for this domain.
->1|Development Mode
2|Production Mode
Enter index number to select OR [Exit][Previous][Next]> 2 #1是开发模式,我们选择2,生产模式
<------------------- Fusion Middleware Configuration Wizard ------------------>
Java SDK Selection:
-------------------
->1|Sun SDK 1.6.0_45 @ /app/sinova/jdk1.6.0_45
2|Other Java SDK
Enter index number to select OR [Exit][Previous][Next]> #选择JDK,直接回车
<------------------- Fusion Middleware Configuration Wizard ------------------>
Select Optional Configuration:
------------------------------
1|Administration Server [ ]
2|Managed Servers, Clusters and Machines [ ]
3|RDBMS Security Store [ ]
Enter index number to select OR [Exit][Previous][Next]> 1 #选择1,只配置Admin Server,其它可以以后在控制台配置。
<------------------- Fusion Middleware Configuration Wizard ------------------>
Select Optional Configuration:
------------------------------
1|Administration Server [x]
2|Managed Servers, Clusters and Machines [ ]
3|RDBMS Security Store [ ]
Enter index number to select OR [Exit][Previous][Next]> #回车确认
Configure the Administration Server:
------------------------------------
Enter adminstration server configurations. Each WebLogic Server domain must
have one Administration Server. The Administration Server hosts the
Administration Console which is used to perform administrative tasks.
| Name | Value |
_|__________________|_____________________|
1| *Name: | AdminServer |
2| *Listen address: | All Local Addresses |
3| Listen port: | 7001 |
4| SSL listen port: | N/A |
5| SSL enabled: | false |
Use above value or select another option:
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
Enter option number to select OR [Exit][Previous][Next]> #回车确认,使用默认的端口7001
<------------------- Fusion Middleware Configuration Wizard ------------------>
Creating Domain...
0% 25% 50% 75% 100%
[------------|------------|------------|------------]
[***************************************************]
**** Domain Created Successfully! ****
配置完成。
三、启动管理节点
一、管理服务器----认证管理
[sinova@localhost ~]$ cd /app/sinova/domains/base_domain/servers/AdminServer(这个要手动起之后才会有这个目录)
[sinova@localhost AdminServer]$ mkdir security
[sinova@localhost AdminServer]$ cd security/
[sinova@localhost security]$ vi boot.properties
username=weblogic
password=weblogic010
二、创建目录【后面脚本会使用到】
mkdir -p /app/sinova/bin
mkdir -p /app/sinova/logs/www
三、编写 管理服务器启动脚本【管理节点给1G内存】
1、cd /app/sinova/bin
2、vi restart-admin.sh
#!/bin/bash
DATE=`date +%Y%m%d`
USER_MEM_ARGS="-Xms1024m -Xmx1024m -XX:MaxPermSize=256m"
export USER_MEM_ARGS JAVA_OPTIONS
ps -ef | grep java | grep weblogic | grep AdminServer | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1
nohup /app/sinova/domains/base_domain/bin/startWebLogic.sh > /app/sinova/logs/www/admin-${DATE}.log 2>&1 & ##weblogic安装启动文件
3、chmod +x restart-admin.sh
4、执行 ./restart-admin.sh
5、登录控平台 http://192.168.101.166:7001/console 【用户: weblogic 密码: weblogic010】
附上:启动管理节点出错的情况 我们手动起 先改这个配置
启动报错1【修改 vi /app/sinova/Oracle/wlserver_10.3/common/bin/commEnv.sh】
Exception in thread "Timer-1"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Timer-1"
Exception in thread "[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'"
Exception in thread "DynamicListenThread[Default]"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "DynamicListenThread[Default]"
./startWebLogic.sh: line 175: 58635 Killed ${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogic.policy ${JAVA_OPTIONS} ${PROXY_SETTINGS} ${SERVER_CLASS}
修改:【第152行,原 JAVA_VM=-jrockit】
148 # Set up JVM options base on value of JAVA_VENDOR
149 if [ "$PRODUCTION_MODE" = "true" ]; then
150 case $JAVA_VENDOR in
151 Oracle)
152 JAVA_VM=-server
153 MEM_ARGS="-Xms128m -Xmx256m"
启动报错2、【修改 /etc/hosts,增加上本机IP及127.0.0.1】
<Jan 29, 2015 11:57:23 AM CST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: java.lang.ExceptionInInitializerError.
weblogic.security.service.SecurityServiceException: java.lang.ExceptionInInitializerError
at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:342)
at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:221)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(CommonSecurityServiceManagerDelegateImpl.java:1783)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:442)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:840)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ExceptionInInitializerError
at com.octetstring.vde.util.guid.GuidGenerator.nextGuidInBytes(GuidGenerator.java:125)
at com.octetstring.vde.util.guid.Guid.<init>(Guid.java:84)
at com.octetstring.vde.backend.standard.BackendStandard.add(BackendStandard.java:379)
at com.octetstring.vde.backend.BackendHandler.add(BackendHandler.java:460)
at com.octetstring.vde.util.LDIF.importLDIF(LDIF.java:279)
Truncated. see log file for complete stacktrace
Caused By: java.lang.NullPointerException
at java.lang.System.arraycopy(Native Method)
at com.octetstring.vde.util.guid.GuidParamGenerator.generateNodeID(GuidParamGenerator.java:47)
at com.octetstring.vde.util.guid.GuidStateManager.initializeGUIDParameters(GuidStateManager.java:59)
at com.octetstring.vde.util.guid.GuidStateManager.<init>(GuidStateManager.java:30)
at com.octetstring.vde.util.guid.GuidStateManager.<clinit>(GuidStateManager.java:23)
Truncated. see log file for complete stacktrace
>
<Jan 29, 2015 11:57:23 AM CST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Jan 29, 2015 11:57:23 AM CST> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:
There are 1 nested errors:
weblogic.security.service.SecurityServiceRuntimeException: [Security:090399]Security Services Unavailable
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.doBootAuthorization(CommonSecurityServiceManagerDelegateImpl.java:916)
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initialize(CommonSecurityServiceManagerDelegateImpl.java:1050)
at weblogic.security.service.SecurityServiceManager.initialize(SecurityServiceManager.java:875)
at weblogic.security.SecurityService.start(SecurityService.java:141)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
启动报错3、【内存不够,使用我编写的启动脚本就不会报错了】
<Feb 14, 2015 3:43:56 AM CST> <Error> <JMX> <BEA-149500> <An exception occurred while registering the MBean com.bea:ServerRuntime=AdminServer,Name=AdminServer,Type=SingleSignOnServicesRuntime.
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
Truncated. see log file for complete stacktrace
>
<Feb 14, 2015 3:43:58 AM CST> <Error> <JMX> <BEA-149500> <An exception occurred while registering the MBean com.bea:ServerRuntime=AdminServer,Name=DataRetirementWorkManager,Type=MaxThreadsConstraintRuntime.
java.lang.OutOfMemoryError: PermGen space
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)
at java.lang.Class.getConstructor0(Class.java:2803)
at java.lang.Class.getDeclaredConstructor(Class.java:2053)
at weblogic.management.provider.internal.BeanInfoAccessImpl.buildBeanInfo(BeanInfoAccessImpl.java:400)
Truncated. see log file for complete stacktrace
四、创建被管理节点
一、登录控制台
http://192.168.101.166:7001/console
用户: weblogic 密码: weblogic010
二、创建集群
点击“锁定并编辑”,接下来可新建服务器或集群。
点击“新建”
点击“下一步”
节点2创建方法和节点1一样
状态为“unknown”,这是因为还没启动节点。
点击“激活更改”保存配置。
三、被管理服务器----密码认证
cd /app/sinova/domains/base_domain/bin
vi startManagedWebLogic.sh
[查找,并修改,如下]
WLS_USER="weblogic"
export WLS_USER
WLS_PW="weblogic010"
export WLS_PW
四、编写重启被管理节点脚本
cd /app/sinova/bin
1、vi restart_redgift_node1.sh
#!/bin/bash
DATE=`date +%Y%m%d`
WLS_NODE="redgift_node1" 【换成对应的Note名称】
USER_MEM_ARGS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m"
JAVA_OPTIONS="-DUseSunHttpHandler=true"
ServiceIP=192.168.101.166 【管理服务器IP】
export USER_MEM_ARGS JAVA_OPTIONS WLS_NODE ServiceIP
ps -ef | grep java | grep weblogic | grep -w ${WLS_NODE} | awk '{print $2}' | xargs kill -9 > /dev/null 2>&1
rm -rf /app/sinova/domains/base_domain/servers/${WLS_NODE}/tmp/*
sleep 1
nohup /app/sinova/domains/base_domain/bin/startManagedWebLogic.sh ${WLS_NODE} http://192.168.101.166:7001/ >/app/sinova/logs/www/${WLS_NODE}-${DATE}.log 2>&1 & 【这里的ip是管理服务器的ip和端口】
2、vi restart_redgift_all.sh
#!/bin/bash
/app/sinova/bin/restart_redgift_node1.sh
/app/sinova/bin/restart_redgift_node2.sh
3、授权 chmod +x *.sh
4、执行启动所有节点 ./restart_redgift_all.sh
五、控制台查看节点状态
五、部署应用
- 新建应用目录:
[sinova@localhost ~]$ cd /app/sinova/
[sinova@localhost ~]$ mkdir application
- 上传应用至application目录并解压
- 将解压后的应用同步至其它节点
- 控制台上部署应用: