我试图在Azure中使用hazelcast-jclouds.3.7.2发现机制,但是在执行后无法使其发挥作用。
1)没有绑定以@ com.google.inject.name.Named(value = oauth.endpoint)注释的java.lang.String的实现。
在org.jclouds.oauth.v2.config.OAuthModule.oauthEndpoint(OAuthModule.java:63)
1个错误 在org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) 在org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ...更多33 引起原因:com.google.inject.CreationException:Guice创建错误:
1)没有绑定以@ com.google.inject.name.Named(value = oauth.endpoint)注释的java.lang.String的实现。 在org.jclouds.oauth.v2.config.OAuthModule.oauthEndpoint(OAuthModule.java:63)
1个错误 com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435) 在com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:154) 在com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106) 在com.google.inject.Guice.createInjector(Guice.java:95) 在org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:405) 在org.jclouds.ContextBuilder.buildInjector(ContextBuilder.java:328) 在org.jclouds.ContextBuilder.buildView(ContextBuilder.java:615) 在org.jclouds.ContextBuilder.buildView(ContextBuilder.java:595) 在com.hazelcast.jclouds.ComputeServiceBuilder.build(ComputeServiceBuilder.java:207) 在com.hazelcast.jclouds.JCloudsDiscoveryStrategy.start(JCloudsDiscoveryStrategy.java:70) 在com.hazelcast.spi.discovery.impl.DefaultDiscoveryService.start(DefaultDiscoveryService.java:63) 在com.hazelcast.instance.Node.start(Node.java:385) 在com.hazelcast.instance.HazelcastInstanceImpl。(HazelcastInstanceImpl.java:137) 在com.hazelcast.instance.HazelcastInstanceFactory.constructHazelcastInstance(HazelcastInstanceFactory.java:196) 在com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:175) 在com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:125) 在com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:57) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:498) 在org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ...另外34个
以下是hazelcast-jcloud配置
JoinConfig joinConfig = getNetworkConfig().getJoin();
joinConfig.getMulticastConfig().setEnabled(false);
joinConfig.getTcpIpConfig().setEnabled(false);
getProperties().put("hazelcast.discovery.enabled", "true");
DiscoveryConfig discoveryConfig = joinConfig.getDiscoveryConfig();
Map<String, Comparable> properties = new HashMap<String, Comparable>();
properties.put("provider", "azurecompute-arm");
properties.put("identity", "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx");//Principal client ID
properties.put("credential", "xxxxxxxxxxx"); //Principal client secret
properties.put("endpoint", "https://management.azure.com/subscriptions/Subscription id ");
JCloudsDiscoveryStrategyFactory jcloudDiscoveryStrategyFactory = new JCloudsDiscoveryStrategyFactory();
DiscoveryStrategyConfig discoveryStrategyConfig = new DiscoveryStrategyConfig(jcloudDiscoveryStrategyFactory,
properties);
ArrayList<DiscoveryStrategyConfig> discoveryStrategyConfigs = new ArrayList<DiscoveryStrategyConfig>();
discoveryStrategyConfigs.add(discoveryStrategyConfig);
discoveryConfig.setDiscoveryStrategyConfigs(discoveryStrategyConfigs);
请建议是否有解决问题的方法/解决方法。
答案 0 :(得分:0)
hazelcast-jclouds
模块暂时不支持Azure。请在此处跟踪问题:https://github.com/hazelcast/hazelcast-jclouds/issues/10