forked from bitsofinfo/hazelcast-docker-swarm-discovery-spi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hazelcast-docker-swarm-dnsrr-discovery-spi-example.xml
54 lines (50 loc) · 2.32 KB
/
hazelcast-docker-swarm-dnsrr-discovery-spi-example.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="UTF-8"?>
<hazelcast
xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.10.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<properties>
<!-- Explicitly enable hazelcast discovery join methods -->
<property name="hazelcast.discovery.enabled">true</property>
</properties>
<network>
<!--
Auto-increment is turned off for the port; docker containers will
always be available at the available in-network ports.
-->
<port auto-increment="false">${servicePort}</port>
<member-address-provider enabled="true">
<class-name>org.bitsofinfo.hazelcast.spi.docker.swarm.dnsrr.DockerDNSRRMemberAddressProvider</class-name>
<properties>
<!-- Name of the docker service that this instance is running in -->
<property name="serviceName">${serviceName}</property>
<!-- Internal port that hazelcast is listening on -->
<property name="servicePort">${servicePort}</property>
</properties>
</member-address-provider>
<join>
<!-- Explicitly disable other cluster join methods -->
<multicast enabled="false"/>
<aws enabled="false"/>
<tcp-ip enabled="false" />
<discovery-strategies>
<discovery-strategy
enabled="true"
class="org.bitsofinfo.hazelcast.spi.docker.swarm.dnsrr.discovery.DockerDNSRRDiscoveryStrategy"
>
<properties>
<!--
Comma separated list of docker services and associated ports
to be considered peers of this service.
Note, this must include itself (the definition of
serviceName and servicePort) if the service is to
cluster with other instances of this service.
-->
<property name="peerServicesCsv">${peerServicesCsv}</property>
</properties>
</discovery-strategy>
</discovery-strategies>
</join>
</network>
</hazelcast>