zoukankan      html  css  js  c++  java
  • weblogic 12c安装

     安装最新的weblogic版本,版本号为 12.1.X(12.1.2,12.1.3)。开始以为和旧版安装一样,使用控制台的方式,下载bin文件,然后一步步在console执行下来就行了。万万没想到,从12C版本后,bin文件不提供了,改成全系统通用的jar文件 (generic.jar)。试了半天原来那种安装方式不能用了,非得用图形界面安装。由于服务器只能远程登录,于是各种百度、各种找材料,最后终于找到一种静默方式的安装。请看下文。

    修改 打开文件最大个数、最大进程数【root用户操作】

    ## 新session永久生效,需要打开新终端(hard的值不能小于soft的值)
    [root@node2 ~]$ vi /etc/security/limits.conf * soft nofile 65535 * hard nofile 65535 weblogic soft nproc 65535 weblogic hard nproc 65535 ## 临时设置 (1)硬限制 [root@db ~]# ulimit -Hn 102400 (2)软限制 [root@db ~]# ulimit -Sn 102400 [root@db ~]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 15021 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 102400 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 15021 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited

    创建weblogic用户、上传软件包

    [root@db ~]# useradd weblogic
    [root@db ~]# echo 123456|passwd --stdin weblogic
    
    [root@db ~]# su - weblogic
    
    [weblogic@db ~]$ mkdir softwares
    
    $ ll /home/app/weblogic/softwares/
    total 846428
    -r-xr-xr-x. 1 weblogic weblogic 866733871 Sep 13  2019 fmw_12.2.1.4.0_wls.jar
    drwxr-xr-x. 7 weblogic weblogic       245 Oct  6  2018 jdk1.8.0_191
    -rw-rw-r--. 1 weblogic weblogic        67 Jun  1 04:35 oraInst.loc
    -rw-rw-r--. 1 weblogic weblogic      1278 Jun  1 04:33 wls.rsp

    配置jdk

    [weblogic@localhost ~]$ vim ~/.bash_profile 
    
    export JAVA_HOME=/home/app/weblogic/jdk1.8.0_191
    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/jre/lib 
    export PATH
    =$PATH:$JAVA_HOME/bin

    Slient Mode静默方式

    首先看命令的格式:

    java -jar wls_121200.jar -silent -responseFile  file -invPtrLoc file


    -response file:响应文件

    -invPtrLoc file:初始化环境文件

    1、创建响应文件 wls.rsp  [响应文件中的项一定要写全,否则会报参数不足等错误]

    [weblogic@localhost ~]$ cat 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/app/weblogic/Oracle
    
    #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

    [weblogic@localhost ~]$ cat oraInst.loc 
    inventory_loc=/home/app/weblogic/oraInventory
    
    inst_group=weblogic

    需要确保wls.rsp文件中ORACLE_HOME定义的目录对weblogic用户有写入权限

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

    安装

    $ java -d64 -jar fmw_12.2.1.4.0_wls.jar -ignoreSysPrereqs -silent  -responseFile  /home/weblogic/wls.rsp  -invPtrLoc /home/weblogic/oraInst.loc

    安装会做如下检查

    Checking if CPU speed is above 300 MHz.   Actual 3599.704 MHz    Passed            ## 检测CPU频率
    Checking swap space: must be greater than 512 MB.   Actual 2047 MB    Passed       ## 检测swap分区大小
    Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)          ## 检测操作系统是否64位
    Checking temp space: must be greater than 300 MB.   Actual 7101 MB    Passed         ## 检测临时磁盘剩余空间大小

    安装成功会提示如下信息

    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.4.0 completed successfully.
    Logs successfully copied to /home/app/weblogic/oraInventory/logs.

    创建domain

    方法1:通过命令行创建

    [weblogic@mysql bin]$ ./wlst.sh
    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

    wls:/offline> readTemplate('/home/app/weblogic/Oracle/wlserver/common/templates/wls/wls.jar')
    WARNING: The readTemplate is deprecated. Use selectTemplate followed by loadTemplates in place of readTemplate.
    Error: readTemplate() failed. Do dumpStack() to see details.
    Error: No domain or domain template has been read.
    wls:/offline>readTemplate('/home/weblogic/Oracle/wlserver/common/templates/wls/wls.jar')
    WARNING: The readTemplate is deprecated. Use selectTemplate followed by loadTemplates in place of readTemplate.
    wls:/offline/base_domain>setOption('DomainName','mydomain')
    wls:/offline/base_domain>setOption('JavaHome','/home/weblogic/jdk1.8.0_201')
    wls:/offline/base_domain>setOption('ServerStartMode','prod')
    wls:/offline/base_domain>cd('Security/base_domain/User/weblogic')
    wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setName('weblogic')
    wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setPassword('weblogic123')
    wls:/offline/base_domain/Security/base_domain/User/weblogic>cd('/')
    wls:/offline/base_domain>cmo.setConsoleContextPath('console')
    wls:/offline/base_domain>cd('Security/base_domain/User')
    wls:/offline/base_domain/Security/base_domain/User>create('wlsview','User')
    Proxy for User: Name=wlsview Type=User
    wls:/offline/base_domain/Security/base_domain/User>cd('wlsview')
    wls:/offline/base_domain/Security/base_domain/User/wlsview>cmo.setUserPassword('welcome1')
    wls:/offline/base_domain/Security/base_domain/User/wlsview>cmo.setGroupMemberOf('Monitors')
    wls:/offline/base_domain/Security/base_domain/User/wlsview>cd('/')
    wls:/offline/base_domain>cd('/Servers/AdminServer')
    wls:/offline/base_domain/Server/AdminServer>cmo.setName('AdminServer')

    wls:/offline/base_domain/Server/AdminServer>cmo.setListenPort(7001)
    wls:/offline/base_domain/Server/AdminServer>cmo.setListenAddress('10.0.0.20')

    wls:/offline/base_domain/Server/AdminServer>cmo.setListenPortEnabled(true)
    wls:/offline/base_domain/Server/AdminServer>cmo.setAcceptBacklog(500)
    wls:/offline/base_domain/Server/AdminServer>cmo.setGracefulShutdownTimeout(10)
    wls:/offline/base_domain/Server/AdminServer>writeDomain('/home/weblogic/domains/12214/mydomain')
    wls:/offline/mydomain/Server/AdminServer>closeTemplate()
    wls:/offline>readDomain('/home/weblogic/domains/12214/mydomain')
    wls:/offline/mydomain>exit()

    安装后的目录结构

    [weblogic@localhost Oracle]$ tree -L 1 ./
    ./
    ├── coherence            ##coherence组件目录,coherence是实现高可靠和高扩展集群计算的组件,能实现多个集群共享数据
    ├── domain-registry.xml 
    ├── inventory ## Oracle安装的相关文件,安装和省级需要使用这个目录
    ├── my_projects ## 该目录是域(domains)的父目录,是应用开发和服务器维护人员最有可能触碰的目录。使用图形界面或是命令行创建域之后,会在domains目录下建立域域名同名的目录。默认的域的名字是base_domain。也可以自定义域名
    ├── OPatch ## 打补丁的目录。OPatch是Oracle的补丁工具。Weblogic 12C之后就开始使用OPatch打补丁(之前是bsu)
    ├── oracle_common ## 放置公共的jar文件和命令工具
    ├── oraInst.loc
    ├── oui ## Oracle Universal Installer简写,图形安装界面
    ├── root.
    sh
    └── wlserver ## Weblogic Server简写,是服务器的主要目录,包含服务器的可执行文件、设置环境变量(setWLSEnv.cmd)以及启动节点管理器等批处理文件。该目录下的批处理文件不会直接运行,而是通过域目录批处理调用。

    域目录结构

    [weblogic@localhost Oracle]$ tree my_projects/ -L 2
    my_projects/                       
    └── domains               ## 域的根目录,多个域对应多个目录。以域名为base_domain为例,
        └── base_domain
    以域名为base_domain为例,介绍主要目录
    autodeploy:自动部署目录。将应用程序放入此目录会自动部署
    
    bin:包含启动和关闭服务器(startWebLogic.sh/stopWebLogic.sh)、节点管理器(startNodeManager.sh/stopNodeManager.sh)等批处理脚本目录。
    
    servers:管理服务器、受管服务器以及代理服务器的文件目录。应用程序一般部署在收官服务器中。该目录的子目录:
    AdminServer:管理服务器的目录

    方法2:通过参数文件执行安装

    创建create_domains.py,添加如下内容:

    $ vim create_domains.py
    readTemplate('/home/app/weblogic/bea/wlserver/common/templates/wls/wls.jar')
    cd('Servers/AdminServer')
    set('ListenAddress','ip地址')
    set('ListenPort', 7001)
    cd('/Security/base_domain/User/weblogic')
    cmo.setPassword('weblogic123')
    setOption('OverwriteDomain', 'true')
    setOption('ServerStartMode', 'prod')
    writeDomain('/home/app/weblogic/domains/dai')
    
    
    closeTemplate()
    exit()

    执行安装

    $  ./wlst.sh  ./create_domains.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.
    [weblogic@localhost bin]$ ll
    /home/app/weblogic/domains/dai/ total 16 drwxr-x---. 2 weblogic weblogic 24 Jun 1 04:58 autodeploy drwxr-x---. 6 weblogic weblogic 4096 Jun 1 04:58 bin drwxr-x---. 3 weblogic weblogic 16 Jun 1 04:58 common drwxr-x---. 8 weblogic weblogic 124 Jun 1 04:58 config drwxr-x---. 2 weblogic weblogic 24 Jun 1 04:58 console-ext -rw-r-----. 1 weblogic weblogic 327 Apr 26 2019 fileRealm.properties drwxr-x---. 3 weblogic weblogic 4096 Jun 1 04:58 init-info drwxr-x---. 2 weblogic weblogic 24 Jun 1 04:58 lib drwxr-x---. 2 weblogic weblogic 63 Jun 1 04:58 nodemanager drwxr-x---. 2 weblogic weblogic 6 Apr 26 2019 resources drwxr-x---. 2 weblogic weblogic 167 Jun 1 04:58 security -rwxr-x---. 1 weblogic weblogic 246 Jun 1 04:58 startWebLogic.sh

     启动weblogic

    部署完WEBLOGIC后,在每次启动时执行./startWebLogic.sh脚本时,都会停在输入用户名与密码这里,相当不方便。

    创建boot.properties

    [weblogic@mysql AdminServer]$ pwd
    /home/weblogic/domains/12214/mydomain/servers/AdminServer
    
    [weblogic@mysql AdminServer]$ mkdir security
    
    [weblogic@mysql AdminServer]$ cd security/
    
    [weblogic@mysql security]$ vim boot.properties
    username=weblogic
    
    password=weblogic123

    启动

    [weblogic@mysql bin]$ nohup ./startWebLogic.sh &
    [3] 5869
    
    [weblogic@mysql bin]$ ss -lntp
    State      Recv-Q Send-Q            Local Address:Port                           Peer Address:Port              
    LISTEN     0      100                   127.0.0.1:25                                        *:*                  
    LISTEN     0      128                           *:22                                        *:*                  
    LISTEN     0      50             ::ffff:127.0.0.1:1527                                     :::*                   users:(("java",pid=5919,fd=33))
    LISTEN     0      500            ::ffff:10.0.0.20:7001                                     :::*                   users:(("java",pid=5920,fd=787))
    LISTEN     0      100                         ::1:25                                       :::*                  
    LISTEN     0      128                          :::22                                       :::*   

    修改密码

    [weblogic@mysql security]$ java -cp /home/weblogic/Oracle/wlserver/server/lib/weblogic.jar weblogic.security.utils.AdminAccount weblogic weblogic110 .
    
    [weblogic@mysql security]$ cd ../servers/AdminServer/data/
    
    [weblogic@mysql ldap]$ rm -f DefaultAuthenticatormyrealmInit.initialized
    
    [weblogic@mysql mydomain]$ vim servers/AdminServer/security/boot.properties
    username=weblogic
    
    password=weblogic110
    
    [weblogic@mysql mydomain]$ nohup ./startWebLogic.sh &

     解决Weblogic Server启动后首次访问控制台过于缓慢的问题。

    [weblogic@mysql mydomain]$ vim bin/startWebLogic.sh 
    
    # Call setDomainEnv here.
    
    DOMAIN_HOME="/home/weblogic/domains/12214/mydomain"
    
    JAVA_OPTIONS="${JAVA_OPTIONS} -Djava.security.egd=file:/dev/urandom"
    
    . ${DOMAIN_HOME}/bin/setDomainEnv.sh $*
    
    SAVE_JAVA_OPTIONS="${JAVA_OPTIONS}"

    原文链接:https://www.cnblogs.com/fibonaccixue/p/6577377.html

  • 相关阅读:
    使用 Visual Studio 2022 开发 Linux C++ 应用程序
    CSDN博客 新版主页与旧版主页切换
    C++ 静态局部变量 全局变量
    静态构造函数
    使用jquery的ajax功能post数据
    图片的禁止缓存与预缓存
    cookie
    asp.net中使用excel类导出Excel文件,并导出到web客户端中遇到的问题
    xmlHttpRequest对象的使用
    html静态文件提交到aspx页面处理
  • 原文地址:https://www.cnblogs.com/zh-dream/p/14838048.html
Copyright © 2011-2022 走看看