Weblogic 中文文档 ——第六章 管理配置变更

   

为了提供一个安全、可预期的方式来分发域的配置变更,WebLogic Server采用了大致类似于数据库事务的变更管理进程。域的配置在文件系统中表示为一组XML配置文件,核心为config.xml文件,在运行时表示为配置MBeanConfiguration MBeans)树。当你编辑域配置时,你实际上编辑的是分离的管理服务器的配置MBeans树。要开始编辑过程,你应获得编辑树的锁以阻止其他人进行变更。完成变更后,保存变更。不过变更不会生效直到你激活它们,分发给域中的所有server实例。激活变更后,每一个server都决定是否接受变更。如果所有server都可以接受该变更,则更新运行着的配置层,变更完成。
Note that WebLogic Server’s change management process applies to changes in domain and
server configuration data, not to security or application data.
关于如何通过JMX和配置MBean来实现配置变更的更多详细信息,参见使用JMX开发可管理的应用中的理解WebLogic Server MBeans”
如第三章使用WebLogic工具配置域中的描述,你可以使用一系列不同的WebLogic Server工具进行配置变更:

管理控制台
WebLogic 
脚本工具
JMX API
无论你使用哪一个工具进行配置变更,WebLogic Server都采用大体相同的方式来处理变更过程。

Ø         以下章节描述配置变更管理:

®       管理控制台的变更管理

®       配置变更管理过程

®       配置管理状态图

Ø         管理控制台的变更管理

WebLogic管理控制台将配置变更管理过程集中于Change Center
如果你想使用管理控制台进行配置变更,你必须先点击Change Center中的Lock & Edit(锁定并编辑)按钮。当你点击Lock & Edit后,你会获得域中所有server的配置MBean的可编辑层(编辑树)。
As you make configuration changes using the Administration Console, you click Save (or in
some cases Finish) on the appropriate pages. This does not cause the changes to take effect
immediately; instead, when you click Save, you are saving the change to the edit tree and to the
domain-name/pending/config.xml file and related configuration files. The changes take
effect when you click Activate Changes in the Change Center. At that point, the configuration
changes are distributed to each of the servers in the domain. If the changes are acceptable to each
of the servers, then they take effect. If any server cannot accept a change, then all of the changes
are rolled back from all of the servers in the domain. The changes are left in a pending state; you
can then either edit the pending changes to resolve the problem or revert the pending changes.

Ø         配置变更管理过程

以下步骤详细描述该过程,从你首先导入域的管理服务器开始:
1.
服务器启动时读取域配置文件,包括config.xml文件和config.xml文件涉及的所有附属配置文件,使用这些数据对随后的MBean树进行实例化:
一个配置 MBean的只读树包含管理服务器的当前资源配置。
域中所有服务器的所有配置 MBean的可编辑树。
注意:管理服务器也会实例化一个运行时MBean树和一个域运行时MBean树,但是这些不用于配置管理。
2. 
按以下步骤开始配置变更:
a. 
获得当前配置锁。
b. 
使用你选择的工具(管理控制台,WLSTJMX API等),按你的要求变更。
c. Save your changes to a pending version of the config.xml file.
保存更改
3. The Configuration Manager service saves all data from the edit MBean tree to a separate set
of configuration files in a directory named pending. See Figure 5-2.
The pending directory is immediately below the domain’s root directory. For example, if
your domain is named mydomain, then the default pathname of the pending config.xml
file is mydomain/pending/config.xml.
4. Make additional changes or undo changes that you have already made.
5. When you are ready, activate your changes in the domain, using the Activate Changes
button in the Administration Console’s Change Center or using the
ConfigurationManagerMBean.
When you activate changes (see Figure 5-3):
a. For each server instance in the domain, the Configuration Manager service copies the
pending configuration files to a pending directory in the server’s root directory.
If a Managed Server shares its root directory with the Administration Server,
ConfigurationManagerMBean does not copy the pending configuration files; the
Managed Server uses the Administration Server’s pending file.
b. Each server instance compares its current configuration with the configuration in the
pending file.
每一个服务器实例将它的当前配置和文件中配置比较。
c. Subsystems within each server vote on whether they can consume the new configuration.
If any subsystem indicates that it cannot consume the changes, the entire activation
process is rolled back and the ConfigurationManagerMBean emits an exception. You
can modify your changes and retry the change activation, or you can abandon your
lock, in which case the edit Configuration MBean tree and the pending configuration
files are reverted to the configuration in the read-only Configuration MBean tree and
configuration files.
d. If all subsystems on all servers can consume the change, the Configuration Manager
service replaces the read-only configuration files on each server instance in the domain
with the pending configuration files.
e. Each server instance updates its beans and its read-only Configuration MBean tree
according to the changes in the new configuration files.
每一个server实例都会更新

bean和只读配置 MBean 树以保持和新的配置文件修改一致。
f. The pending configuration files are then deleted from the pending directory.
6. You can retain your lock to make additional changes or release it so that others can update
the configuration. You can configure a timeout period that causes the Configuration
Manager service to abandon a lock.
Note: The configuration change lock does not prevent you from ****** conflicting
configuration edits using the same administrator user account. For example, if you obtain
a configuration change lock using the Administration Console, and then use the
WebLogic Scripting Tool with the same user account, you will access the same edit
session that you opened in the Administration Console and you will not be locked out of
****** changes with the Scripting Tool. Since this can lead to confusion and conflicting
configuration changes, this is not a recommended practice. You can reduce the risk that
such a situation might occur by maintaining separate administrator user accounts for each
person with an administrative role. Similar problems can still occur, however, if you have
multiple instances of the same script using the same user account.
处理变更冲突
In the event that you have saved more than one change set without activating them and one
change would invalidate a prior change, the Change Management service requires you to
manually resolve the invalidation before it will save your changes.
配置管理状态图

猜你喜欢

转载自blog.csdn.net/lanbery/article/details/2391382
今日推荐