【问题标题】:Script to start Weblogic servers and Managed servers用于启动 Weblogic 服务器和托管服务器的脚本
【发布时间】:2017-06-14 17:05:06
【问题描述】:

有人可以帮我编写脚本以在 weblogic 中执行以下步骤。

1.停止托管服务器 2.停止节点管理器 3.停止管理服务器 4.删除tmp,cache文件夹。

【问题讨论】:

    标签: weblogic weblogic12c


    【解决方案1】:

    您提到的步骤可以使用 WLST 和节点管理器完成。但是,您需要进行以下调整:

    • 配置节点管理器/WebLogic 域以在访问/启动节点管理器时停止使用演示 SSL 证书。

      • 配置节点管理器

        • 编辑nodemanager.properties 并设置以下内容:
          • SecureListenerfalse
          • QuitEnabledtrue
        • 重启节点管理器
      • 配置 WebLogic 域

        • 登录到 WebLogic 域
        • 环境下,机器:单击配置的机器名称
        • 配置下,节点管理器:设置TypePlain并保存
        • 重启 WebLogic 域(管理服务器 + 托管服务器)
      • 配置 WebLogic 域的节点管理器凭据。默认值通常是您在创建 WebLogic 域时输入的用户名/密码。但是,为节点管理器设置不同的凭据也是一个好主意。这完全是可选的,尤其是在开发环境中工作时。

        • 登录到 WebLogic 域
        • 域结构下,单击 Weblogic 域名
        • 安全下,常规:点击高级
        • 设置NodeManager UsernameNodeManager Password/Confirm NodeManager Password并点击保存
          • 对于这个答案,我将使用nodemanager/nodemanager_pwd 作为样本值。

    假设您在同一台机器上拥有一台管理服务器和一台托管服务器,请在 Python 脚本中编写以下命令:

    # Connect to the Node Manager running on localhost with port 5556.
    # Change the DOMAIN_NAME and the DOMAIN_HOME as appropriate
    nmConnect('nodemanager','nodemanager_pwd','localhost','5556','DOMAIN_NAME','DOMAIN_HOME','PLAIN')
    
    # Start the Admin Server. 
    # The following command assumes that the 
    # name of the Admin Server is AdminServer
    nmServerStart('AdminServer')
    
    # Start the Managed Server. Again, change the Managed Server name as appropriate
    nmServerStart('Managed_Server_01')
    

    要停止受管服务器和管理服务器,它与顺序相反,现在您需要使用nmKill 命令。如果QuitEnabled 属性在nodemanager.properties 文件中设置为true,则stopNodeManager() 是可能的。

    nmConnect('nodemanager','nodemanager_pwd','localhost','5556','DOMAIN_NAME','DOMAIN_HOME','PLAIN')
    nmKill('Managed_Server_01')
    nmKill('AdminServer')
    stopNodeManager()
    

    在调用包含上述命令的 Python 脚本时,执行以下命令:

    $MW_HOME/oracle_common/common/bin/wlst.sh startup.py
    $MW_HOME/oracle_common/common/bin/wlst.sh shutdown.py
    

    至于清除 tmp/cache 文件夹,这些都可以通过 shell 脚本完成(假设你在 Linux 上运行)

    【讨论】:

    • 感谢您的回复...但是如果我想将脚本用于“SecureListener to false”。那我该怎么办?
    • 以上是SecureListener设置为false的情况。如果您的意思是说您的SecureListener 设置为true,那么只需使用 SSL 而不是 Plain。这适用于nmConnect() 和机器配置。再说一次,如果您只是使用演示 WebLogic SSL 证书而不是您自己的证书,那么使用 Plain 而不是 SSL 可能会更好。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-10
    • 1970-01-01
    相关资源
    最近更新 更多