【发布时间】:2017-06-14 17:05:06
【问题描述】:
有人可以帮我编写脚本以在 weblogic 中执行以下步骤。
1.停止托管服务器 2.停止节点管理器 3.停止管理服务器 4.删除tmp,cache文件夹。
【问题讨论】:
标签: weblogic weblogic12c
有人可以帮我编写脚本以在 weblogic 中执行以下步骤。
1.停止托管服务器 2.停止节点管理器 3.停止管理服务器 4.删除tmp,cache文件夹。
【问题讨论】:
标签: weblogic weblogic12c
您提到的步骤可以使用 WLST 和节点管理器完成。但是,您需要进行以下调整:
配置节点管理器/WebLogic 域以在访问/启动节点管理器时停止使用演示 SSL 证书。
配置节点管理器
- 编辑
nodemanager.properties并设置以下内容:
SecureListener到falseQuitEnabled到true- 重启节点管理器
配置 WebLogic 域
- 登录到 WebLogic 域
- 在环境下,机器:单击配置的机器名称
- 在配置下,节点管理器:设置Type为
Plain并保存- 重启 WebLogic 域(管理服务器 + 托管服务器)
配置 WebLogic 域的节点管理器凭据。默认值通常是您在创建 WebLogic 域时输入的用户名/密码。但是,为节点管理器设置不同的凭据也是一个好主意。这完全是可选的,尤其是在开发环境中工作时。
- 登录到 WebLogic 域
- 在域结构下,单击 Weblogic 域名
- 在安全下,常规:点击高级
- 设置
NodeManager Username和NodeManager 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设置为false的情况。如果您的意思是说您的SecureListener 设置为true,那么只需使用 SSL 而不是 Plain。这适用于nmConnect() 和机器配置。再说一次,如果您只是使用演示 WebLogic SSL 证书而不是您自己的证书,那么使用 Plain 而不是 SSL 可能会更好。