在 Azure 应用服务中的嵌入式模式下运行的 Hazelcast 实例不协调



我在 Azure 应用服务中运行带有 hazelcast IMDG 3.11.1 的春季启动应用扩展到 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 Discovery插件
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 节点启用群集节点发现?

@Mr.Arjun,不是现在,但我正在为 Hazelcast 创建一个新的 Azure Discovery 插件版本,该插件使用 Azure REST API,并且也希望添加此功能(为 Hazelcast 工作)。您能否在 Hazelcast Azure GitHub 存储库中为此打开一个 github 问题:https://github.com/hazelcast/hazelcast-azure

最新更新