All Downloads are FREE. Search and download functionalities are using the official Maven repository.

o.hazelcast-consul-discovery-spi.2.0-RC1-20210205.source-code.explicitIpPortRegistrator-example.xml Maven / Gradle / Ivy

Go to download

hazelcast-consul-discovery-spi - Consul based discovery strategy SPI for Hazelcast enabled applications

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<hazelcast id="hazelcast-consul-discovery" 
           xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-4.0.xsd"
           xmlns="http://www.hazelcast.com/schema/config"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
           
    <!-- NOTE! any XML value below can be variables that will be fetched from
         -D system properties @see http://docs.hazelcast.org/docs/3.6-EA/manual/html-single/index.html#using-variables  -->
    <cluster-name>hazelcast-consul-discovery-spi</cluster-name>

    <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" />
              
             <discovery-strategies>
        
               <discovery-strategy enabled="true"
                   class="org.bitsofinfo.hazelcast.discovery.consul.ConsulDiscoveryStrategy">
        
                 <properties>
                      <property name="consul-host">localhost</property>
                      <property name="consul-port">8500</property>
                      <property name="consul-service-name">hz-discovery-test-cluster</property>
                      <property name="consul-healthy-only">true</property>
                      <property name="consul-service-tags">hazelcast,test1</property>
                      <property name="consul-discovery-delay-ms">10000</property>
                      
				      <property name="consul-acl-token">761F2179-0479-445A-9E75-68E63AEE8816</property>
				      <property name="consul-ssl-enabled">true</property>
					  <property name="consul-ssl-server-cert-file-path">/path/to/consul.self.signed.cert</property>
					  <property name="consul-ssl-server-cert-base64">b64EncodedSelfSignedConsulTLSCertString</property>
				      <property name="consul-ssl-server-hostname-verify">false</property>

                      <property name="consul-registrator">org.bitsofinfo.hazelcast.discovery.consul.ExplicitIpPortRegistrator</property>
                      <property name="consul-registrator-config"><![CDATA[
                                                                      {
                                                                        "registerWithIpAddress":"192.168.1.102",
                                                                        "registerWithPort":5701, 
                                                                        "healthCheckProvider":"org.bitsofinfo.hazelcast.discovery.consul.ScriptHealthCheckBuilder",
                                                                        "healthCheckScript":"nc -z #MYIP #MYPORT",
                                                                        "healthCheckScriptIntervalSeconds":30,
                                                                        "healthCheckHttp":"http://#MYIP:80",
                                                                        "healthCheckHttpIntervalSeconds":30,
																		"healthCheckTcp":"#MYIP:#MYPORT",
																		"healthCheckTcpIntervalSeconds":30
                                                                      }
                                                                  ]]></property>
                
                 </properties>
               </discovery-strategy>
             </discovery-strategies>
              
        </join>
    </network>
</hazelcast>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy