2017-10-04 4 views
0

제 질문은 hazelcast-client 설정에 관한 것입니다. 올바르게 이해하면 클라이언트가 AWS api에서 hazelcast 서버 노드 IP를 자동으로 가져오고, 문제는 연결 시도조차하지 않습니다.AWS의 Hazelcast-client 설정

여기에 몇 가지 로그가 있습니다.

Caused by: java.lang.IllegalStateException: Unable to connect to any address in the config! The following addresses were tried: [] 
    at com.hazelcast.client.spi.impl.ClusterListenerSupport.connectToCluster(ClusterListenerSupport.java:178) 
    at com.hazelcast.client.spi.impl.ClientClusterServiceImpl.start(ClientClusterServiceImpl.java:189) 

도 여기

<bean id="hazelcastInstance" class="com.hazelcast.client.HazelcastClient" factory-method="newHazelcastClient"> 
     <constructor-arg> 
      <bean class="com.hazelcast.client.config.ClientConfig"> 
       <property name="groupConfig"> 
        <bean class="com.hazelcast.config.GroupConfig"> 
         <property name="name" value="dev"/> 
        </bean> 
        </property> 

        <property name="properties"> 
         <props> 
         <prop key="hazelcast.icmp.enabled">true</prop> 
         </props> 
        </property> 
       <property name="networkConfig"> 
        <bean class="com.hazelcast.client.config.ClientNetworkConfig"> 

        <property name="awsConfig"> 
          <bean class="com.hazelcast.client.config.ClientAwsConfig"> 
           <property name="insideAws" value="true" /> 
           <property name="enabled" value="${hazelcast.aws.enabled:false}" /> 
           <property name="region" value="${hazelcast.aws.region:set-me}" /> 
           <property name="accessKey"value="key" /> 

           <property name="secretKey" value="secret"/> 


           <property name="hostHeader" value="ec2.amazonaws.com"/> 
           <property name="iamRole" value="${hazelcast.aws.iam.role:#{null}}"/> 
           <!-- <property name="securityGroupName" value="${hazelcast.aws.securityGroupName:#{null}}" /> --> 
           <property name="tagKey" value="${hazelcast.aws.tagKey:hazelcast-cluster}" /> 
           <property name="tagValue" value="${hazelcast.aws.tagValue:#{null}}" /> 
           <property name="connectionTimeoutSeconds" value="${hazelcast.aws.connectionTimeout:15}" /> 

          </bean> 
         </property> 
        </bean> 
       </property> 
      </bean> 

     </constructor-arg> 
    </bean> 

는 서버 IP를 강제로 시도 클라이언트 conifig에게있어, 그 작동합니다. 서버 ips를 자동으로 발견하려면 클라이언트가 필요합니다. 어떤 단서?

답변

0

클라이언트가 AWS (또는 다른 클라우드)에서 클러스터를 검색하도록하려면 검색 플러그인 메커니즘을 사용해야합니다. 이전 AWS 발견은 회원 전용이었습니다.

참조하십시오 https://github.com/hazelcast/hazelcast-aws

AWS에
+1

SPI 발견하지 작업, 감사합니다! – vincpel