在azure应用程序服务中以嵌入模式运行的Hazelcast实例异常运行

时间:2019-02-01 09:54:44

标签: azure spring-boot hazelcast azure-web-app-service

我已经在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节点启用群集节点发现吗?

1 个答案:

答案 0 :(得分:0)

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