我正在尝试用这个可编程配置启动几个节点
public class Server {
private Server() {
//TODO: MapStore/MapLoader config here
MapConfig accountMapConfig = new MapConfig(PropertiesLoader.ACCOUNT_MAP);
MapStoreConfig accountStoreConfig = new MapStoreConfig();
accountStoreConfig.setEnabled(true)
.setClassName("com.hazelcast.certification.domainstore.AccountStore")
.setInitialLoadMode(MapStoreConfig.InitialLoadMode.EAGER);
accountMapConfig.setMapStoreConfig(accountStoreConfig);
MapConfig merchantMapConfig = new MapConfig(PropertiesLoader.MERCHANT_MAP);
MapStoreConfig merchantStoreConfig = new MapStoreConfig();
merchantStoreConfig.setEnabled(true)
.setInitialLoadMode(MapStoreConfig.InitialLoadMode.EAGER)
.setClassName("com.hazelcast.certification.domainstore.MerchantStore");
merchantMapConfig.setMapStoreConfig(merchantStoreConfig);
MapConfig mRules = new MapConfig();
mRules.setName(PropertiesLoader.RULESRESULT_MAP);
//TODO: Config for WAN Replication
Config platform_config = new Config();
platform_config.setClusterName("source");
NetworkConfig networkConfig = platform_config.getNetworkConfig();
JoinConfig join = networkConfig.getJoin();
join.getMulticastConfig().setEnabled(false);
InterfacesConfig interfaceConfig = networkConfig.getInterfaces();
interfaceConfig.setEnabled( true )
.addInterface( "192.168.0.13" );
//TODO: Platform config here
platform_config.setLicenseKey(License.KEY_HE);
platform_config.addMapConfig(accountMapConfig);
platform_config.addMapConfig(merchantMapConfig);
platform_config.addMapConfig(mRules);
platform_config.getMapConfig(PropertiesLoader.ACCOUNT_MAP)
.setWanReplicationRef(new WanReplicationRef().setName("wololo"));
platform_config.getMapConfig(PropertiesLoader.MERCHANT_MAP)
.setWanReplicationRef(new WanReplicationRef().setName("wololo"));
platform_config.getMapConfig(PropertiesLoader.RULESRESULT_MAP)
.setWanReplicationRef(new WanReplicationRef().setName("wololo"));
WanReplicationConfig wanReplicationConfig = new WanReplicationConfig()
.setName("wololo");
WanBatchPublisherConfig batchPublisherConfig = new WanBatchPublisherConfig()
.setClusterName("jet")
.setTargetEndpoints("192.168.0.13:5703");
wanReplicationConfig.addBatchReplicationPublisherConfig(batchPublisherConfig);
platform_config.addWanReplicationConfig(wanReplicationConfig);
Hazelcast.newHazelcastInstance(platform_config);
}
public static void main(String[] args) {
new Server();
}
}
和我不知道为什么我得到2个主要错误,当我启动实例。
第一个:
SEVERE: [192.168.0.13]:5701 [source] [4.3] Service with name 'hz:impl:jetService' not found!
com.hazelcast.core.HazelcastException: Service with name 'hz:impl:jetService' not found!
at com.hazelcast.spi.impl.NodeEngineImpl.getService(NodeEngineImpl.java:377)
at com.hazelcast.spi.impl.operationservice.Operation.getService(Operation.java:409)
at com.hazelcast.jet.impl.operation.AsyncOperation.beforeRun(AsyncOperation.java:45)
at com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:214)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl.run(OperationExecutorImpl.java:406)
at com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl.runOrExecute(OperationExecutorImpl.java:433)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.doInvokeLocal(Invocation.java:596)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.doInvoke(Invocation.java:581)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.invoke0(Invocation.java:540)
at com.hazelcast.spi.impl.operationservice.impl.Invocation.invoke(Invocation.java:237)
at com.hazelcast.spi.impl.operationservice.impl.InvocationBuilderImpl.invoke(InvocationBuilderImpl.java:59)
at com.hazelcast.client.impl.protocol.task.AbstractInvocationMessageTask.processInternal(AbstractInvocationMessageTask.java:38)
at com.hazelcast.client.impl.protocol.task.AbstractAsyncMessageTask.processMessage(AbstractAsyncMessageTask.java:71)
at com.hazelcast.client.impl.protocol.task.AbstractMessageTask.initializeAndProcessMessage(AbstractMessageTask.java:152)
at com.hazelcast.client.impl.protocol.task.AbstractMessageTask.run(AbstractMessageTask.java:115)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
at com.hazelcast.internal.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:64)
at com.hazelcast.internal.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:80)
Caused by: com.hazelcast.spi.exception.ServiceNotFoundException: Service with name 'hz:impl:jetService' not found!
... 20 more
和第二个:
我不知道为什么我会收到垃圾邮件和更多关于连接的垃圾邮件,试图将节点与某个地址连接到一个无尽的循环
oct. 19, 2021 10:56:51 A. M. com.hazelcast.client.impl.ClientEngine
INFO: [192.168.0.13]:5701 [source] [4.3] Applying a new client selector :ClientSelector{any}
oct. 19, 2021 10:56:52 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=3, /192.168.0.13:5701->/192.168.0.13:52705, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid 6930d85e-fe3b-4758-8712-8015a6022fc4, authentication failed
oct. 19, 2021 10:56:52 A. M. com.hazelcast.internal.nio.tcp.TcpIpConnection
INFO: [192.168.0.13]:5701 [source] [4.3] Connection[id=3, /192.168.0.13:5701->/192.168.0.13:52705, qualifier=null, endpoint=null, alive=false, connectionType=NONE] closed. Reason: Connection closed by the other side
oct. 19, 2021 10:56:52 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=4, /192.168.0.13:5701->/192.168.0.13:52707, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid f6772096-f34b-4292-88db-d809d070604d, authentication failed
oct. 19, 2021 10:56:52 A. M. com.hazelcast.internal.nio.tcp.TcpIpConnection
INFO: [192.168.0.13]:5701 [source] [4.3] Connection[id=4, /192.168.0.13:5701->/192.168.0.13:52707, qualifier=null, endpoint=null, alive=false, connectionType=NONE] closed. Reason: Connection closed by the other side
oct. 19, 2021 10:56:53 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=5, /192.168.0.13:5701->/192.168.0.13:52711, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid 6930d85e-fe3b-4758-8712-8015a6022fc4, authentication failed
oct. 19, 2021 10:56:53 A. M. com.hazelcast.internal.nio.tcp.TcpIpConnection
INFO: [192.168.0.13]:5701 [source] [4.3] Connection[id=5, /192.168.0.13:5701->/192.168.0.13:52711, qualifier=null, endpoint=null, alive=false, connectionType=NONE] closed. Reason: Connection closed by the other side
oct. 19, 2021 10:56:54 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=6, /192.168.0.13:5701->/192.168.0.13:52712, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid 6930d85e-fe3b-4758-8712-8015a6022fc4, authentication failed
oct. 19, 2021 10:56:54 A. M. com.hazelcast.internal.nio.tcp.TcpIpConnection
INFO: [192.168.0.13]:5701 [source] [4.3] Connection[id=6, /192.168.0.13:5701->/192.168.0.13:52712, qualifier=null, endpoint=null, alive=false, connectionType=NONE] closed. Reason: Connection closed by the other side
oct. 19, 2021 10:56:55 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=7, /192.168.0.13:5701->/192.168.0.13:52715, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid 6930d85e-fe3b-4758-8712-8015a6022fc4, authentication failed
oct. 19, 2021 10:56:55 A. M. com.hazelcast.internal.nio.tcp.TcpIpConnection
INFO: [192.168.0.13]:5701 [source] [4.3] Connection[id=7, /192.168.0.13:5701->/192.168.0.13:52715, qualifier=null, endpoint=null, alive=false, connectionType=NONE] closed. Reason: Connection closed by the other side
oct. 19, 2021 10:56:56 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=8, /192.168.0.13:5701->/192.168.0.13:52718, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid 6930d85e-fe3b-4758-8712-8015a6022fc4, authentication failed
oct. 19, 2021 10:56:56 A. M. com.hazelcast.internal.nio.tcp.TcpIpConnection
INFO: [192.168.0.13]:5701 [source] [4.3] Connection[id=8, /192.168.0.13:5701->/192.168.0.13:52718, qualifier=null, endpoint=null, alive=false, connectionType=NONE] closed. Reason: Connection closed by the other side
oct. 19, 2021 10:56:56 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=9, /192.168.0.13:5701->/192.168.0.13:52719, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid 6930d85e-fe3b-4758-8712-8015a6022fc4, authentication failed
oct. 19, 2021 10:56:56 A. M. com.hazelcast.internal.nio.tcp.TcpIpConnection
INFO: [192.168.0.13]:5701 [source] [4.3] Connection[id=9, /192.168.0.13:5701->/192.168.0.13:52719, qualifier=null, endpoint=null, alive=false, connectionType=NONE] closed. Reason: Connection closed by the other side
oct. 19, 2021 10:56:57 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=10, /192.168.0.13:5701->/192.168.0.13:52721, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid 6930d85e-fe3b-4758-8712-8015a6022fc4, authentication failed
oct. 19, 2021 10:56:57 A. M. com.hazelcast.internal.nio.tcp.TcpIpConnection
INFO: [192.168.0.13]:5701 [source] [4.3] Connection[id=10, /192.168.0.13:5701->/192.168.0.13:52721, qualifier=null, endpoint=null, alive=false, connectionType=NONE] closed. Reason: Connection closed by the other side
oct. 19, 2021 10:56:58 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=11, /192.168.0.13:5701->/192.168.0.13:52722, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid 6930d85e-fe3b-4758-8712-8015a6022fc4, authentication failed
oct. 19, 2021 10:56:58 A. M. com.hazelcast.internal.nio.tcp.TcpIpConnection
INFO: [192.168.0.13]:5701 [source] [4.3] Connection[id=11, /192.168.0.13:5701->/192.168.0.13:52722, qualifier=null, endpoint=null, alive=false, connectionType=NONE] closed. Reason: Connection closed by the other side
oct. 19, 2021 10:56:58 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=12, /127.0.0.1:5701->/127.0.0.1:52724, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid 244377e7-395e-4972-9a3c-b9d03fcdec50, authentication failed
oct. 19, 2021 10:56:58 A. M. com.hazelcast.internal.nio.tcp.TcpIpConnection
INFO: [192.168.0.13]:5701 [source] [4.3] Connection[id=12, /127.0.0.1:5701->/127.0.0.1:52724, qualifier=null, endpoint=null, alive=false, connectionType=NONE] closed. Reason: Connection closed by the other side
oct. 19, 2021 10:56:58 A. M. com.hazelcast.client.impl.protocol.task.AuthenticationMessageTask
WARNING: [192.168.0.13]:5701 [source] [4.3] Received auth from Connection[id=13, /127.0.0.1:5701->/127.0.0.1:52726, qualifier=null, endpoint=null, alive=true, connectionType=NONE] with clientUuid c1c696af-7e7c-4e63-8062-240baeca9c7f, authentication failed
我不想要一个解决方案我只是想知道当我试图启动一个节点时是否会发生这种情况。
源集群定义为
Config platform_config = new Config();
platform_config.setClusterName("source");
interfaceConfig.setEnabled( true )
.addInterface( "192.168.0.13" );
所以可能运行在192.168.0.13上。
您的目标集群有这个定义
WanBatchPublisherConfig batchPublisherConfig = new WanBatchPublisherConfig()
.setClusterName("jet")
.setTargetEndpoints("192.168.0.13:5703");
所以两者都运行在同一个主机上。
这很好,但是源集群没有指定目标端口范围,因此在启动时将默认向上探测5701。因此,它将在5703上找到目标集群,并尝试将其作为同一个集群而不是作为两个WAN连接的集群加入。
更简单的解决方案是为每个不重叠的集群设置一个端口范围。使用config.getNetworkConfig().setPort(i)