第一种:
一、软件安装
1. 安装前的准备工作
1.1 首先请确认您要安装的WebLogic版本所在的平台已通过了BEA的认证,完整的认证平台列表请参考 http://e-docs.bea.com/platform/suppconfigs/index.html
1.2 确定一个安装目录,建议该目录下至少有1个G的空间,可单独创建个逻辑卷和文件系统
1.3 创建一个BEA用户组帐号
1.4 创建一个weblogic用户帐号
2. 安装步骤
WebLogic在AIX平台下的安装方法一般有三种:图形窗口模式,控制台模式,无人守护安装模式。由于控制台模式的使用最为广泛且不受任何其它硬件条件的限制(所以我们这里只介绍控制台安装模式。
2.1 安装JRE环境
WebLogic安装程序需要JRE的支持,根据安装平台的不同,WebLogic的安装介质也分为两类,一种自带了JRE(后缀名为.bin),一种需要下载平台厂商所提供的JRE环境(后缀名为.jar),以WebLogic Server 8.1 with SP2为例,目前所支持的UNIX/LINUX平台如下所示(截止2004.2.23)
WebLogic Server 8.1 with SP2
支持平台 是否自带JDK
HP-UX (11.0,11.i, PA-RISC) YES
Sun Solaris (8, 9, SPARC) YES
Red Hat Enterprise Linux (2.1, Pentium) YES
Red Hat Enterprise Linux (2.1, Itanium) YES
SuSE SLES (8, Pentium) YES
United Linux (1.0, Pentium) YES
IBM AIX (5.1, 5.2) NO
首先要下载和操作系统以及WEBLOGIC相匹配JDK版本,最好是经过BEA认证的版本。可查询以下链接http://e-docs.bea.com/platform/suppconfigs/index.html;在AIX上安装JDK要注意以下步骤:安装后要修改环境变量/etc/environment文件,将PATH中Java部分更改为新安装的Java版本(Java131或Java14),并重新Login后生效!否则系统会使用原有的Java130环境,在安装weblogic7.0以上版本时会自动退回到提示符下。
2.2 获取并上传weblogic安装介质到一个临时目录
如果手头没有安装介质,我们可以到http://commerce.bea.com上下载一个WebLogic试用版,然后通过FTP上传到主机上的一个临时目录,该临时目录建议至少有1个G的剩余空间
2.3 开始安装
2.3.1 .bin的安装方法
首先赋予.bin可执行权限
chmod a+x filename.bin
然后执行
./filename.bin -mode=console
2.3.2 .jar的安装方法
然后执行
java -jar filename.jar -mode=console(字符)
java -jar filename.jar -mode=graphics(图形)
2.4 控制台安装
2.4.1 完成2.3的步骤后,进入控制台安装的欢迎界面,键入[Next]继续
2.4.2 此时出现授权许可协议,读完后键入[Yes]继续
2.4.3 提示选择一个BEA主目录,如下所示
Choose BEA Home Directory:"BEA Home" = [/home/weblogic/bea]Input new BEA Home OR [Exit][Previous][Next]>
如果想更改默认的BEA主目录,重新输入完整的目录路径即可,否则键入[Next]继续
2.4.4 确认BEA主目录
Choose BEA Home Directory: ->1| Yes, Use this BEA home directory [/home/bea] 2| No, return to BEA home directory selectionEnter index number to select OR [Exit][Previous][Next]>
键入[1]继续
2.4.5 选择安装类型
Choose Install Type: ->1|Complete Installation |Install the complete BEA WebLogic Platform. 2|Custom Installation |Choose software components to install and optionally create custom |application domains. Recommended for advanced users.
键入[1]继续
2.4.6 选择安装路径
Choose Product Directory:Product Installation Directory = [/home/bea/weblogicXX]Input new Product Installation Directory OR [Exit][Previous][Next]>
如果想更改默认的安装目录,重新输入完整的目录路径即可,否则键入[Next]继续
2.4.7 确认安装路径
Choose Product Directory: ->1| Yes, use this product directory [/home3/weblogicXX] 2| No, select another product directoryEnter index numbers to select OR [Exit][Previous][Next]>
键入[1]继续
2.4.8 现在开始安装,此时会出现一个模拟的进度条,耐心等待,直到100%安装顺利结束。
二、配置Configuration Wizard
软件安装完毕后,下一步配置Domain域,进入weblogic安装目录(例如:/wls/weblogic700/common/bin),找到文件dmwiz.sh,执行他#./dmwiz.sh;选择WLS Domain,NEXT下一步;
此界面有四个选项,单一服务选择第一项Single server;第二项管理服务,第三项集群管理服务;第四项管理服务设置;我们选择第一项,NEXT下一步;
确认Domain域路径,我们选择默认路径;NEXT下一步;
该界面要输入
Server Name(服务名称)-------myserver
Server Listen Adress一栏为服务器地址,此项为默认,可不填!
Server Listen Por交互端口---7001
Server Listen SSL Por监听端口------7002
NEXT下一步
创建Administrative User用户名和密码(密码不少于8位),NEXT下一步;
该界面是所有配置信息的汇总确认,如果没问题,点击Create,开始创建DOMAIN域.
三、启动Weblogic
在启动Weblogic之前,可将服务用户名和密码写入启动脚本。
进入刚刚配置完成的域目录(例如:/wls/user_projects/mydomain),编辑startWebLogic.sh启动脚本,执行$ vi startWebLogic.sh
在“WLS_USER= WLS_PW=”输入用户名和密码,保存退出;
最后执行$ ./startWebLogic.sh,启动Weblogic..
四、停止Weblogic服务
停止Weblogic服务有多种:
1、 KILL掉进程
2、 通过”http://服务地址:7001/console”,shutdownserver
3、 利用脚本停止服务:
在#/wls/weblogic700/samples/workshop路径下,有一个stopWebLogic.sh文件,对他进行稍微编辑,COPY到/wls/user_projects/mydomain目录下,执行即可。
第二种:
1.安装weblogic10.3.0.0
增加weblogic组:
groupadd weblogic
增加weblogic用户:
# useradd -g weblogic weblogic
创建安装目录
#mkdir -p /app/weblogic
#cd /app/
#chown -R weblogic:weblogic weblogic
#mv /home/yxgly/server103_linux32.bin /home/weblogic/
#cd /home/weblogic/
# chown weblogic:weblogic server103_linux32.bin
切换到weblogic用户,安装WebLogic
#su - weblogic
$ chmod u+x server103_linux32.bin
$ ./server103_linux32.bin
Extracting 0%....................................................................................................100% Unable to instantiate GUI, defaulting to console mode. <------------------------------------------------------ Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------------------> Welcome: -------- This installer will guide you through the installation of WebLogic Platform 10.3.0.0. Type "Next" or enter to proceed to the next prompt. If you want to change data entered previously, type "Previous". You may quit the installer at any time by typing "Exit". Enter [Exit][Next]> 直接回车 <------------------------------------------------------ Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------------------> Choose BEA Home Directory: -------------------------- "BEA Home" = [Enter new value or use default "/home/weblogic/bea"] Enter new BEA Home OR [Exit][Previous][Next]> /app/weblogic <------------------------------------------------------ Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------------------> Choose BEA Home Directory: -------------------------- "BEA Home" = [/opt/weblogic] Use above value or select another option: 1 - Enter new BEA Home 2 - Change to default [/home/weblogic/bea] Enter option number to select OR [Exit][Previous][Next]> 1 <------------------------------------------------------ Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------------------> Choose BEA Home Directory: -------------------------- "BEA Home" = [/opt/weblogic] Enter new BEA Home OR [Exit][Previous][Next]> 直接回车 <------------------------------------------------------ Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------------------> Choose Install Type: -------------------- Select the type of installation you wish to perform. ->1|Complete | Install the following software products and examples: | - WebLogic Server | - Workshop 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 Platform 10.3.0.0 -----------------------------------------------------> Choose Product Installation Directories: ---------------------------------------- BEA Home Directory: [/opt/weblogic] Product Installation Directories: 1|WebLogic Server: [/opt/weblogic/wlserver_10.3] 2|Workshop: [/opt/weblogic/workshop_10.3] Enter index number to select OR [Exit][Previous][Next]> 直接回车 <------------------------------------------------------ Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------------------> The following Products and JDKs will be installed: -------------------------------------------------- WebLogic Platform 10.3.0.0 |_____WebLogic Server | |_____Core Application Server | |_____Administration Console | |_____Configuration Wizard and Upgrade Framework | |_____Web 2.0 HTTP Pub-Sub Server | |_____WebLogic JDBC Drivers | |_____Third Party JDBC Drivers | |_____WebLogic Server Clients | |_____WebLogic Web Server Plugins | |_____UDDI and Xquery Support | |_____Server Examples |_____Workshop | |_____Workshop for WebLogic | |_____Workshop Runtime Framework |_____JDKs |_____Sun SDK 1.6.0_05 |_____BEA JRockit 1.6.0_05 SDK *Estimated size of installation: 1,129.9 MB Enter [Exit][Previous][Next]> 直接回车 2012-11-7 10:44:54 java.util.prefs.FileSystemPreferences$2 run 信息: Created user preferences directory. <------------------------------------------------------ Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------------------> Installing files.. 0% 25% 50% 75% 100% [------------|------------|------------|------------] [***************************************************] <------------------------------------------------------ Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------------------> Installing JDK.... 0% 25% 50% 75% 100% [------------|------------|------------|------------] [***************************************************] Performing String Substitutions... Creating Domains... <------------------------------------------------------ Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------------------> Installation Complete Congratulations! Installation is complete. Press [Enter] to continue or type [Exit]> 直接回车 |
2.安装weblogic域
# su - weblogic
#cd /app/weblogic/wlserver_10.3/common/bin
$ sh config.sh
Unable to instantiate GUI, defaulting to console mode. <---------------------------------------------------------- Oracle WebLogic 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 | Extend an existing WebLogic domain. Use this option to add applications and services, or to override existing database access (JDBC) and messaging |(JMS) settings. You can also incorporate additional functionality in your domain, for example, by including AquaLogic Service Bus. Enter index number to select OR [Exit][Next]> 1 <---------------------------------------------------------- Oracle WebLogic 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 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Application Template Selection: ------------------------------- Available Templates |_____WebLogic Server (Required)x |_____Workshop for WebLogic 10.3 [2] Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> 回车 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Configure Administrator Username 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| *User 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 "User name" 2 - Modify "User password" 3 - Modify "Confirm user password" 4 - Modify "Description" Enter option number to select OR [Exit][Previous][Next]> 2 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Configure Administrator Username and Password: ---------------------------------------------- Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers. "*User password:" = [] Enter new *User password: OR [Exit][Reset][Accept]> 12345678 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Configure Administrator Username 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| *User 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 "User 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]> 3 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Configure Administrator Username 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]> 12345678 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Configure Administrator Username 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| *User 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 "User 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]> 回车 <---------------------------------------------------------- Oracle WebLogic 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 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Java SDK Selection: ------------------- 1|JRockit SDK 1.6.0_05 @ /app/weblogic/jrockit_160_05 ->2|Sun SDK 1.6.0_05 @ /app/weblogic/jdk160_05 3|Other Java SDK Enter index number to select OR [Exit][Previous][Next]> 1 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Choose Configuration Option: ---------------------------- *Do you want to modify any of the preconfigured settings or defaults in your template? * *To keep the default or template settings, and proceed directly to name and create your domain, leave No selected. 1|Yes ->2|No Enter index number to select OR [Exit][Previous][Next]> 回车 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Select the target domain directory for this domain: --------------------------------------------------- "Target Location" = [Enter new value or use default "/app/weblogic/user_projects/domains"] Enter new Target Location OR [Exit][Previous][Next]> 回车 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Edit Domain Information: ------------------------ | Name | Value | _|________|_____________| 1| *Name: | base_domain | Enter value for "Name" OR [Exit][Previous][Next]> 回车 <---------------------------------------------------------- Oracle WebLogic Configuration Wizard ----------------------------------------------------------> Creating Domain... 0% 25% 50% 75% 100% [------------|------------|------------|------------] [***************************************************] **** Domain Created Successfully! ****
------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3.weblogic调优
㈠.修改setDomainEnv.sh文件
#vi /app/weblogic/user_projects/domains/base_domain/bin/setDomainEnv.sh
将参数修改为如下: MEM_ARGS="-Xms2048m -Xmx2048m" export MEM_ARGS MEM_PERM_SIZE="-XX:PermSize=256m" export MEM_PERM_SIZE MEM_MAX_PERM_SIZE="-XX:MaxPermSize=512m" export MEM_MAX_PERM_SIZE 修改JAVA_OPTIONS="${JAVA_OPTIONS}"参数 将375和376行 JAVA_OPTIONS="${JAVA_OPTIONS}" export JAVA_OPTIONS 修改为: JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.threadpool.MinPoolSize=2000" export JAVA_OPTIONS JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.threadpool.MaxPoolSize=4000" export JAVA_OPTIONS |
㈡. 增大accept backlog的值。
进入weblogic控制台Servers/AdminServer(admin)/
Tuning下面,将Stuck Thread Max Time:设置为1200,然后保存。
Overload下面,将Max Stuck Thread Time:设置为1200,然后保存。
㈢. 修改数据库连接数
进入weblogic控制台Servers/Services/OADS/Connection Pool
把下列参数设置为
Initial Capacity:50
Max Capacity:200
Capacity Increment:10
4.设置启动weblogic不用输入用户名密码
启动weblogic时,需要手工输入用户名和密码,这是个很麻烦的事情,加一个配置文件即可。
进入AdminServer目录:
#cd /app/weblogic/user_projects/domains/base_domain/servers/AdminServer
创建目录:
$ mkdir -p servers/AdminServer/security
创建boot.properties文件,内容如下:
username=weblogic
password= 12345678
然后启动weblogic服务,你就不用输入用户名和密码了,启动完成之后,
你再看这个文件里面的内容,就会发现这个文件里面的用户名和密码被加密了。
$ cat/app/weblogic/user_projects/domains/base_domain/servers/AdminServer/security/boot.properties
5.weblogic的启动与停止
启动服务:
#cd/app/weblogic/user_projects/domains/base_domain
#sh startWebLogic.sh
停止服务:
#cd /app/weblogic/user_projects/domains/base_domain/bin
$sh stopWebLogic.sh