Giriş
Not : Bu yazı hazelcast.xml - Cluster'ı Başlatmak İçin Ayarlar yazısının bir devamı
Network join için varsayılan yöntem multicast yöntemidir. Yani Hazelcast kümesindeki bilgisayarlar birbirlerini bulmak için multicast kullanırlar. Başka bir yöntem kullanmak istiyorsak multicast yöntemini kapatmak gerekir. Şöyle yaparız
<network> <join> <multicast enabled="false"/> Another join method is defined here </join> </network>
Üyeler birbirlerini bulunca şuna benzer bir çıktı verir. Çıktıda üye kendisini ilk satıra yazar ve "this" olarak belirtir. Ayrıca "ver:" alanı ile kaç defa güncellendiği yani version belirtilir.
Members {size:2, ver:2} [ Member [10.5.167.10]:5701 - 36651420-f623-4ac0-adc7-73326fba9fa8 this Member [10.5.167.11]:5701 - f41c88f0-4e7a-466d-897a-b222effe19d2 ]
aws
Şöyle yaparız
<aws enabled="false"> <access-key>my-access-key</access-key> <secret-key>my-secret-key</secret-key> <region>us-west-1</region> <host-header>ec2.amazonaws.com</host-header> <security-group-name>hazelcast-sg</security-group-name> <tag-key>type</tag-key> <tag-value>hz-nodes</tag-value> </aws>
discovery-strategy
Sanırım custom discovery-strategy için kullanılır.
Örnek
Şöyle yaparız
<discovery-strategies> <discovery-strategy enabled="true" class="xx.xx.DiscoveryStrategy"> <properties> <property name="ws_port">5701</property> </properties> </discovery-strategy> </discovery-strategies>
kubernetes
Kubernetes İçin Network Join Ayarları yazısına taşıdım
multicast
Multicast'i denemek için Linux'ta şöyle yaparız
on the server: sockperf server -i 224.2.2.3 -p 54327on the client: sockperf ping-pong -i 224.2.2.3 -p 54327
Açıklaması şöyle
multicast-group: The multicast group IP address. Specify it when you want to create clusters within the same network. Values can be between 224.0.0.0 and 239.255.255.255. Its default value is 224.2.2.3.
multicast-port: The multicast socket port that the Hazelcast member listens to and sends discovery messages through. Its default value is 54327.
Örnek
Şöyle yaparız
hazelcast:cluster-name: dev-ptt group: network: join: multicast: enabled: true
Örnek - IPv4
Şöyle yaparız
<multicast enabled="false" loopbackModeEnabled="false"> <multicast-group>224.2.2.3</multicast-group> <multicast-port>54327</multicast-port> <multicast-timeout-seconds>2</multicast-timeout-seconds> <multicast-time-to-live>32</multicast-time-to-live> </multicast>
Örnek - IPv6
Şöyle yaparız
<multicast enabled="false"> <multicast-group>FF02:0:0:0:0:0:0:1</multicast-group> <multicast-port>54327</multicast-port> </multicast>
tcp
Açıklaması şöyle. Yani cluster member olarak iki bilgisayar varsa ve üçüncüsünü eklersek sadece üçüncüsünün XML'inde değişiklik yapmak yeterli.
The members section in TCP is for finding the cluster.
You list some places where cluster members may be. The process starting tries those locations, and if it gets a response the response includes the locations of all cluster members.
When scaling up you frequently won't know the location in advance. The TCP list is one solution, but there's other ways if running on the cloud, etc.
Bir başka açıklama şöyle
Usually, you don't need to change anything, and just starting a new member (IP3) with listed IP1 and IP2 will work. The third member will join the cluster.How does it look like under the hood (simplified):- the newly started member tries to contact addresses in its member list; after a successful connection, it sends a "Who Is Master" request and reads the master node address from the response;- the new node makes a connection to the master address (if not established already) and asks it to join the cluster;- if the join is successful, the master replies with an updated member list (cluster view) and it also sends the updated list to all other cluster members;There were significant improvements in handling corner cases for these "incomplete address configuration" issues in Hazelcast 5.2. So if you are on an older version I strongly recommend switching to an up-to-date one.If for any reason the default behavior is not sufficient in your case, you can also use the /hazelcast/rest/config/tcp-ip/member-list REST endpoint to make member-list changes. The endpoint was also introduced in 5.2. Find details in the documentation:
Şöyle yaparız
<hazelcast xmlns="http://www.hazelcast.com/schema/config"><cluster-name>hazelcast-test</cluster-name><network><port auto-increment="true" port-count="20">5701</port><join><multicast enabled="false"/><tcp-ip enabled="true"><member>localhost:5701</member><member>localhost:5702</member><member>localhost:5703</member></tcp-ip></join></network><management-center scripting-enabled="true" /></hazelcast>
Örnek - tcp + timeout
Şöyle yaparız
<tcp-ip enabled="true" connection-timeout-seconds="5"> <member-list> <member>10.244.0.35</member> <member>10.244.0.36</member> <member>10.244.0.37</member> </member-list> </tcp-ip>
Hiç yorum yok:
Yorum Gönder