此内容没有您所选择的语言版本。

2.3. Update a Profile


Atomic container upgrades

Normally, when you edit a profile that is already deployed in a container, the modification takes effect immediately. This is because the Fabric Agent in the affected container (or containers) actively monitors the fabric registry in real time.
In practice, however, immediate propagation of profile modifications is often undesirable. In a production system, you typically want to roll out changes incrementally: for example, initially trying out the change on just one container to check for problems, before you make changes globally to all containers. Moreover, sometimes several edits must be made together to reconfigure an application in a consistent way.

Profile versioning

For quality assurance and consistency, it is typically best to modify profiles atomically, where several modifications are applied simultaneously. To support atomic updates, fabric implements profile versioning. Initially, the container points at version 1.0 of a profile. When you create a new profile version (for example, version 1.1), the changes are invisible to the container until you upgrade it. After you are finished editing the new profile, you can apply all of the modifications simultaneously by upgrading the container to use the new version 1.1 of the profile.

Upgrade to a new profile

For example, to modify the default profile, when it is deployed and running in a container, follow the recommended procedure:
  1. Create a new version, 1.1, to hold the pending changes by entering this console command:
    JBossFuse:karaf@root> fabric:version-create
    Created version: 1.1 as copy of: 1.0
    The new version is initialised with a copy of all of the profiles from version 1.0.
  2. Use the fabric:profile-edit command to change the help text for the default profile. Enter the following profile-edit command to edit the Summary.md resource:
    JBossFuse:karaf@root> fabric:profile-edit --resource Summary.md default 1.1
    This opens the built-in text editor for editing profile resources (see Appendix A, Editing Profiles with the Built-In Text Editor).
    Remember to specify version 1.1 to the fabric:profile-edit command, so that the modifications are applied to version 1.1 of the default profile.
    When you are finished editing, type Ctrl-S to save your changes and then type Ctrl-X to quit the text editor and get back to the console prompt.
  3. Upgrade the child container to version 1.1 by entering this console command:
    JBossFuse:karaf@root> fabric:container-upgrade 1.1 child

Roll back to an old profile

You can easily roll back to the old version of the default profile, using the fabric:container-rollback command like this:
JBossFuse:karaf@root> fabric:container-rollback 1.0 child
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.