forked from bitsofinfo/hazelcast-etcd-discovery-spi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhazelcast-etcd-discovery-spi-example.xml
118 lines (88 loc) · 6.96 KB
/
hazelcast-etcd-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
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
108
109
110
111
112
113
114
115
116
117
118
<?xml version="1.0" encoding="UTF-8"?>
<hazelcast id="hazelcast-etcd-discovery"
xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.6.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<group>
<name>hazelcast-etcd-discovery-spi</name>
<password>haz3lcast1</password>
</group>
<properties>
<property name="hazelcast.discovery.enabled">true</property>
<property name="hazelcast.shutdownhook.enabled">false</property>
</properties>
<network>
<port auto-increment="true">5701</port>
<join>
<multicast enabled="false"/>
<aws enabled="false"/>
<tcp-ip enabled="false" />
<!-- Enable a Etcd based discovery strategy -->
<discovery-strategies>
<discovery-strategy enabled="true"
class="org.bitsofinfo.hazelcast.discovery.etcd.EtcdDiscoveryStrategy">
<properties>
<!--
Comma separated list of URIs for etcd hosts to connect to
(one or more required) FORMAT: http[s]://[ip | hostname]:[port],...
All must be HTTPS or HTTP (NOT intermixed)
-->
<property name="etcd-uris">http://localhost:4001</property>
<!--
The root hazelcast cluster name "/key" by which all nodes
entries exist under in the form /[etcd-service-name]/[hz-instance-id]
= value { ip:xx.xx.xx.xx, hostname:my.host, port: xx, ...}
-->
<property name="etcd-service-name">hz-discovery-test-cluster</property>
<!--
If you quickly start an entire hz cluster at the exact same time, and
all hazelcast nodes are registered with Etcd at the same time, its
possible they may all discover ONLY themselves as members, leading to a cluster
that can never be fully discovered. This small delay can assist with avoiding
that problem. @see https://github.com/hazelcast/hazelcast/issues/6813
-->
<property name="etcd-discovery-delay-ms">10000</property>
<!--
EtcdRegistrator:
This (optionally) enables the DiscoveryStrategy to register this hazelcast instance with Etcd
directly and deregister it on shutdown.
LocalDiscoveryNodeRegistrator: Uses the private/public IP:PORT determined by this Hazelcast instance
(and tags above) as the identifiers for registering itself with Etcd
as a unique node.
ExplicitIpPortRegistrator: Uses an explicit IP:PORT specified by you in the 'etcd-registrator-config' below
(and tags above) as the identifiers for registering itself with Etcd
as a unique node.
DoNothingRegistrator: Does NOTHING in regards to registration or deregistration of this node as a service
with Etcd. This should be used if you are registering your nodes with Etcd yourself and
managing the registration of this Hazelcast node manually. In the format:
/[etcd-service-name]/[hz-instance-id] = { ip:xx.xx.xx.xx, hostname:my.host, port: xx, ...}
Note: hz-instance-id can be anything, but needs to be unique...
-->
<property name="etcd-registrator">org.bitsofinfo.hazelcast.discovery.etcd.LocalDiscoveryNodeRegistrator</property>
<!-- Custom properties for the EtcdRegistrator class you are using, JSON. @see EtcdRegistrator implementation
class for details on the configuration unique to it.
The configuration below is for LocalDiscoveryNodeRegistrator:
- preferPublicAddress (true|false) : use the public IP determined by
hazelcast (if not null) over the private IP
-->
<property name="etcd-registrator-config"><![CDATA[
{
"preferPublicAddress":false
}
]]></property>
<!-- The configuration below is for ExplicitIpPortRegistrator:
- registerWithIpAddress: register with this IP in Etcd
- registerWithPort: register with this PORT in Etcd
<property name="etcd-registrator-config"><![CDATA[
{
"registerWithIpAddress":"192.168.0.208",
"registerWithPort":5701
}
]]></property>
-->
</properties>
</discovery-strategy>
</discovery-strategies>
</join>
</network>
</hazelcast>