03-14_WLST配置现有的Domain
本文重点:
- WLST在线模式配置现有的domains。
- WLST离线模式配置现有的domains。
1、WLST在线模式配置现有的domains
由于和一个活动的domain进行交互,所有的在线更改必须由weblogic变更管理的进程来做控制。
例1:wlst脚本创建一个受管服务器
|
connect("username", "password", "0.0.0.0:port) # 连接一个运行中的实例 edit() # 进入可更改的树 startEdit() # 开启一个start session,获取一个配置锁 svr = cmo.createServer("managedServer") # 创建一个受管服务器 svr.setListenPort(8001) # 设置受管服务器端口 svr.setListenAddress("my-address") # 设置监听地址 save() # 保存更改,类似控制台中点击保存按钮 activate(block="true") # 激活所有更改,类似控制台中应用更改按钮,block参数代表是否等待activate操作完成才进入下一步操作,true代表等待。 # get the server mbean to target it tBean = getMBean("Servers/managedServer") # 判断是否创建成功 if tBean != None: print "Found our target" disconnect() # 断开连接 exit() # 退出脚本 |
例2:修改至生产模式
|
wls:/offline> connect('weblogic', '!QAZ2wsx', '127.0.0.1:7001') Connecting to t3://127.0.0.1:7001 with userid weblogic ... Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domains'. Warning: An insecure protocol was used to connect to the server. To ensure on-the-wire security, the SSL port or Admin port should be used instead. wls:/base_domains/serverConfig> edit() Location changed to edit tree. This is a writable tree with DomainMBean as the root. To make changes you will need to start an edit session via startEdit(). For more help, use help(edit) wls:/base_domains/edit> startEdit() Starting an edit session ... Started edit session, please be sure to save and activate your changes once you are done. wls:/base_domains/edit !> cmo.setProductionModeEnabled(false) wls:/base_domains/edit !> activate() Activating all your changes, this may take a while ... The edit lock associated with this edit session is released once the activation is completed. The following non-dynamic attribute(s) have been changed on MBeans that require server re-start: MBean Changed : com.bea:Name=AdminServer,Type=WebServerLog,Server=AdminServer,WebServer=AdminServer Attributes changed : RotateLogOnStartup MBean Changed : com.bea:Name=Server-0,Type=WebServerLog,Server=Server-0,WebServer=Server-0 Attributes changed : RotateLogOnStartup MBean Changed : com.bea:Name=AdminServer,Type=Log,Server=AdminServer Attributes changed : RotateLogOnStartup MBean Changed : com.bea:Name=AdminServer,Type=DataSourceLogFile,DataSource=AdminServer,Server=AdminServer Attributes changed : RotateLogOnStartup MBean Changed : com.bea:Name=base_domains,Type=Log Attributes changed : RotateLogOnStartup MBean Changed : com.bea:Name=base_domains,Type=Domain Attributes changed : ProductionModeEnabled MBean Changed : com.bea:Name=Server-0,Type=Log,Server=Server-0 Attributes changed : RotateLogOnStartup MBean Changed : com.bea:Name=Server-0,Type=DataSourceLogFile,DataSource=Server-0,Server=Server-0 Attributes changed : RotateLogOnStartup Activation completed wls:/base_domains/edit> exit() Exiting WebLogic Scripting Tool. |
例3:跟踪配置更改
|
wls:/offline> connect('weblogic', '!QAZ2wsx', '127.0.0.1:7001') Connecting to t3://127.0.0.1:7001 with userid weblogic ... Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domains'. Warning: An insecure protocol was used to connect to the server. To ensure on-the-wire security, the SSL port or Admin port should be used instead. wls:/base_domains/serverConfig> edit() Location changed to edit tree. This is a writable tree with DomainMBean as the root. To make changes you will need to start an edit session via startEdit(). For more help, use help(edit) wls:/base_domains/edit> startEdit() Starting an edit session ... Started edit session, please be sure to save and activate your changes once you are done. wls:/base_domains/edit !> cmo.createServer('managed2') [MBeanServerInvocationHandler]com.bea:Name=managed2,Type=Server wls:/base_domains/edit !> cd('Servers/managed2') wls:/base_domains/edit/Servers/managed2 !> cmo.setListenPort(7702) wls:/base_domains/edit/Servers/managed2 !> showChanges() All changes that are made but not yet activated are: MBean Changed : com.bea:Name=base_domains,Type=Domain Operation Invoked : create Attribute Modified : Servers Attributes Old Value : null Attributes New Value : managed2 Server Restart Required : false MBean Changed : com.bea:Name=managed2,Type=Server Operation Invoked : modify Attribute Modified : ListenPort Attributes Old Value : null Attributes New Value : 7702 Server Restart Required : false wls:/base_domains/edit/Servers/managed2 !> save() Saving all your changes ... Saved all your changes successfully. wls:/base_domains/edit/Servers/managed2 !> activate() Activating all your changes, this may take a while ... The edit lock associated with this edit session is released once the activation is completed. Activation completed |
例4:另两个重要的命令undo和cancelEdit
undo:可以反转没有保存或者没有激活的更改。
cancelEdit:直接退出edit(),会反转没有保存或者没有激活的更改,还会释放编辑锁。
更多的属性操作和更改:
上一节中描述的标准change-management命令是用于调用configurationManagerMBean中操作的便捷命令。 除了这些操作之外,configurationManagerMBean还包含描述编辑会话的属性和操作。
有关详细信息,请参阅Oracle WebLogic Server MBean Reference中的"configurationManagerMBean"。
要访问此MBean,请使用WLST getConfigManager命令。
示例中的WLST联机脚本以管理员身份将WLST连接到服务器实例,检查进行更改的当前编辑器是否是特定的运算符,然后取消配置编辑。 该脚本还会清除所有已完成的激活任务。

- WLST离线模式配置现有的domains(本文略,详见:03-07_创建域自定义模版)


03-14_WLST配置现有的Domain的更多相关文章
- 【CAS单点登录视频教程】 第03集 -- 配置 tomcat的 ssl
目录 ----------------------------------------- [CAS单点登录视频教程] 第06集[完] -- Cas认证 学习 票据认证FormsAuthenticati ...
- [原创]OpenEuler20.03安装配置PostgreSQL13.4详细图文版
OpenEuler安装配置PostgreSQL 编写时间:2021年9月18日 作者:liupp 邮箱:liupp@88.com 序号 更新内容 更新日期 更新人 1 完成第一至三章内容编辑: 202 ...
- hadoop生态搭建(3节点)-03.zookeeper配置
# https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html # ===== ...
- jenkins学习 03 jenkins配置Maven项目
我们的产品使用Git作为版本管理工具,而jenkins需要git插件来支持git,所以我们需要为jenkins添加git插件. 在Available tab页中找到Git Plugin 点击下方的In ...
- Spring4学习回顾之路03—XML配置Bean ,依赖注入的方式
配置Bean的形式可以基于XML文件的方式,也可以基于注解的方式,而Bean的配置方式可以通过全类名(反射),通过工厂方式和FactoryBean. XML形式 <?xml version=&q ...
- win7系统保护配置现错误“文件名、目录名或卷标语法不正确。(0x8007007B)
windows7下系统保护功能很是鸡肋,有事会出现一下两个问题: 1.出现错误“文件名.目录名或卷标语法不正确.(0x8007007B) 2.保护设置列表中出现“Windows7_os(c:)(找不到 ...
- SpringBoot2.0 基础案例(03):配置系统全局异常映射处理
一.异常分类 这里的异常分类从系统处理异常的角度看,主要分类两类:业务异常和系统异常. 1.业务异常 业务异常主要是一些可预见性异常,处理业务异常,用来提示用户的操作,提高系统的可操作性. 常见的业务 ...
- Azure AD Domain Service(二)为域服务中的机器配置 Azure File Share 磁盘共享
一,引言 Azure File Share 是支持两种认证方式的! 1)Active Directory 2)Storage account key 记得上次分析的 "Azure File ...
- 【CAS单点登录视频教程】 第04集 -- tomcat下配置https环境
目录 ----------------------------------------- [CAS单点登录视频教程] 第06集[完] -- Cas认证 学习 票据认证FormsAuthenticati ...
随机推荐
- python 变量进阶(理解)
变量进阶(理解) 目标 变量的引用 可变和不可变类型 局部变量和全局变量 01. 变量的引用 变量 和 数据 都是保存在 内存 中的 在 Python 中 函数 的 参数传递 以及 返回值 都是靠 引 ...
- 修改idea打开新窗口的默认配置
使用idea开发maven项目时,发现使用新窗口创建一个项目时,例如file-settings的maven库配置都是用的用户下的maven库,如何配置一个全局的maven配置呢,操作如下: File- ...
- eclipse在linux安装报错
JVM terminated. Exit code=127/usr/bin/java-Dosgi.requiredJavaVersion=1.8-Dosgi.instance.area.default ...
- UFLDL 教程学习笔记(二)反向传导算法
UFLDL(Unsupervised Feature Learning and Deep Learning)Tutorial 是由 Stanford 大学的 Andrew Ng 教授及其团队编写的一套 ...
- Android快速实现二维码扫描--Zxing
Android中二维码扫描的最常用库是zxing和zbar,zxing项目地址为https://github.com/zxing/zxing,目前还有多个人在维护.zbar主要用C来写的,对速度有要求 ...
- Android多线程编程<一>Android中启动子线程的方法
我们知道在Android中,要更新UI只能在UI主线程去更新,而不允许在子线程直接去操作UI,但是很多时候,很多耗时的工作都交给子线程去实现,当子线程执行完这些耗时的工作后,我们希望去修改 ...
- android开发(3):列表listview的实现 | 下拉刷新
APP里面的列表太常用了,系统提供的listview或grideview可以做到.另外,我希望这个列表能够下拉时触发刷新,于是考虑使用封装了这个功能的开源项目,这里介绍这个: https://gith ...
- leetcode — substring-with-concatenation-of-all-words
import java.util.*; /** * Source : https://oj.leetcode.com/problems/substring-with-concatenation-of- ...
- (转)eclipse上传项目到码云
把Eclipse项目上传到码云的步骤: 1.登录码云:新建项目 2.输入项目名: 3.空项目创建成功如下图: 4.右键点击Eclipse的项目,选择“Team”—————->“Share Pro ...
- Linux IPC基础(System V)
简介 IPC 主要有消息队列.信号量和共享内存3种机制.和文件一样,IPC 在使用前必须先创建,使用 ipcs 命令可以查看当前系统正在使用的 IPC 工具: 由以上可以看出,一个 IPC 至少包含 ...