在容器中安装weblogic 12.2.1.3.0的过程

  • 在容器中安装weblogic 12.2.1.3.0的过程
  1. 前提:已经安装好docker环境
  2. 准备weblogic安装包:https://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html在容器中安装weblogic 12.2.1.3.0的过程_第1张图片
  3. 准备JDK1.8: java 1.8 linux 64位版本
  4. 拉取centos最新镜像:[root@yxbj ~]# docker pull centos

    [root@yxbj ~]# docker images

    centos                                                           latest              1e1148e4cc2c        9 days ago          202MB

  5. 启动镜像

    [root@yxbj ~]# docker run -tid 1e1148e4cc2c /bin/bash

  6. 进入容器

    [root@yxbj ~]# docker exec -ti 4e488d0bc30e /bin/bash

  7. 创建weblogic组

    [root@yxbj ~]# groupadd weblogic

  8. 创建weblogic用户

    [root@yxbj ~]# useradd -g weblogic weblogic

  9. 为用户创建密码

    [root@yxbj ~]# passwd weblogic

  10. 切换回宿主机

    [root@5f07b8e08dfc /]# exit

  11. 拷贝weblogic安装包、JDK到/home/weblogic下

    [root@yxbj weblogic]# docker cp fmw_12.2.1.3.0_wls_quick.jar  4e488d0bc30e:/home/weblogic/

    [root@yxbj weblogic]# docker cp jdk-8u11-linux-x64.tar.gz  4e488d0bc30e:/home/weblogic/

  12. 再次进入容器

    [root@yxbj ~]# docker exec -ti 4e488d0bc30e /bin/bash

  13. 修改文件的权限

    [root@yxbj ~]# chown -R weblogic:weblogic /home/weblogic/

  14. 切换到weblogic用户

    [root@yxbj weblogic]# su - weblogic

  15. 解压JDK

    [weblogic@4e488d0bc30e ~]$ tar xvfz jdk-8u11-linux-x64.tar.gz

  16. 在weblogic用户的.bash_profile文件中新增配置项

    export JAVA_HOME=/home/weblogic/jdk1.8.0_11

    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

    export PATH=$PATH:$JAVA_HOME/bin

  17. 配置文件重新生效

    [weblogic@yxbj ~]$ source .bash_profile

  18. 在/home/weblogic目录下文件wsl.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/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=
    
    #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=
    
    #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=
    
  19. 在/home/weblogic目录下文件oraInst.loc
    inventory_loc=/home/weblogic/oraInventory
    
    inst_group=weblogic
    
  20. 执行安装操作

    [weblogic@yxbj ~]$ java -jar fmw_12.2.1.3.0_wls_quick.jar

    Launcher log file is /tmp/OraInstall2018-12-15_02-15-57PM/launcher2018-12-15_02-15-57PM.log.

    Extracting the installer . . . . Done

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

    Checking swap space: must be greater than 512 MB.   Actual 4095 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 3195 MB    Passed

    Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2018-12-15_02-15-57PM

    Log: /tmp/OraInstall2018-12-15_02-15-57PM/install2018-12-15_02-15-57PM.log

    *****************************************************

    Distribution Name : Oracle Fusion Middleware 12c WebLogic and Coherence Developer

    Distribution Version : 12.2.1.3.0

    Oracle Inventory : /home/weblogic/oraInventory

    Oracle Home : /home/weblogic/wls12213

    Java Home : /usr/java/jdk1.8.0_11

    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

  21. 安装存放的路径为:

    [weblogic@yxbj ~]$ cd wls12213/

    [weblogic@yxbj wls12213]$ pwd

    /home/weblogic/wls12213

    [weblogic@yxbj wls12213]$ ll

    total 20

    drwxr-x---.  4 weblogic weblogic   33 Dec 15 14:19 cfgtoollogs

    drwxr-x---.  5 weblogic weblogic   58 Dec 15 14:17 coherence

    drwxr-x---. 19 weblogic weblogic 4096 Dec 15 14:19 inventory

    drwxr-x---. 11 weblogic weblogic 4096 Dec 15 14:18 OPatch

    drwxr-x---.  9 weblogic weblogic   96 Dec 15 14:17 oracle_common

    -rw-r-----.  1 weblogic weblogic  133 Dec 15 14:19 oraInst.loc

    drwxr-x---.  8 weblogic weblogic 4096 Dec 15 14:19 oui

    -rwx------.  1 weblogic weblogic   10 Dec 15 14:16 root.sh

    drwxr-x---.  7 weblogic weblogic   76 Dec 15 14:17 wlserver

  22. 新建域的目录

    [weblogic@yxbj ~]$ mkdir -p /home/weblogic/wls12213/user_projects/domains/base_domain/

  23. 在home/weblogic创建域脚本create_domain.rsp
    read template from "/home/weblogic/wls12213/wlserver/common/templates/wls/wls.jar";
     
    set JavaHome "/usr/java/jdk1.8.0_11";
    set ServerStartMode "prod";
     
    find Server "AdminServer" as AdminServer;
    set AdminServer.ListenAddress "";
    set AdminServer.ListenPort "7001";
    set AdminServer.SSL.Enabled "true";
    set AdminServer.SSL.ListenPort "7002";
     
    //Create Machine
    //create Machine "base" as Machinename;
     
    //use templates default weblogic user
    find User "weblogic" as u1;
    set u1.password "weblogic";
     
    write domain to "/home/weblogic/wls12213/user_projects/domains/base_domain/";
     
    // The domain name will be "demo-domain"
     
    close template;
    

     

  24. 切换到/home/weblogic/wls12213/wlserver/common/bin目录下

    [weblogic@yxbj bin]$ cd /home/weblogic/wls12213/wlserver/common/bin

    [weblogic@yxbj bin]$ pwd

    /home/weblogic/wls12213/wlserver/common/bin

    [weblogic@yxbj bin]$ ll

    total 68

    -rwxr-x---. 1 weblogic weblogic   583 Aug 10  2017 config.sh

    -rwxr-x---. 1 weblogic weblogic   578 Aug 10  2017 pack.sh

    -rwxr-x---. 1 weblogic weblogic   582 Aug 10  2017 unpack.sh

    -rwxr-x---. 1 weblogic weblogic 35171 Aug 21  2017 wlscontrol.sh

    -rwxr-x---. 1 weblogic weblogic 16286 Aug 21  2017 wlsifconfig.sh

    -rwxr-x---. 1 weblogic weblogic   807 Aug 10  2017 wlst.sh

  25. 执行创建域脚本

    [weblogic@yxbj bin]$ ./config.sh -mode=silent -silent_script=/home/weblogic/create_domain.rsp -logfile=/home/weblogic/create_domain.log

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

    << read template from "/home/weblogic/wls12213/wlserver/common/templates/wls/wls.jar"

    >>  succeed: read template from "/home/weblogic/wls12213/wlserver/common/templates/wls/wls.jar"

    << set config option JavaHome to "/usr/java/jdk1.8.0_11"

    >>  succeed: set config option JavaHome to "/usr/java/jdk1.8.0_11"

    << set config option ServerStartMode to "prod"

    >>  succeed: set config option ServerStartMode to "prod"

    << find Server "AdminServer" as AdminServer

    >>  succeed: find Server "AdminServer" as AdminServer

    << set AdminServer attribute ListenAddress to ""

    >>  succeed: set AdminServer attribute ListenAddress to ""

    << set AdminServer attribute ListenPort to "7010"

    >>  succeed: set AdminServer attribute ListenPort to "7010"

    << set AdminServer attribute SSL!Enabled to "true"

    >>  succeed: set AdminServer attribute SSL!Enabled to "true"

    << set AdminServer attribute SSL!ListenPort to "7002"

    >>  succeed: set AdminServer attribute SSL!ListenPort to "7002"

    << find User "weblogic" as u1

    >>  succeed: find User "weblogic" as u1

    << set u1 attribute Password to "********"

    >>  succeed: set u1 attribute Password to "********"

    << write Domain to "/home/weblogic/wls12213/user_projects/domains/base_domain/"

    ..................................................

    >>  succeed: write Domain to "/home/weblogic/wls12213/user_projects/domains/base_domain/"

    << close template

    >>  succeed: close template

  26. 切换到安全目录下新装控制台用户名和密码

    [root@yxbj security]# cd /home/weblogic/wls12213/user_projects/domains/base_domain/servers/AdminServer/

    [root@yxbj AdminServer]# mkdir security

    [root@yxbj AdminServer]# cd security/

    [root@yxbj security]# vi boot.properties

    username=weblogic

    password=weblogic

  27. 切换到域目录

    [weblogic@yxbj bin]$ cd /home/weblogic/wls12213/user_projects/domains/base_domain/

  28. 启动脚本,进入控制台

    [weblogic@yxbj base_domain]$ ./startWebLogic.sh

  29. 在浏览器输入URL地址  http://192.168.XXX.XXX:7001/console/ ,输入在boot.properties文件中配置用户名和密码接口
    1. 在容器中安装weblogic 12.2.1.3.0的过程_第2张图片
    2. 在容器中安装weblogic 12.2.1.3.0的过程_第3张图片
  30. 切换回root用户

    [weblogic@yxbj bin]$ exit

  31. 在root目录下新建run.sh文件作为启动脚本

    #!/bin/bash

    export JAVA_HOME=/home/weblogic/jdk1.8.0_11

    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

    export PATH=$JAVA_HOME/bin:$PATH

    nohup  /home/weblogic/wls12213/user_projects/domains/base_domain/startWebLogic.s

    h > a.log&

  32. 修改权限

    [root@5f07b8e08dfc /]# chmod 777 run.sh

  33. 停止容器

    [root@yxbj security]# docker stop 4e488d0bc30e

  34. 打包容器为镜像

    [root@yxbj security]# docker commit 4e488d0bc30e commcon_weblogic12.2.1.3_jdk1.8:1.0

测试新的镜像

  1. 方式一:控制台默认端口号 7001 :[root@yxbj ~]# docker run -tid -p 9701:7001 common_weblogic12.2.1.3_jdk1.8:1.0   http://192.168.XXX.XXX:9701/console/
  2. 方式一:控制台默认端口号 9002 :[root@yxbj ~]# docker run -tid -p 9701:7001 -p 9702:9002 common_weblogic12.2.1.3_jdk1.8:1.0   https://192.168.XXX.XXX:9702/console/,修改方式:在容器中安装weblogic 12.2.1.3.0的过程_第4张图片,最后再修改域下面的startManagerWeblogic.sh stopManagerWeblogic.sh

 

在容器中安装weblogic 12.2.1.3.0的过程_第5张图片用户名和密码:weblogic/weblogic

 

  • 打折课程大放送
  1. 【图解+笔记】Python从入门到进阶大合集详细讲解(含500条笔记):http://edu.51cto.com/sd/99cf7
  2. 【笔记式】Python基础入门--八大数据结构篇(含200条笔记):http://edu.51cto.com/sd/f967d
  3. 【笔记式】Python基础入门--语句函数篇(含150条笔记):http://edu.51cto.com/sd/eea85
  4. 【图解+笔记】Python进阶-模块、包、面向对象篇(含200条笔记):http://edu.51cto.com/sd/43049
  5. 【笔记式】Maven从入门到进阶大合集详细讲解(含200条笔记):http://edu.51cto.com/sd/09299
  6. 【笔记式】Maven基础入门--坐标仓库私服(含100条笔记):http://edu.51cto.com/sd/e1387
  7. 【笔记式】Maven高级进阶--插件测试属性配置(含100条笔记):http://edu.51cto.com/sd/f3fda

你可能感兴趣的:(docker容器,Linux命令)