forked from bitsofinfo/hazelcast-docker-swarm-discovery-spi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hazelcast-docker-swarm-discovery-spi-example-member-address-provider.xml
107 lines (83 loc) · 5.4 KB
/
hazelcast-docker-swarm-discovery-spi-example-member-address-provider.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?xml version="1.0" encoding="UTF-8"?>
<hazelcast id="hazelcast-consul-discovery"
xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.7.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<group>
<name>hazelcast-docker-swarm-discovery-spi</name>
<password>haz3lcast1</password>
</group>
<properties>
<property name="hazelcast.discovery.enabled">true</property>
<property name="hazelcast.shutdownhook.enabled">true</property>
<property name="hazelcast.socket.bind.any">false</property>
</properties>
<network>
<port auto-increment="true">5701</port>
<interfaces enabled="false">
<!-- irrelevant when using SwarmAddressPicker, not used currently -->
<interface>${hazelcastInterface}</interface>
</interfaces>
<!-- Enable a Docker Swarm based MemberAddressProvider (Hazelcast 3.9+ only) -->
<member-address-provider enabled="true">
<class-name>org.bitsofinfo.hazelcast.discovery.docker.swarm.SwarmMemberAddressProvider</class-name>
<!-- OPTIONAL:
The following will be passed as a java.util.Properties to
the SwarmMemberAddressProvider(java.util.Properties) constructor.
If you do not defined these here in XML, by default they will be fetched via
-D java System.properties by the same names via the default no-arg constructor
of SwarmMemberAddressProvider
You can mix/match combination of -D defined properties and those defined here
Properties defined here take precedence over those defined via -D system properties
<properties>
<property name="dockerNetworkNames">...</property>
<property name="dockerServiceLabels">...</property>
<property name="dockerServiceNames">...</property>
<property name="hazelcastPeerPort">...</property>
<property name="swarmMgrUri">...</property>
<property name="skipVerifySsl">true|false</property>
<property name="logAllServiceNamesOnFailedDiscovery">true|false</property>
<property name="strictDockerServiceNameComparison">true|false</property>
</properties>
-->
</member-address-provider>
<join>
<multicast enabled="false"/>
<aws enabled="false"/>
<tcp-ip enabled="false" />
<!-- Enable a Docker Swarm based discovery strategy -->
<discovery-strategies>
<discovery-strategy enabled="true"
class="org.bitsofinfo.hazelcast.discovery.docker.swarm.DockerSwarmDiscoveryStrategy">
<properties>
<!-- Comma delimited list of Docker network names to discover matching services on -->
<property name="docker-network-names">${dockerNetworkNames}</property>
<!-- Comma delimited list of relevant Docker service names
to find tasks/containers on the above networks -->
<property name="docker-service-names">${dockerServiceNames}</property>
<!-- Comma delimited list of relevant Docker service label=values
to find tasks/containers on the above networks -->
<property name="docker-service-labels">${dockerServiceLabels}</property>
<!-- 1.0-RC5+ ONLY: Swarm Manager URI (overrides DOCKER_HOST) -->
<property name="swarm-mgr-uri">${swarmMgrUri}</property>
<!-- 1.0-RC5+ ONLY: If Swarm Mgr URI is SSL, to enable skip-verify for it -->
<property name="skip-verify-ssl">${skipVerifySsl}</property>
<!-- 1.0-RC13+ ONLY NOTE! If enabled logged w/ severity FINE.
Use with caution. If your target swarm cluster contains many services this call
may result in logging a considerable amount of un-related docker service names.
-->
<property name="log-all-service-names-on-failed-discovery">${logAllServiceNamesOnFailedDiscovery}</property>
<!-- The raw port that hazelcast is listening on
IMPORTANT: this is NOT a docker "published" port, nor is it necessarily
a EXPOSEd port... it is simply the hazelcast port that the service
is configured with, this must be the same for all matched containers
in order to work, and just using the default of 5701 is the simplist
way to go.
-->
<property name="hazelcast-peer-port">${hazelcastPeerPort}</property>
</properties>
</discovery-strategy>
</discovery-strategies>
</join>
</network>
</hazelcast>