如何在公共 IP 中设置不同的集群 [英] How to setup different clusters in common IP
问题描述
我有许多 IP 地址为 10.4.0.X 的 wildfly-8.2 节点.我需要将它们分成 2 个不同的集群.不幸的是,我收到了来自未包含在集群中的节点的消息.每个集群接收来自所有节点的消息,因为它们都在 10.4.0 以下.这是我在 Apache 中的 mod_cluster 配置:
I have many wildfly-8.2 nodes that has IP address 10.4.0.X. I need to group them in 2 different clusters. Unfortunately I received message from nodes that doesn't included in a cluster. Each cluster receives messages from all nodes since they are all under 10.4.0. Here is my mod_cluster configuration in Apache:
# MOD_CLUSTER_ADDS
<IfModule manager_module>
Listen 10.4.0.1:10001
ManagerBalancerName testbalancer
<VirtualHost 10.4.0.1:10001>
<Location />
Order deny,allow
Deny from all
Allow from 10.4.0.
</Location>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
#ServerAdvertise on http://10.4.0.1:10001
AdvertiseFrequency 5
#AdvertiseSecurityKey secret
#AdvertiseGroup 224.0.1.105:23364
EnableMCPMReceive
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
Allow from 10.4.0
</Location>
推荐答案
我认为在域模式下使用 widlfly 可能是一个很好的场景,这样你就可以配置多个服务器组(子集群)并使用域集中管理它们控制器.此处提供详细教程:http://blog.akquinet.de/2012/07/19/scalable-ha-clustering-with-jboss-as-7-eap-6/
I think this might be a good scenario to use widlfly in domain mode, that way you can configure multiple server groups (subclusters) and manage them centrally using a domain controller. A detailed tutorial is available here: http://blog.akquinet.de/2012/07/19/scalable-ha-clustering-with-jboss-as-7-eap-6/
本教程将多个服务器组拆分为 mod_cluster 上的多个负载均衡器组.
The tutorial splits multiple server groups into multiple load balancer groups on mod_cluster.
要将单个节点配置为 mod_cluster 的不同负载均衡器组(我自己没有尝试过!),您可以使用 mod-cluster-config 中的 lbgroup 参数:
To just configure individual nodes into different load balancer groups for mod_cluster (have not tried this myself!), you can use the lbgroup parameter in the mod-cluster-config:
<subsystem xmlns="urn:jboss:domain:modcluster:1.1">
<mod-cluster-config advertise-socket="modcluster"
balancer="myBalancer" load-balancing-group="myLBGroup"
connector="ajp">
<dynamic-load-provider>
<load-metric type="busyness"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
参考:https://developer.jboss.org/thread/203907
实际上将野蝇实例分成单独的集群是另一回事.曾经有一个属性jboss.partition.name",但它已被替换为为子网内的集群分区定义唯一的多播地址/端口组合.
To actually separate the wildfly instances into separate clusters is another story. There used to be a property "jboss.partition.name" but this has been replaced by defining unique multicast address/port combinations for your cluster partitions within the subnet.
https://developer.jboss.org/thread/177877
因此假设您使用 udp 作为 jgroups 堆栈,您可以使用-u"命令行参数更改多播地址:
So assuming you are using udp as your jgroups stack, you can change the multicast address using the "-u" command line parameter:
配置 mod_cluster 的另一种方法可能是禁用广告(节点和 mod_cluster)并在您的 standalone.xml 中使用静态配置:
An alternative for configuring mod_cluster might be to disable advertising (nodes and mod_cluster) and use a static config in your standalone.xml:
<mod-cluster-config proxy-list="10.0.1.2:6667"/>
这样,节点将不再做广告,并且对不同 mod_cluster apache 代理的分配将是静态的.
That way, the nodes will no longer advertise and the assignments to the different mod_cluster apache proxies would be static.
参考:https://developer.jboss.org/thread/218813
这篇关于如何在公共 IP 中设置不同的集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!