【问题标题】:creating new managed server containers in Weblogic 12c docker在 Weblogic 12c docker 中创建新的托管服务器容器
【发布时间】:2018-01-10 12:01:58
【问题描述】:

我遵循 Oracle 文档并设法设置了一个运行 Weblogic Fusion Middleware Infrastructure Container 和一个托管服务器。

我部署了一个 ADF 应用程序,它运行良好..

但现在我卡住了,因为我无法在集群中添加更多托管服务器。

以下命令用于启动完美运行的 managedserver1..

docker run -d -p 9801:8001 --network=InfraNET --volumes-from InfraAdminContainer --name InfraManagedContainer --env-file ./infraServer.env.list container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.x startManagedServer.sh

这里是 startManagedServer.sh 脚本:

#!/bin/bash

# Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved.
#
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#

export adminhostname=$adminhostname
export adminport=$adminport


# First Update the server in the domain
export server="infra_server1"
export DOMAIN_ROOT="/u01/oracle/user_projects/domains"
export DOMAIN_HOME="/u01/oracle/user_projects/domains/InfraDomain"

echo $adminhostname
echo $adminport
echo "DOMAIN_HOME: $DOMAIN_HOME"

/u01/oracle/oracle_common/common/bin/wlst.sh -skipWLSModuleScanning /u01/oracle/container-scripts/update_listenaddress.py $server
retval=$?

echo  "RetVal from Update listener call  $retval"

if [ $retval -ne 0 ];
then
    echo "Update listener Failed.. Please check the  Logs"
    exit
fi

# Start Infra server
mkdir -p /u01/oracle/logs
$DOMAIN_HOME/bin/startManagedWebLogic.sh $server "http://"$adminhostname:$adminport > /u01/oracle/logs/startManagedWebLogic$$.log 2>&1 &
statusfile=/tmp/notifyfifo.$$

mkfifo "${statusfile}" || exit 1
{
    # run tail in the background so that the shell can kill tail when notified that grep has exited
    tail -f /u01/oracle/logs/startManagedWebLogic$$.log &
    # remember tail's PID
    tailpid=$!
    # wait for notification that grep has exited
    read templine <${statusfile}
                        echo ${templine}
    # grep has exited, time to go
    kill "${tailpid}"
} | {
    grep -m 1 "<Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.>"
    # notify the first pipeline stage that grep is done
        echo "RUNNING"> /u01/oracle/logs/startManagedWebLogic$$.status
        echo "Infra server is running"
    echo >${statusfile}
}

# clean up
rm "${statusfile}"
if [ -f /u01/oracle/logs/startManagedWebLogic$$.status ]; then
echo "Infra server has been started"
fi

#Display the logs
tail -f $DOMAIN_HOME/servers/infra_server1/logs/infra_server1.log

childPID=$!
wait $childPID

我确实通过编辑 createorstartInfraDomain.sh 和 createInfraDomain.py 在 weblogic 管理控制台中添加了托管服务器

但是编辑 Infra_Server2 的 StartManagedServer.sh 文件不起作用..

即使在从管理容器中编辑甚至完全删除文件 startManagedServer.sh 之后,以下命令仍然有效:

docker run -d -p 9801:8001 --network=InfraNET --volumes-from InfraAdminContainer --name InfraManagedContainer --env-file ./infraServer.env.list container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.x startManagedServer.sh

以下是我在控制台中得到的:

root@Linux-Vostro-3250:/home/amalv/FMW-Infrastructure_Docker# docker run -p 9801:8001 --network=InfraNET --volumes-from InfraAdminContainer --name InfraManagedContainer --env-file ./infraserver.env.list oracle/fmw-infrastructure:12.2.1.0 startManagedServer.shInfraAdminContainer
7001
DOMAIN_HOME: /u01/oracle/user_projects/domains/InfraDomain

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

/u01/oracle/container-scripts/update_listenaddress.py called with the following sys.argv array:
sys.argv[0] = /u01/oracle/container-scripts/update_listenaddress.py
sys.argv[1] = infra_server1
c697c81b15c8
172.18.0.4
/u01/oracle/user_projects/domains/InfraDomain
INFO: SeedingConfigurationProcessor.start, finished.
INFO: SeedingConfigurationProcessor.end, finished.

无论我对 startManagedServer.sh 做什么,我都会通过“sys.argv[1] = infra_server1”获得上述日志。

谁能帮帮我!

非常感谢

【问题讨论】:

    标签: docker weblogic12c oracle-fusion-middleware


    【解决方案1】:

    这是我所做的,帮助我设置了多个托管服务器。

    • 最初我运行了以下命令,该命令来自说明 在 container-registry.oracle.com 中:

      docker run -d -p 9001:7001 --network=InfraNET -v $HOST_VOLUME:/u01/oracle/user_projects --name InfraAdminContainer --env-file ./infraDomain.env.list container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.2
      
    • 然后我将我编辑的 Container-scripts 复制到 Container-scripts 在管理容器中。

    • 从容器中删除了已经创建的域目录。

    • 将容器提交到新图像。

    您也可以在 docker run 命令中将编辑后的文件挂载到容器中。

    我在容器脚本中编辑了 createInfraDomain.py 和 createOrStartInfradomain.sh 文件以创建 6 个基础架构服务器。这将创建 6 个基础架构服务器实例,您将能够在 weblogic 控制台中看到它。

    现在使用以下命令启动第一个托管服务器容器:

    docker run -d -p 9802:8001 --network=InfraNET --volumes-from InfraAdminContainer --name InfraManagedContainer --env-file ./infraserver.env.list previous-committed-image startManagedServer.sh

    为了启动一个新的托管服务器容器,我编辑了 startManagedServer.sh 文件并将服务器值更改为 infra_server2 并运行以下命令:

    docker run -d -p 9802:8001 -v /path(or)location/of/edited/cotainer-scripts/in/your/hostSystem:/u01/oracle/container-scripts --network=InfraNET --volumes-from InfraAdminContainer --name InfraManagedContainer --env-file ./infraserver.env.list previously-committed-image startManagedServer.sh
    

    对于每个新容器,我在 startNodeManager.sh 中更改了服务器名称,并在 docker run 命令中将其挂载到容器中。

    我确信有一种更简单的方法来添加更多服务器,可能是使用 WLST 脚本在 weblogic 中添加服务器实例。 并启动新的托管服务器容器..

    如果有人知道,请告诉我们。

    谢谢!!

    【讨论】:

      猜你喜欢
      • 2016-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-01
      • 1970-01-01
      • 2021-02-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多