8.2. 在 Karaf 上升级 Fuse Standalone
以下说明指导您在 Apache Karaf 上升级 Fuse。确保在开始升级过程前完成所有先决条件。
先决条件
- 在升级前,请确保您在 Apache 手册安装有完好的 Fuse 备份。
- 启动容器(如果尚未运行)。
如果容器在后台运行(或远程),请使用 SSH 控制台客户端 bin/client
连接到容器。
通过调用
patch:add
命令,将升级安装程序文件添加到容器的环境中。例如,要添加fuse-karaf-7.11.1.fuse-7_11_1-00013-redhat-00003.zip
升级安装程序文件:patch:add file:///path/to/fuse-karaf-7.11.1.fuse-7_11_1-00013-redhat-00003.zip
注意patch:find
命令仅用于查找和添加容器环境的最新热修复补丁;它无法用于应用完整的升级补丁。流程
运行
patch:update
命令。不需要重启容器。karaf@root()> patch:update Current patch mechanism version: 7.1.0.fuse-710023-redhat-00001 New patch mechanism version detected: 7.2.0.fuse-720035-redhat-00001 Uninstalling patch features in version 7.1.0.fuse-710023-redhat-00001 Installing patch features in version 7.2.0.fuse-720035-redhat-00001
调用
patch:list
命令,以显示升级安装程序的列表。在这个列表中,[name]
标题下的条目是升级 ID。例如:karaf@root()> patch:list [name] [installed] [rollup] [description] fuse-karaf-7.2.0.fuse-720035-redhat-00001 false true fuse-karaf-7.2.0.fuse-720035-redhat-00001
通过调用
patch:simulate
命令并指定您要应用的升级 ID 来模拟升级,如下所示:karaf@root()> patch:simulate fuse-karaf-7.2.0.fuse-720035-redhat-00001 INFO : org.jboss.fuse.modules.patch.patch-management (226): Installing rollup patch "fuse-karaf-7.2.0.fuse-720035-redhat-00001" ========== Repositories to remove (9): - mvn:io.hawt/hawtio-karaf/2.0.0.fuse-710018-redhat-00002/xml/features ... ========== Repositories to add (9): - mvn:io.hawt/hawtio-karaf/2.0.0.fuse-720044-redhat-00001/xml/features ... ========== Repositories to keep (10): - mvn:org.apache.activemq/artemis-features/2.4.0.amq-711002-redhat-1/xml/features ... ========== Features to update (100): [name] [version] [new version] aries-blueprint 4.2.0.fuse-710024-redhat-00002 4.2.0.fuse-720061-redhat-00001 ... ========== Bundles to update as part of features or core bundles (100): [symbolic name] [version] [new location] io.hawt.hawtio-log 2.0.0.fuse-710018-redhat-00002 mvn:io.hawt/hawtio-log/2.0.0.fuse-720044-redhat-00001 ... ========== Bundles to reinstall as part of features or core bundles (123): [symbolic name] [version] [location] com.fasterxml.jackson.core.jackson-annotations 2.8.11 mvn:com.fasterxml.jackson.core/jackson-annotations/2.8.11 ... Simulation only - no files and runtime data will be modified. karaf@root()>
这会生成升级时对容器所做的更改的日志,但不会对容器进行任何实际更改。查看模拟日志,以了解容器要进行的更改。
通过调用
patch:install
命令,并指定要应用的升级的升级 ID 来升级容器。例如:karaf@root()> patch:install fuse-karaf-7.11.1.fuse-7_11_1-00013-redhat-00003
通过搜索其中一个升级工件来验证升级。例如,如果您刚刚将 Fuse 7.1.0 升级到 Fuse 7.2.0,您可以搜索构建号 7_11_1-00017-redhat-00001 的捆绑包,如下所示:
karaf@root()> bundle:list -l | grep 7_11_1-00017-redhat-00001 22 │ Active │ 80 │ 7.11.1.fuse-7_11_1-00013-redhat-00003 │ mvn:org.jboss.fuse.modules/fuse-pax-transx-tm-narayana/7.11.1.fuse-7_11_1-00013-redhat-00003 188 │ Active │ 80 │ 7.11.1.fuse-7_11_1-00013-redhat-00003 │ mvn:org.jboss.fuse.modules.patch/patch-commands/7.11.1.fuse-7_11_1-00013-redhat-00003
升级后,在重启容器时,您还会在 Welcome banner 中看到新版本和构建号。