Weblogic 12c 软件安装及域的创建配置

软件下载地址

https://www.oracle.com/technetwork/middleware/fusion-middleware/downloads/index.html

https://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html

配置java环境变量

[bea@redhat6 data]$ source /home/tyusr/.bashrc

创建应答文件

[bea@redhat6 data]$ ll

total 1825308

-rw-r--r-- 1 bea bea 838986083 Apr 26 01:13 fmw_12.2.1.3.0_wls_Disk1_1of1.zip

-rwxr-xr-x 1 bea bea 839208313 Aug 21  2017 fmw_12.2.1.3.0_wls.jar

-rw-r--r-- 1 bea bea      9063 Aug  8  2017 fmw_12213_readme.htm

drwxr-xr-x 8 bea bea      4096 Mar 28  2018 jdk1.8.0_171

-rw-r--r-- 1 bea bea 190890122 Apr 26 01:14 jdk-8u171-linux-x64.tar.gz

应答文件1

[bea@redhat6 data]$ touch oraInst.loc

[bea@redhat6 data]$ cat oraInst.loc

inventory_loc=/data/oraInventory

inst_group=bea

应答文件2

[bea@redhat6 data]$ touch wls.rsp

[bea@redhat6 data]$ cat wls.rsp

[ENGING]

Response File Version=1.0.0.0.0

[GENERIC]

ORACLE_HOME=/data/weblogic

INSTALL_TYPE=WebLogic Server

 

[bea@redhat6 data]$ ll

total 1825312

-rw-r--r-- 1 bea bea 838986083 Apr 26 01:13 fmw_12.2.1.3.0_wls_Disk1_1of1.zip

-rwxr-xr-x 1 bea bea 839208313 Aug 21  2017 fmw_12.2.1.3.0_wls.jar

-rw-r--r-- 1 bea bea      9063 Aug  8  2017 fmw_12213_readme.htm

drwxr-xr-x 8 bea bea      4096 Mar 28  2018 jdk1.8.0_171

-rw-r--r-- 1 bea bea 190890122 Apr 26 01:14 jdk-8u171-linux-x64.tar.gz

-rw-rw-r-- 1 bea bea        49 Apr 26 01:22 oraInst.loc

-rw-rw-r-- 1 bea bea         0 Apr 26 01:22 wls.rsp

[bea@redhat6 data]$ ls

fmw_12.2.1.3.0_wls_Disk1_1of1.zip  fmw_12213_readme.htm  jdk-8u171-linux-x64.tar.gz  wls.rsp

fmw_12.2.1.3.0_wls.jar             jdk1.8.0_171          oraInst.loc

weblogic软件的安装

[bea@redhat6 data]$ java -jar fmw_12.2.1.3.0_wls.jar -silent -responseFile /data/wls.rsp -invPtrLoc /data/oraInst.loc

Launcher log file is /tmp/OraInstall2019-04-26_01-26-44AM/launcher2019-04-26_01-26-44AM.log.

Extracting the installer . . . . . . . . . Done

Checking if CPU speed is above 300 MHz.   Actual 2594.160 MHz    Passed

Checking swap space: must be greater than 512 MB.   Actual 1983 MB    Passed

Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)

Checking temp space: must be greater than 300 MB.   Actual 10363 MB    Passed

Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2019-04-26_01-26-44AM

Log: /tmp/OraInstall2019-04-26_01-26-44AM/install2019-04-26_01-26-44AM.log

Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.

Reading response file..

Skipping Software Updates

Starting check : CertifiedVersions

Expected result: One of oracle-6, oracle-7, redhat-7, redhat-6, SuSE-11, SuSE-12

Actual Result: redhat-6.6

Check complete. The overall result of this check is: Passed

CertifiedVersions Check: Success.

 

 

Starting check : CheckJDKVersion

Expected result: 1.8.0_131

Actual Result: 1.8.0_171

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

Percent Complete : 100

 

The installation of Oracle Fusion Middleware 12c WebLogic Server and Coherence 12.2.1.3.0 completed successfully.

Logs successfully copied to /data/oraInventory/logs.

[bea@redhat6 data]$ ll ##注意,12c的zip压缩包解压后,得到的文件(fmw_12.2.1.3.0_wls.jar)没有写权限,需要手头添加

total 1825324

-rw-r--r--  1 bea bea 838986083 Apr 26 01:13 fmw_12.2.1.3.0_wls_Disk1_1of1.zip

-rwxr-xr-x  1 bea bea 839208313 Aug 21  2017 fmw_12.2.1.3.0_wls.jar

-rw-r--r--  1 bea bea      9063 Aug  8  2017 fmw_12213_readme.htm

drwxr-xr-x  8 bea bea      4096 Mar 28  2018 jdk1.8.0_171

-rw-r--r--  1 bea bea 190890122 Apr 26 01:14 jdk-8u171-linux-x64.tar.gz

-rw-rw-r--  1 bea bea        49 Apr 26 01:22 oraInst.loc

drwxrwx---  6 bea bea      4096 Apr 26 01:29 oraInventory

drwxr-x--- 10 bea bea      4096 Apr 26 01:28 weblogic

-rw-rw-r--  1 bea bea       108 Apr 26 01:23 wls.rsp

[bea@redhat6 bin]$ pwd

/data/weblogic/wlserver/server/bin

[bea@redhat6 bin]$ ls

eclipse.sh  saveMemory.sh  setWLSEnv.sh  startNodeManager.sh  startRSDaemon.sh  stopNodeManager.sh  stopRSDaemon.sh

[bea@redhat6 bin]$ ./setWLSEnv.sh

CLASSPATH=/data/jdk1.8.0_171/lib/tools.jar:/data/weblogic/wlserver/modules/features/wlst.wls.classpath.jar:

 

PATH=/data/weblogic/wlserver/server/bin:/data/weblogic/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.9.8.0.0/apache-ant-1.9.8/bin:/data/jdk1.8.0_171/jre/bin:/data/jdk1.8.0_171/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/bea/bin:/data/jdk1.8.0_171/jre/bin:/data/jdk1.8.0_171/bin:/data/weblogic/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin

 

Your environment has been set.

方法1:字符

手动创建域目录

[bea@redhat6 data]$mkdir -p /data/weblogic/user_projects/domains/domain120/

查找wlst脚本工具

[bea@redhat6 weblogic]$ cd wlserver/common/templates/scripts/wlst/

[bea@redhat6 wlst]$ ls

basicWLSDomain.py

 

将脚本文件拷贝到域目录下

[bea@redhat6 wlst]$ cp basicWLSDomain.py /data/weblogic/user_projects/domains/domain120/

 

WLST:weblogic scripting tool,即weblogic脚本工具。

weblogic脚本工具是一种命令行脚本界面,系统管理员和操作员用它来监视和管理weblogic server实例以及域。wlst脚本基于java脚本解释器Jython。

原始建域脚本

[root@redhat6 wlst]# cat -n basicWLSDomain.py

     1       #======================================================================

     2    # This is an example of a simple WLST offline configuration script. The script creates

     3    # a simple WebLogic domain using the Basic WebLogic Server Domain template. The script

     4    # demonstrates how to open a domain template, create and edit configuration objects,

     5    # and write the domain configuration information to the specified directory.

     6    #

     7    # This sample uses the demo Derby Server that is installed with your product.

     8    # Before starting the Administration Server, you should start the demo Derby server

     9    # by issuing one of the following commands:

    10    #

    11    # Windows: WL_HOME\common\derby\bin\startNetworkServer.cmd

    12    # UNIX: WL_HOME/common/derby/bin/startNetworkServer.sh

    13    #

    14    # (WL_HOME refers to the top-level installation directory for WebLogic Server.)

    15    #

    16    # The sample consists of a single server, representing a typical development environment.

    17    # This type of configuration is not recommended for production environments.

    18    #

    19    # Please note that some of the values used in this script are subject to change based on

    20    # your WebLogic installation and the template you are using.

    21    #

    22    # Usage:

    23    #      java weblogic.WLST

    24    #

    25    # Where:

    26    #      specifies the full path to the WLST script.

    27       #======================================================================

    28   

    29       #======================================================================

    30    # Open a domain template.

    31       #======================================================================

    32   

    33    readTemplate("/data/weblogic/wlserver/common/templates/wls/wls.jar")

    34   

    35       #======================================================================

    36    # Configure the Administration Server and SSL port.

    37    #

    38    # To enable access by both local and remote processes, you should not set the

    39    # listen address for the server instance (that is, it should be left blank or not set).

    40    # In this case, the server instance will determine the address of the machine and

    41    # listen on it.

    42       #======================================================================

    43   

    44    cd('Servers/AdminServer')

    45    set('ListenAddress','')

    46    set('ListenPort', 7001)

    47   

    48    create('AdminServer','SSL')

    49    cd('SSL/AdminServer')

    50    set('Enabled', 'True')

    51    set('ListenPort', 7002)

    52   

    53       #======================================================================

    54    # Define the user password for weblogic.

    55       #======================================================================

    56   

    57    cd('/')

    58    cd('Security/base_domain/User/weblogic')

    59    # Please set password here before using this script, e.g. cmo.setPassword('value')

    60   

    61       #======================================================================

    62    # Create a JMS Server.

    63       #======================================================================

    64   

    65    cd('/')

    66    create('myJMSServer', 'JMSServer')

    67   

    68       #======================================================================

    69    # Create a JMS System resource.

    70       #======================================================================

    71   

    72    cd('/')

    73    create('myJmsSystemResource', 'JMSSystemResource')

    74    cd('JMSSystemResource/myJmsSystemResource/JmsResource/NO_NAME_0')

    75   

    76       #======================================================================

    77    # Create a JMS Queue and its subdeployment.

    78       #======================================================================

    79   

    80    myq=create('myQueue','Queue')

    81    myq.setJNDIName('jms/myqueue')

    82    myq.setSubDeploymentName('myQueueSubDeployment')

    83   

    84    cd('/')

    85    cd('JMSSystemResource/myJmsSystemResource')

    86    create('myQueueSubDeployment', 'SubDeployment')

    87   

    88       #======================================================================

    89    # Create and configure a JDBC Data Source, and sets the JDBC user.

    90       #======================================================================

    91   

    92    cd('/')

    93    create('myDataSource', 'JDBCSystemResource')

    94    cd('JDBCSystemResource/myDataSource/JdbcResource/myDataSource')

    95    create('myJdbcDriverParams','JDBCDriverParams')

    96    cd('JDBCDriverParams/NO_NAME_0')

    97    set('DriverName','org.apache.derby.jdbc.ClientDriver')

    98    set('URL','jdbc:derby://localhost:1527/db;create=true')

    99    set('PasswordEncrypted', 'PBPUBLIC')

   100    set('UseXADataSourceInterface', 'false')

   101    create('myProps','Properties')

   102    cd('Properties/NO_NAME_0')

   103    create('user', 'Property')

   104    cd('Property/user')

   105    cmo.setValue('PBPUBLIC')

   106   

   107    cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')

   108    create('myJdbcDataSourceParams','JDBCDataSourceParams')

   109    cd('JDBCDataSourceParams/NO_NAME_0')

   110    set('JNDIName', java.lang.String("myDataSource_jndi"))

   111   

   112    cd('/JDBCSystemResource/myDataSource/JdbcResource/myDataSource')

   113    create('myJdbcConnectionPoolParams','JDBCConnectionPoolParams')

   114    cd('JDBCConnectionPoolParams/NO_NAME_0')

   115    set('TestTableName','SYSTABLES')

   116   

   117       #======================================================================

   118    # Target resources to the servers.

   119       #======================================================================

   120   

   121    cd('/')

   122    assign('JMSServer', 'myJMSServer', 'Target', 'AdminServer')

   123    assign('JMSSystemResource.SubDeployment', 'myJmsSystemResource.myQueueSubDeployment', 'Target', 'myJMSServer')

   124    assign('JDBCSystemResource', 'myDataSource', 'Target', 'AdminServer')

   125   

   126       #======================================================================

   127    # Write the domain and close the domain template.

   128       #======================================================================

   129   

   130    setOption('OverwriteDomain', 'true')

   131    writeDomain('/data/weblogic/user_projects/domains/basicWLSDomain')

   132    closeTemplate()

   133   

   134       #======================================================================

   135    # Exit WLST.

   136       #=====================================================================

   137   

   138    exit()

 

修改后的建域脚本

从62(Create a JMS Server.)到127 (Write the domain and close the domain template.)所有的内容都删除。同时注意修改domain的目录(131   writeDomain的相关内容)。

 

[root@redhat6 domain120]# cat -n basicWLSDomain.py

     1    #=================================================================

     2    # This is an example of a simple WLST offline configuration script. The script creates

     3    # a simple WebLogic domain using the Basic WebLogic Server Domain template. The script

     4    # demonstrates how to open a domain template, create and edit configuration objects,

     5    # and write the domain configuration information to the specified directory.

     6    #

     7    # This sample uses the demo Derby Server that is installed with your product.

     8    # Before starting the Administration Server, you should start the demo Derby server

     9    # by issuing one of the following commands:

    10    #

    11    # Windows: WL_HOME\common\derby\bin\startNetworkServer.cmd

    12    # UNIX: WL_HOME/common/derby/bin/startNetworkServer.sh

    13    #

    14    # (WL_HOME refers to the top-level installation directory for WebLogic Server.)

    15    #

    16    # The sample consists of a single server, representing a typical development environment.

    17    # This type of configuration is not recommended for production environments.

    18    #

    19    # Please note that some of the values used in this script are subject to change based on

    20    # your WebLogic installation and the template you are using.

    21    #

    22    # Usage:

    23    #      java weblogic.WLST

    24    #

    25    # Where:

    26    #      specifies the full path to the WLST script.

    27    #===============================================================

    28   

    29    #==============================================================

    30    # Open a domain template.

    31    #================================================================

    32   

    33    readTemplate("/data/weblogic/wlserver/common/templates/wls/wls.jar")

    34   

    35    #================================================================

    36    # Configure the Administration Server and SSL port.

    37    #

    38    # To enable access by both local and remote processes, you should not set the

    39    # listen address for the server instance (that is, it should be left blank or not set).

    40    # In this case, the server instance will determine the address of the machine and

    41    # listen on it.

    42    #==================================================================

    43   

    44    cd('Servers/AdminServer')

    45    set('ListenAddress','')

    46    set('ListenPort', 7001)

    47   

    48    create('AdminServer','SSL')

    49    cd('SSL/AdminServer')

    50    set('Enabled', 'True')

    51    set('ListenPort', 7002)

    52    #set('ServerStartMode', prod)

    53    #==============================================================

    54    # Define the user password for weblogic.

    55    #==============================================================

    56   

    57    cd('/')

    58    cd('Security/base_domain/User/weblogic')

    59    cmo.setPassword('1qaz@WSX')

    60    # Please set password here before using this script, e.g. cmo.setPassword('value')

    61   

    62   

    63    setOption('OverwriteDomain', 'true')

    64    writeDomain('/data/weblogic/user_projects/domains/domain120')

    65    closeTemplate()

    66   

    67    #==============================================================

    68    # Exit WLST.

    69       #=====================================================================

    70   

71    exit()

 

解决创建域缓慢的问题

在Oracle官网中,有对域创建过程缓慢做相应的说明:

if you notice that it takes a long time to create or update a domain using WLST on a UNIX or Linux operating system, set the CONFIG_JVM_ARGS environment variable to the following value to resolve this issue:

-Djava.security.egd=file:/dev/urandom

 

[bea@redhat6 bin]$ export CONFIG_JVM_ARGS='-Djava.security.egd=file:/dev/urandom'

 

基本原理:重设了Linux系统下获取随机数的来源。

 

wlst创建域

[bea@redhat6 bin]$ ./wlst.sh /data/weblogic/user_projects/domains/domain120/basicWLSDomain.py

WARNING: This is a deprecated script. Please invoke the wlst.sh script under oracle_common/common/bin.

 

Initializing WebLogic Scripting Tool (WLST) ...

 

Welcome to WebLogic Server Administration Scripting Shell

 

Type help() for help on available commands

 

 

 

Exiting WebLogic Scripting Tool.

 

此时说明域已经创建完成。

更改域启动加载慢的问题

[bea@redhat6 bin]$ vim setDomainEnv.sh

管理控制台运行慢,在WLS_home/mydomain/bin/setDomainEnv.sh最后加:

JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.security.egd=file:/dev/./urandom"

export JAVA_OPTIONS

 

启动中间件管理服务器

由于通过wlst脚本工具创建的域,默认情况下是开发模式。因此需要在执行./startWebLogic.sh启动weblogic console之后,在控制台下将模式更改为生产模式。更改之后需要重启weblogic console才可以生效。

Weblogic 12c 软件安装及域的创建配置_第1张图片

 

方法2:图形

按照weblogic 10.3.6创建域的方式,调用config.sh脚本交互创建。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(Weblogic 12c 软件安装及域的创建配置)