4.3. 管理 CLI 迁移操作
您可以使用管理 CLI 更新 JBoss EAP 6 服务器配置文件,使其在 JBoss EAP 7 上运行。管理 CLI 提供了 迁移 操作,可将上一发行版中的 jacorb、消息传递 和 Web 子系统自动更新至新配置。您还可以对 jacorb、消息传递 和 web 子系统执行 describe-migration 操作,以便在执行迁移前检查建议的迁移配置更改。cmp、jaxr 或 线程 子系统没有替换,它们必须从服务器配置中移除。
有关 迁移操作的限制,请参阅服务器配置 迁移 选项。JBoss 服务器迁移工具是更新配置的一种首选方法,在 JBoss EAP 7 中包括新的功能和设置,同时保持现有配置。有关如何配置和运行工具的详情,请参考 使用 JBoss 服务器迁移工具。
| JBoss EAP 6 子系统 | JBoss EAP 7 子系统 | 管理 CLI 操作 |
|---|---|---|
| CMP | 没有替换 | remove |
| jacorb | iiop-openjdk | migrate |
| JAXR | 没有替换 | remove |
| 消息传递 | messaging-activemq | migrate |
| 线程 | 没有替换 | remove |
| web | Undertow | migrate |
启动服务器和管理 CLI
按照以下步骤更新您的 JBoss EAP 6 服务器配置,使其在 JBoss EAP 7 上运行。
- 开始之前,请检查备份重要数据和查看服务器状态。它包含有关确保服务器处于良好状态并且已备份适当文件的重要信息。
使用 JBoss EAP 6 配置启动 JBoss EAP 7 服务器。
- 备份 JBoss EAP 7 服务器配置文件。
将上一版本的配置文件复制到 JBoss EAP 7 目录中。
$ cp EAP6_HOME/standalone/configuration/standalone-full.xml EAP7_HOME/standalone/configuration导航到 JBoss EAP 7 安装目录,再使用
--start-mode=admin-only参数启动服务器。$ bin/standalone.sh -c standalone-full.xml --start-mode=admin-only注意当您启动服务器时,您将在服务器日志中看到以下
org.jboss.as.controller.management-operationERRORS:这些错误是正常的,并且表明必须删除传统的子系统配置或迁移到 JBoss EAP 7。- WFLYCTL0402:运行此版本的服务器上不支持由传统扩展名 'org.jboss.as.cmp' 提供的子系统 [cmp]。服务器必须先删除或迁移子系统和扩展。
- WFLYCTL0402:运行此版本的服务器上不支持由传统扩展名 'org.jboss.as.jacorb' 提供的 Subsystems [jacorb]。服务器必须先删除或迁移子系统和扩展。
- WFLYCTL0402:运行此版本的服务器上不支持由传统扩展名 'org.jboss.as.jaxr' 提供的子系统 [jaxr]。服务器必须先删除或迁移子系统和扩展。
- WFLYCTL0402:运行此版本的服务器上不支持由传统扩展名 'org.jboss.as.messaging' 提供的子系统 [messaging]。服务器必须先删除或迁移子系统和扩展。
- WFLYCTL0402:运行此版本的服务器上不支持由传统扩展名 'org.jboss.as.threads' 提供的子系统 [threads]。服务器必须先删除或迁移子系统和扩展。
- WFLYCTL0402:运行此版本的服务器上不支持由传统扩展名 'org.jboss.as.web' 提供的子系统 [web]。服务器必须先删除或迁移子系统和扩展。
打开一个新终端,导航到 JBoss EAP 7 安装目录,然后使用
--controller=remote://localhost:9990参数启动管理 CLI。$ bin/jboss-cli.sh --connect --controller=remote://localhost:9990
迁移 JacORB、Messaging 和 Web 子系统
要在执行迁移前检查子系统将要进行的配置更改,请执行
describe-migration操作。describe-migration操作使用以下语法:/subsystem=SUBSYSTEM_NAME:describe-migration以下示例描述了在迁移到 JBoss EAP 7 时对 JBoss EAP 6.4
standalone-full.xml配置文件进行的配置更改。条目已从输出中删除,以提高可读性和节省空间。示例: describe-migration Operation
/subsystem=messaging:describe-migration { "outcome" => "success", "result" => { "migration-warnings" => [], "migration-operations" => [ { "operation" => "add", "address" => [("extension" => "org.wildfly.extension.messaging-activemq")], "module" => "org.wildfly.extension.messaging-activemq" }, { "operation" => "add", "address" => [("subsystem" => "messaging-activemq")] }, <!-- *** Entries removed for readability *** --> { "operation" => "remove", "address" => [("subsystem" => "messaging")] }, { "operation" => "remove", "address" => [("extension" => "org.jboss.as.messaging")] } ] } }执行
迁移操作,将子系统配置迁移到 JBoss EAP 7 中的替换子系统。该操作使用以下语法:/subsystem=SUBSYSTEM_NAME:migrate注意Messaging
子系统描述-迁移和迁移操作,您可以通过参数来配置传统客户端的访问权限。有关命令语法的更多信息,请参阅 Messaging Subsystem Migration 和 Forward Compatibility。查看 命令的结果和结果。确保操作成功完成,并且没有"迁移警告"条目。这意味着子系统的迁移配置已经完成。
示例:成功迁移操作时没有警告
/subsystem=messaging:migrate { "outcome" => "success", "result" => {"migration-warnings" => []} }如果您在日志中看到"migration-warnings"条目,这表示服务器配置已成功迁移,但它无法迁移所有元素和属性。您必须遵循"migration-warnings"提供的建议,并运行额外的管理 CLI 命令来修改这些配置。以下是返回"migration-warnings"的迁移
操作示例。示例:使用 Warning 迁移操作
/subsystem=messaging:migrate { "outcome" => "success", "result" => {"migration-warnings" => [ "WFLYMSG0080: Could not migrate attribute group-address from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupB\") ]. Use instead the socket-binding attribute to configure this broadcast-group.", "WFLYMSG0080: Could not migrate attribute group-port from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupB\") ]. Use instead the socket-binding attribute to configure this broadcast-group.", "WFLYMSG0080: Could not migrate attribute local-bind-address from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupA\") ]. Use instead the socket-binding attribute to configure this broadcast-group.", "WFLYMSG0080: Could not migrate attribute local-bind-port from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupA\") ]. Use instead the socket-binding attribute to configure this broadcast-group.", "WFLYMSG0080: Could not migrate attribute group-address from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupA\") ]. Use instead the socket-binding attribute to configure this broadcast-group.", "WFLYMSG0080: Could not migrate attribute group-port from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupA\") ]. Use instead the socket-binding attribute to configure this broadcast-group." ]} }注意每个子系统
的迁移列表位于本指南 末尾的参考资料 中。和迁移警告检查服务器配置文件,以验证扩展、子系统和命名空间是否已更新,并且现有的子系统配置已迁移到 JBoss EAP 7。
注意您必须使用以下命令为每个
jacorb、消息传递和web子系统重复此过程:/subsystem=jacorb:migrate /subsystem=messaging:migrate /subsystem=web:migrate从服务器配置中删除
cmp、jaxr和线程子系统和扩展。仍在管理 CLI 提示符中,请执行以下命令来删除过时的
cmp、jaxr和线程子系统:/subsystem=cmp:remove /extension=org.jboss.as.cmp:remove /subsystem=jaxr:remove /extension=org.jboss.as.jaxr:remove /subsystem=threads:remove /extension=org.jboss.as.threads:remove
您必须迁移 消息传递、jacorb 和 Web 子系统,并删除 cmp、jaxr 和 线程 扩展和子系统,然后才能重新启动服务器以进行正常操作。如果您需要在完成此过程前重新启动服务器,请务必在服务器启动命令行 中包含 --start-mode=admin-only 参数。这可让您继续更改配置更改。