【发布时间】:2019-02-01 19:20:39
【问题描述】:
我有运行在 azure 应用服务中的 hazelcast IMDG 3.11.1 的 Spring Boot 应用,扩展至 4 个实例。
1. build.gradle dependencies
compile 'com.hazelcast:hazelcast-azure:1.2.1'
compile 'com.hazelcast:hazelcast:3.11.1'
compile 'com.hazelcast:hazelcast-spring:3.11.1'
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'org.springframework.boot:spring-boot-starter-web'
尝试使用 hazelcast-azure 发现插件 2. hazelcast.xml
<?xml version="1.0" encoding="UTF-8"?>
<hazelcast
xsi:schemaLocation="http://www.hazelcast.com/schema/config 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">
<group>
<name>${hazelcast.environment.name}</name>
<password>${hazelcast.environment.password}</password>
</group>
<properties>
<property name="hazelcast.discovery.enabled">true</property>
</properties>
<network>
<port auto-increment="false">5701</port>
<join>
<tcp-ip enabled="false" />
<multicast enabled="false"/>
<aws enabled="false" />
<discovery-strategies>
<!-- class equals to the DiscoveryStrategy not the factory! -->
<discovery-strategy enabled="true" class="com.hazelcast.azure.AzureDiscoveryStrategy">
<properties>
<property name="client-id">${platform.azure.client-id}</property>
<property name="client-secret">${platform.azure.client-secret}</property>
<property name="tenant-id">${platform.azure.client-domain}</property>
<property name="subscription-id">${platform.azure.subscription}</property>
<property name="cluster-id">${hazelcast.environment.name}</property>
<property name="group-name">${hazelcast.environment.name}</property>
</properties>
</discovery-strategy>
</discovery-strategies>
</join>
</network>
...
My Map list
...
</hazelcast>
深入挖掘 azure 插件允许发现专用集群,即 hazelcast 集群的客户端-服务器模式。
是否有任何方法可以为在 Azure 应用服务内以嵌入模式运行的 hazelcast 节点启用集群节点发现?
【问题讨论】:
标签: azure spring-boot hazelcast azure-web-app-service