在 Microsoft Azure 中使用 Red Hat JBoss Enterprise Application Platform
在 Microsoft Azure 上使用 Red Hat JBoss Enterprise Application Platform 的说明,包括配置高可用性。
摘要
第 1 章 关于 Microsoft Azure 上的 JBoss EAP 复制链接链接已复制到粘贴板!
JBoss EAP 8.0 可以和 Microsoft Azure 平台一起使用,只要您在 Azure 中运行 JBoss EAP 的具体受支持配置中使用它。如果要配置集群的 JBoss EAP 环境,您必须应用在 Azure 中使用 JBoss EAP 集群功能所需的特定配置。
第 2 章 Microsoft Azure 上 JBoss EAP 的订阅模型 复制链接链接已复制到粘贴板!
您可以选择在 Azure 上部署 JBoss EAP 的两个订阅模型:提供您自己的订阅(BYOS)和 pay-as-you-go (PAYG)。
以下是两个产品之间的区别:
- BYOS
- 如果您已有红帽订阅,您可以使用它在 Azure 上部署带有 BYOS 模型的 JBoss EAP。如需更多信息,请参阅关于 Red Hat Cloud Access。
- PAYG
- 如果您没有现有的红帽订阅,可以选择根据您使用 PAYG 模型使用的计算资源数量付费。
第 3 章 关于 Red Hat Cloud Access 复制链接链接已复制到粘贴板!
如果您已有红帽订阅,Red Hat Cloud Access 会在红帽认证的云基础架构供应商(如 Amazon EC2 和 Microsoft Azure)上为 JBoss EAP 提供支持。Red Hat Cloud Access 允许您在传统服务器和基于公共云的资源间经济地迁移您的订阅。
您可以在 客户门户网站上找到有关红帽云访问 的更多信息。
第 4 章 在 Microsoft Azure 中运行 JBoss EAP 支持的配置 复制链接链接已复制到粘贴板!
本节介绍在 Microsoft Azure 中运行 JBoss EAP 的支持的配置。
4.1. 支持的使用 JBoss EAP 的虚拟机操作系统 复制链接链接已复制到粘贴板!
在 Microsoft Azure 中使用 JBoss EAP 唯一支持的虚拟机操作系统有:
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Microsoft Windows Server 2019
- Microsoft Windows Server 2022
Red Hat Cloud Access 程序允许您使用 JBoss EAP 订阅在您自己的 Azure 虚拟机上或 Microsoft Azure Marketplace 中上述按需操作系统之一安装 JBoss EAP。请注意,虚拟机操作系统订阅与 JBoss EAP 订阅分开。
除上述操作系统限制外,请参阅客户门户网站 来了解 JBoss EAP 支持的配置 的更多信息,如支持的 Java Development Kit (JDK)供应商和版本。
4.2. Azure Autoscale 功能 JBoss EAP 集群 复制链接链接已复制到粘贴板!
所有 JBoss EAP 集群用例都支持垂直扩展。
+ 也支持以下水平扩展用例:
分布式 HTTP 会话
-
通过
hotrod-session-management 通过
infinispan-session-management-
使用
invalidation-cache和共享持久缓存存储
-
使用
-
通过
分布式
@StatefulEJBs通过
infinispan-passivation-store-
使用
invalidation-cache和共享持久缓存存储
-
使用
分布式 EJB 计时器
-
使用
invalidation-cache和共享持久缓存存储
-
使用
JPA/Hibernate 第二级缓存
- 仅限无效或本地实体/集合/查询缓存
公共 WildFly 集群 API
-
CommandDispatcherAPI 组APIRed Hat Datagrid (RHDG)集群是共享持久缓存存储的首选。
有关不支持的 JBoss EAP 集群用例列表,请参阅 JBoss EAP 集群的不支持的 Azure Autoscale 横向扩展。
要设置 JBoss EAP 集群实例,请参阅在 Microsoft Azure 中为 JBoss EAP 设置集群实例。
-
第 5 章 在 Microsoft Azure 中使用 JBoss EAP 时不支持的功能 复制链接链接已复制到粘贴板!
在 Microsoft Azure 中使用 JBoss EAP 时,有一些不支持的功能。
- 使用共享存储的 ActiveMQ Artemis 高可用性
- Microsoft Azure 不支持使用 Artemis 共享存储的 JBoss EAP 消息传递高可用性。要在 Azure 中配置 JBoss EAP 消息传递高可用性,请参阅 Microsoft Azure 中 ActiveMQ Artemis 高可用性 的配置中的说明。
- mod_custer Advertising
- 如果要将 JBoss EAP 用作 Undertow mod_cluster 代理负载平衡器,则不支持 mod_cluster 公告功能,因为 Azure UDP 多播限制。如需更多信息,请参阅在 Microsoft Azure 中使用 mod_cluster 配置负载平衡。
- 虚拟机扩展集
不支持 Microsoft Azure Virtual Machine Scale Set (VMSS)中的事务,因为自动扩展功能不会等待在缩减过程中完成所有事务。这可能导致数据完整性问题。Microsoft Azure VMSS 销毁 EAP 虚拟机,且不支持正确的关闭,这会导致 EAP 集群以下限制:
-
VMSS 应该支持配置,其中 HA 的服务器端状态需要外部化到第三方服务,如 Red Hat Data Grid。JBoss EAP 支持
HttpSessions外部化 VMSS,但不支持有状态会话 Bean。
-
VMSS 应该支持配置,其中 HA 的服务器端状态需要外部化到第三方服务,如 Red Hat Data Grid。JBoss EAP 支持
- Azure 应用程序服务
JBoss EAP Azure App Service 产品不支持 JTS。
注意虽然不支持 JTS,但在以下情况下支持 Jakarta 交易:
- 自动删除实例被禁用。
- 例如,实例不会被手动删除,例如:减少使用 Azure 仪表板运行的实例数量。
另外,不支持通过 Jakarta Enterprise Beans-remoting 进行事务。
- 不支持 JBoss EAP 集群的 Azure Autoscale 横向自动扩展扩展
在水平扩展时不支持以下 JBoss EAP 集群用例:
分布式 HTTP 会话
Infinispan-session-management- 使用分布式、复制或分散的缓存
分布式
@StatefulEJBs通过
infinispan-passivation-store- 使用分布式、复制或分散的缓存
分布式 EJB 计时器
- 使用分布式、复制或分散的缓存时
- 单例 MDB
JPA/Hibernate Second-Level Cache
- 分布式、复制或分散的 entity/collection/query 缓存
- 单例部署
- 单例 MSC 服务
公共 WildFly
集群API:-
RegistryAPI ServiceProviderRegistryAPI有关支持的 JBoss EAP 集群用例列表,请参阅 JBoss EAP 集群的 Azure Autoscale 功能。
要设置 JBoss EAP 集群实例,请参阅在 Microsoft Azure 中为 JBoss EAP 设置集群实例。
-
第 6 章 用于托管 JBoss EAP 的 Microsoft Azure 环境 复制链接链接已复制到粘贴板!
创建将在 Microsoft Azure 环境中托管 JBoss EAP 实例的虚拟机。虚拟机必须使用 Azure 大小 Standard_A2 或更高版本。
您可以使用 Azure On-Demand Premium 镜像创建虚拟机或手动创建自己的虚拟机。
有关 Red Hat Enterprise Linux 虚拟机,请查看客户门户网站中的说明:
- 有关 Microsoft Windows Server 虚拟机的信息,请参阅 Microsoft Azure 文档中的在 Microsoft Azure 中创建 Windows Server 虚拟机的说明。
JBoss EAP Azure 虚拟机镜像现在在市场中可用。
如果要配置 JBoss EAP 高可用性,则必须在同一虚拟网络中创建虚拟机。
第 7 章 在 Microsoft Azure 上安装服务器 复制链接链接已复制到粘贴板!
如果您使用 Microsoft Azure Marketplace 中的 Red Hat Enterprise Linux On-Demand 虚拟机,则必须使用 .zip 文件或安装程序方法安装 JBoss EAP。您不能将 Red Hat Enterprise Linux On-Demand 虚拟机注册到红帽订阅管理,因为您将为该虚拟机计费两次。
在 Microsoft Azure 环境中的虚拟机上安装 JBoss EAP 与普通 JBoss EAP 安装无关。具体步骤请查看 Red Hat JBoss Enterprise Application Platform 安装方法。
第 8 章 配置 JBoss EAP 子系统在 Microsoft Azure 上工作 复制链接链接已复制到粘贴板!
有些 JBoss EAP 子系统必须配置为在云平台上正常工作,如 Amazon EC2 和 Microsoft Azure。这是必要的,因为 JBoss EAP 服务器通常绑定到云虚拟机的专用 IP 地址,例如: 10.x.x.x,它只在云平台中可见。对于某些子系统,此地址还必须映射到服务器的公共 IP 地址,该地址可从云外部可见。
8.1. 配置 Web services 子系统以用于 Microsoft Azure 复制链接链接已复制到粘贴板!
当客户端使用 Service.create (wsdlURL, serviceName) 进行 Web 服务请求时,用户连接到服务器公共 IP 地址,但随后会被重定向到 webservices 子系统中服务器配置文件中定义的地址。
默认情况下,此地址为 ${jboss.bind.address:127.0.0.1},这意味着在云平台上,调用者将重定向到服务器的专用 IP 地址,且无法解析请求。服务器的公共 IP 地址必须在 wsdl-host 元素中配置。
流程
在
wsdl-host元素中配置服务器的公共 IP 地址。/subsystem=webservices:write-attribute(name=wsdl-host,value=<PUBLIC_IP_ADDRESS>)
/subsystem=webservices:write-attribute(name=wsdl-host,value=<PUBLIC_IP_ADDRESS>)Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2. 将 messaging 子系统配置为在 Microsoft Azure 上工作 复制链接链接已复制到粘贴板!
在云平台上使用消息传递时,客户端使用的连接工厂必须具有指向服务器公共 IP 地址的连接器。
因此,必须为运行 full 配置集的 JBoss EAP 服务器创建新的连接器和套接字绑定。
先决条件
-
JBoss EAP 正在运行
一个完整的配置文件。
流程
在
socket-binding-group中创建引用的http-public套接字绑定。/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=http-public:add(host=<PUBLIC_IP_ADDRESS>,port=${jboss.http.port:8080})/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=http-public:add(host=<PUBLIC_IP_ADDRESS>,port=${jboss.http.port:8080})Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在
messaging子系统中创建新的http-connector元素。/subsystem=messaging-activemq/server=default/http-connector=http-public-connector:add(endpoint=http-acceptor,socket-binding=http-public)
/subsystem=messaging-activemq/server=default/http-connector=http-public-connector:add(endpoint=http-acceptor,socket-binding=http-public)Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在
connection-factory中设置连接器,它将供客户端使用。例如,将RemoteConnectionFactory配置为默认连接:/subsystem=messaging-activemq/server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=connectors, value=["http-public-connector"]
/subsystem=messaging-activemq/server=default/connection-factory=RemoteConnectionFactory:write-attribute(name=connectors, value=["http-public-connector"]Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.3. 配置 remoting 子系统,以实现高可用性在 Microsoft Azure 上工作 复制链接链接已复制到粘贴板!
如果您在云平台中使用带有集群 Jakarta Enterprise Beans 的 JBoss EAP HA 功能,则需要进行重新移动子系统 的一些额外 配置,以确保 Jakarta Enterprise Beans 客户端可以接收集群视图更新。
流程
为
remoting子系统套接字绑定配置client-mapping。/socket-binding-group=standard-sockets/socket-binding=http:write-attribute(name=client-mappings,value=[{ "destination-address" => "<PUBLIC_IP_ADDRESS>", "destination-port" => "8080" }])/socket-binding-group=standard-sockets/socket-binding=http:write-attribute(name=client-mappings,value=[{ "destination-address" => "<PUBLIC_IP_ADDRESS>", "destination-port" => "8080" }])Copy to Clipboard Copied! Toggle word wrap Toggle overflow
第 9 章 为 Microsoft Azure 配置 JBoss EAP 复制链接链接已复制到粘贴板!
本章论述了 JBoss EAP 在 Microsoft Azure 中运行所需的配置。
9.1. 在 Red Hat Enterprise Linux 上引导时将 JBoss EAP 作为服务启动 复制链接链接已复制到粘贴板!
如果要在 Microsoft Azure 中的 Red Hat Enterprise Linux 上作为服务启动 JBoss EAP,您必须更改 JBoss EAP 服务的配置,以确保它在 Azure 虚拟机主机名初始化后启动。
流程
更新
/etc/systemd/system/multi-user.target.wants/eap8-standalone.service文件,以添加对waagent.service的依赖。替换以下行:
After=syslog.target network.target
After=syslog.target network.targetCopy to Clipboard Copied! Toggle word wrap Toggle overflow 使用这个行:
After=syslog.target network.target waagent.service Requires=waagent.service
After=syslog.target network.target waagent.service Requires=waagent.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
9.2. 在 Microsoft Azure 中使用 mod_cluster 进行负载均衡的配置 复制链接链接已复制到粘贴板!
由于 Azure 不支持 mod_cluster 广告,如果您要配置 JBoss EAP 负载平衡环境,您必须确保所有负载均衡器和 worker 都绑定到内部 Microsoft Azure 虚拟网络上可访问的 IP 地址。
balancer 和 worker 必须绑定到实际的内部 Azure 虚拟 IP 地址,如 172.28.0.2,而不是 0.0.0.0。
此外,由于 mod_cluster 广告不可用,如果您使用 JBoss EAP 作为 Undertow mod_cluster 代理负载平衡器,您必须将每个 worker 节点配置为使用包含每个负载均衡器 IP 地址和端口的代理列表,如下所示:
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=proxy-one:add(host="BALANCER_IP_ADDRESS", port="BALANCER_PORT") /subsystem=modcluster/mod-cluster-config=configuration:list-add(name=proxies,value=proxy-one)
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=proxy-one:add(host="BALANCER_IP_ADDRESS", port="BALANCER_PORT")
/subsystem=modcluster/mod-cluster-config=configuration:list-add(name=proxies,value=proxy-one)
9.3. Microsoft Azure 中 ActiveMQ Artemis 高可用性的配置 复制链接链接已复制到粘贴板!
Microsoft Azure 不支持使用 Artemis 共享存储的 JBoss EAP 消息传递高可用性。要在 Azure 中配置 JBoss EAP 消息传递高可用性,您必须使用带有 AZURE_PING JGroups 发现协议的复制日志
使用 TCP JGroups 堆栈.有关使用复制日志的更多信息,请参阅为 JBoss EAP 配置消息传递 中的数据复制。
使用 AZURE_PING 配置 TCP JGroups 堆栈后,您必须将 JGroups 堆栈添加到 messaging-activemq 子系统中的 discovery- group jgroups-cluster 配置中。详情请参阅为 JBoss EAP 配置消息传递中的服务器 发现。
9.4. 在 Microsoft Azure 中为 JBoss EAP 设置集群实例 复制链接链接已复制到粘贴板!
Microsoft Azure 支持 JBoss EAP 的集群。Microsoft Azure web 应用程序必须与虚拟网络集成才能启用集群。集成完成后重新启动 Web 应用时,您的 JBoss EAP 实例将启动群集配置。
您可以创建一个名为 WEBSITE _DISABLE_CLUSTERING 的应用程序 设置来禁用集群。您可以为 app 设置分配任何值。
有关将 JBoss EAP 应用程序迁移到 Microsoft Azure 上的 JBoss EAP 的更多信息,请参阅 Microsoft Azure 上的 JBoss EAP 文档中的将 JBoss EAP 应用程序迁移到 Azure 上的 JBoss EAP 文章。
有关集群的更多信息,请参阅 Microsoft Azure 上的 JBoss EAP 中的集群文章。https://learn.microsoft.com/en-us/azure/app-service/configure-language-java-deploy-run?pivots=java-jboss&tabs=linux#clustering
第 10 章 在 Microsoft Azure 中使用 JBoss EAP 高可用性 复制链接链接已复制到粘贴板!
Microsoft Azure 不支持基于 UDP 多播的 JGroups 发现协议。虽然您可以使用其他 JGroups 发现协议(如静态配置(TCPPING)、共享数据库(JDBC_PING)、基于共享文件系统的 ping (FILE_PING)或 TCPGOSSIP,但我们强烈建议您使用专门为 Azure 开发的共享文件系统发现协议: AZURE_PING。
10.1. JBoss EAP 高可用性的 AZURE_PING 配置 复制链接链接已复制到粘贴板!
本节介绍将 JBoss EAP 集群配置为使用 AZURE_PING JGroups 发现协议。确保您在创建虚拟机时满足先决条件。
AZURE_PING 在 Microsoft Azure 存储帐户中使用通用 blob 容器。如果您还没有 AZURE_PING 可以使用的 blob 容器,请创建一个虚拟机可以访问的容器。
创建 blob 容器后,您将需要以下信息来配置 AZURE_PING:
-
storage_account_name:包含 blob 容器的 Microsoft Azure 存储帐户的名称。 -
storage_access_key:存储帐户的 secret 访问密钥。 -
容器:用于PING数据的 blob 容器的名称。
以下说明使用 UDP JGroups 堆栈配置 AZURE_PING。如果要在 Azure 中配置 JBoss EAP 消息传递高可用性,您必须在 TCP JGroups 堆栈中配置 AZURE_PING。
要将 JBoss EAP 配置为使用 AZURE_PING 作为 JGroups 发现协议,您可以使用 预配置的示例 JBoss EAP 配置文件 或修改现有配置。
10.2. 使用示例配置文件配置高可用性 复制链接链接已复制到粘贴板!
JBoss EAP 包括用于在 Microsoft Azure 中配置单机服务器集群的示例配置文件。这些文件位于 EAP_HOME/docs/examples/configs/ 中,并且是 standalone-azure-ha.xml 和 standalone-azure-full-ha.xml。
有关服务器配置文件 之间的区别的说明,请参阅 JBoss EAP 配置指南。
这些示例配置文件预先配置了在 Microsoft Azure 中使用集群,需要的所有配置文件来指定 Azure 存储帐户和 blob 容器的值。
将所需的示例配置文件复制到 EAP_HOME/standalone/configuration/。
10.3. 修改现有服务器高可用性配置 复制链接链接已复制到粘贴板!
如果您要修改现有 JBoss EAP 高可用性配置,则需要对 jgroups 子系统进行以下更改:
流程
启动管理 CLI 并嵌入服务器,以对您选择的配置文件进行离线更改。例如:
EAP_HOME/bin/jboss-cli.sh [disconnected /] embed-server --server-config=standalone-ha.xml
$ EAP_HOME/bin/jboss-cli.sh [disconnected /] embed-server --server-config=standalone-ha.xmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow 默认情况下,JGroups 使用 UDP 堆栈。如果您使用另一个堆栈,请改回到使用 UDP 堆栈:
[standalone@embedded /] /subsystem=jgroups/channel=ee:write-attribute(name=stack,value=udp)
[standalone@embedded /] /subsystem=jgroups/channel=ee:write-attribute(name=stack,value=udp)Copy to Clipboard Copied! Toggle word wrap Toggle overflow 执行以下命令批删除现有的 UDP 堆栈并为 Microsoft Azure 配置新的 UDP 堆栈:
重要以下命令中使用的
storage_access_key编码必须是 Base64。Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意如果要将 Microsoft Azure 存储帐户和 blob 容器的值存储在配置文件中,请将上述配置中的系统属性引用替换为 Azure 环境中的值。在以下命令中,使用了启动 JBoss EAP 的示例。
配置文件中的堆栈 XML 应该类似如下:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 停止嵌入的服务器并退出管理 CLI:
[standalone@embedded /] stop-embedded-server [disconnected /] exit
[standalone@embedded /] stop-embedded-server [disconnected /] exitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
10.4. 在 Microsoft Azure 中启动 JBoss EAP 高可用性 复制链接链接已复制到粘贴板!
要使用 Microsoft Azure 中的高可用性启动 JBoss EAP,您必须:
- 使用配置了 AZURE_PING 发现协议 的配置文件,并指定 Microsoft Azure 存储帐户和 blob 容器所需的值。
将
私有接口绑定到用于集群流量的 Microsoft Azure 内部 IP 地址。您可以在启动时执行此操作,或者作为 JBoss EAP 配置指南中的设置配置。警告为了安全起见,您必须确保不向不需要的网络公开集群流量。
为此,您可以限制端点到 Microsoft Azure 虚拟网络,或为集群流量创建专用的虚拟网络和专用虚拟机 NIC。
流程
使用以下命令启动 JBoss EAP 高可用性实例。如果您在配置文件中存储 Microsoft Azure 存储帐户和 blob 容器值,您可以省略
-Djboss.jgroups.azure_ping系统属性定义。EAP_HOME/bin/standalone.sh -b <IP_ADDRESS> -bprivate <IP_ADDRESS> --server-config=<EAP_CONFIG_FILE>.xml -Djboss.jgroups.azure_ping.storage_account_name=<STORAGE_ACCOUNT_NAME> -Djboss.jgroups.azure_ping.storage_access_key=<STORAGE_ACCESS_KEY> -Djboss.jgroups.azure_ping.container=<CONTAINER_NAME>
EAP_HOME/bin/standalone.sh -b <IP_ADDRESS> -bprivate <IP_ADDRESS> --server-config=<EAP_CONFIG_FILE>.xml -Djboss.jgroups.azure_ping.storage_account_name=<STORAGE_ACCOUNT_NAME> -Djboss.jgroups.azure_ping.storage_access_key=<STORAGE_ACCESS_KEY> -Djboss.jgroups.azure_ping.container=<CONTAINER_NAME>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 例如:
EAP_HOME/bin/standalone.sh -b 172.28.0.2 -bprivate 172.28.0.2 --server-config=standalone-azure-ha.xml -Djboss.jgroups.azure_ping.storage_account_name=my_storage_account -Djboss.jgroups.azure_ping.storage_access_key=y7+2x7P68pQse9MNh58Bkk5po9OGzeJc+0IRqYcQ9Cr/Sp4xiUFJVlbY+MGXJRNx3syksikwm4tOYlFgjvoCmw== -Djboss.jgroups.azure_ping.container=my_blob_container
EAP_HOME/bin/standalone.sh -b 172.28.0.2 -bprivate 172.28.0.2 --server-config=standalone-azure-ha.xml -Djboss.jgroups.azure_ping.storage_account_name=my_storage_account -Djboss.jgroups.azure_ping.storage_access_key=y7+2x7P68pQse9MNh58Bkk5po9OGzeJc+0IRqYcQ9Cr/Sp4xiUFJVlbY+MGXJRNx3syksikwm4tOYlFgjvoCmw== -Djboss.jgroups.azure_ping.container=my_blob_containerCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注意由于 JBoss EAP 子系统仅在需要时启动,您必须将 distributable 应用部署到 JBoss EAP 服务器中,以启动高可用性 JBoss EAP 子系统。
在集群中启动第二个 JBoss EAP 实例后,您应该在集群中的第一个服务器控制台日志中看到类似如下的日志:
INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (thread-2,ee,eap-server-1) ISPN000094: Received new cluster view for channel server: [eap-server-1|1] (2) [eap-server-1, eap-server-2]
INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (thread-2,ee,eap-server-1) ISPN000094: Received new cluster view for channel server: [eap-server-1|1] (2) [eap-server-1, eap-server-2]
10.5. 在 blob 容器中清理过时的发现文件 复制链接链接已复制到粘贴板!
如果正常关闭了使用 AZURE_PING 的 JBoss EAP 集群,例如,使用 kill -9 结束 JBoss EAP 进程,则您的 blob 容器中可能会保留一些过时的发现文件。
通常会在安全的集群关闭中清理这些文件,但如果从异常关闭中保留,这可能会影响集群成员的启动性能,尝试联系不再在线的节点。
如果您有一个问题,您可以设置以下配置,以便在集群视图更改时删除并刷新所有发现文件。
/subsystem=jgroups/stack=udp/protocol=azure.AZURE_PING/property=remove_all_data_on_view_change:add(value=true)
/subsystem=jgroups/stack=udp/protocol=azure.AZURE_PING/property=remove_all_data_on_view_change:add(value=true)
或者,如果为每个视图更改清理容器不是理想的选择,您可以减少尝试加入集群的节点的加入尝试次数。默认 join 尝试数为 10。例如,要将 join 尝试的数量设置为 3 :
/subsystem=jgroups/stack=udp/protocol=pbcast.GMS/property=max_join_attempts:add(value=3)
/subsystem=jgroups/stack=udp/protocol=pbcast.GMS/property=max_join_attempts:add(value=3)
过时的发现文件仍然存在,但尝试加入集群的节点不会花费大量时间尝试联系不再在线的节点。
更新于 2025-05-10