Проблема при запуске демонстрационного приложения Hazelcast - PullRequest
0 голосов
/ 07 октября 2019

Я новичок в сетке данных в памяти и Hazelcast. Я пробовал демонстрационное приложение на официальном веб-сайте.

https://training.hazelcast.com/demo-getting-started-with-hazelcast-imdg/277088/scorm/f2u8hre5zf9p

В нем упоминалось, что при многократном запуске приложения оно должно добавлять членов в один и тот же кластер.

Однако при повторном запуске программы кажется, что новый член не добавлен в тот же кластер.

Хотелось бы узнать, есть ли какие-либо возможные проблемы с моей настройкой, спасибо.

Окружающая среда:Eclipse IDEJDK 13Hazelcast 3.12.2

1-й запуск:

Oct 07, 2019 8:35:55 PM com.hazelcast.instance.HazelcastInstanceFactory
WARNING: Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:
 --add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
Oct 07, 2019 8:35:55 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [3.12.2] Prefer IPv4 stack is true, prefer IPv6 addresses is false
Oct 07, 2019 8:35:55 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [3.12.2] Picked [192.168.0.211]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
Oct 07, 2019 8:35:56 PM com.hazelcast.system
INFO: [192.168.0.211]:5701 [dev] [3.12.2] Hazelcast 3.12.2 (20190802 - e34b163) starting at [192.168.0.211]:5701
Oct 07, 2019 8:35:56 PM com.hazelcast.system
INFO: [192.168.0.211]:5701 [dev] [3.12.2] Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved.
Oct 07, 2019 8:35:56 PM com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator
INFO: [192.168.0.211]:5701 [dev] [3.12.2] Backpressure is disabled
Oct 07, 2019 8:35:56 PM com.hazelcast.instance.Node
INFO: [192.168.0.211]:5701 [dev] [3.12.2] Creating MulticastJoiner
Oct 07, 2019 8:35:56 PM com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl
INFO: [192.168.0.211]:5701 [dev] [3.12.2] Starting 16 partition threads and 9 generic threads (1 dedicated for priority tasks)
Oct 07, 2019 8:35:56 PM com.hazelcast.internal.diagnostics.Diagnostics
INFO: [192.168.0.211]:5701 [dev] [3.12.2] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
Oct 07, 2019 8:35:56 PM com.hazelcast.core.LifecycleService
INFO: [192.168.0.211]:5701 [dev] [3.12.2] [192.168.0.211]:5701 is STARTING
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.hazelcast.internal.networking.nio.SelectorOptimizer (file:/Users/patrick/.m2/repository/com/hazelcast/hazelcast/3.12.2/hazelcast-3.12.2.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of com.hazelcast.internal.networking.nio.SelectorOptimizer
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Oct 07, 2019 8:35:58 PM com.hazelcast.internal.cluster.ClusterService
INFO: [192.168.0.211]:5701 [dev] [3.12.2] 

Members {size:1, ver:1} [
    Member [192.168.0.211]:5701 - 5d8492ad-df09-46fc-8420-5d00784204d9 this
]

Oct 07, 2019 8:35:58 PM com.hazelcast.core.LifecycleService
INFO: [192.168.0.211]:5701 [dev] [3.12.2] [192.168.0.211]:5701 is STARTED
Oct 07, 2019 8:35:58 PM com.hazelcast.internal.partition.impl.PartitionStateManager
INFO: [192.168.0.211]:5701 [dev] [3.12.2] Initializing cluster partition table arrangement...
Customer with key 1: Joe
Map Size: 3
First customer: Tom
Second Customer: Mary
Queue size: 2

2-й запуск:

Oct 07, 2019 8:39:31 PM com.hazelcast.instance.HazelcastInstanceFactory
WARNING: Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:
 --add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
Oct 07, 2019 8:39:31 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [3.12.2] Prefer IPv4 stack is true, prefer IPv6 addresses is false
Oct 07, 2019 8:39:31 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [3.12.2] Picked [192.168.0.211]:5702, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5702], bind any local is true
Oct 07, 2019 8:39:31 PM com.hazelcast.system
INFO: [192.168.0.211]:5702 [dev] [3.12.2] Hazelcast 3.12.2 (20190802 - e34b163) starting at [192.168.0.211]:5702
Oct 07, 2019 8:39:31 PM com.hazelcast.system
INFO: [192.168.0.211]:5702 [dev] [3.12.2] Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved.
Oct 07, 2019 8:39:31 PM com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator
INFO: [192.168.0.211]:5702 [dev] [3.12.2] Backpressure is disabled
Oct 07, 2019 8:39:32 PM com.hazelcast.instance.Node
INFO: [192.168.0.211]:5702 [dev] [3.12.2] Creating MulticastJoiner
Oct 07, 2019 8:39:32 PM com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl
INFO: [192.168.0.211]:5702 [dev] [3.12.2] Starting 16 partition threads and 9 generic threads (1 dedicated for priority tasks)
Oct 07, 2019 8:39:32 PM com.hazelcast.internal.diagnostics.Diagnostics
INFO: [192.168.0.211]:5702 [dev] [3.12.2] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
Oct 07, 2019 8:39:32 PM com.hazelcast.core.LifecycleService
INFO: [192.168.0.211]:5702 [dev] [3.12.2] [192.168.0.211]:5702 is STARTING
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.hazelcast.internal.networking.nio.SelectorOptimizer (file:/Users/patrick/.m2/repository/com/hazelcast/hazelcast/3.12.2/hazelcast-3.12.2.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of com.hazelcast.internal.networking.nio.SelectorOptimizer
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Oct 07, 2019 8:39:34 PM com.hazelcast.internal.cluster.ClusterService
INFO: [192.168.0.211]:5702 [dev] [3.12.2] 

Members {size:1, ver:1} [
    Member [192.168.0.211]:5702 - 10c3d969-f060-4253-8260-5cfc3be87e0f this
]

Oct 07, 2019 8:39:34 PM com.hazelcast.instance.Node
WARNING: [192.168.0.211]:5702 [dev] [3.12.2] Config seed port is 5701 and cluster size is 1. Some of the ports seem occupied!
Oct 07, 2019 8:39:34 PM com.hazelcast.core.LifecycleService
INFO: [192.168.0.211]:5702 [dev] [3.12.2] [192.168.0.211]:5702 is STARTED
Oct 07, 2019 8:39:34 PM com.hazelcast.internal.partition.impl.PartitionStateManager
INFO: [192.168.0.211]:5702 [dev] [3.12.2] Initializing cluster partition table arrangement...
Customer with key 1: Joe
Map Size: 3
First customer: Tom
Second Customer: Mary
Queue size: 2



Ответы [ 2 ]

0 голосов
/ 08 октября 2019

(Обновление от 8 октября 2019 г.)

Не совсем уверен, что произошло, но я смог получить ожидаемый результат после обновления до MacOS Catalina. Не уверен, относится ли это к ОС или нет.

enter image description here

Oct 08, 2019 4:42:20 PM com.hazelcast.instance.HazelcastInstanceFactory
WARNING: Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:
 --add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
Oct 08, 2019 4:42:20 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [3.12.2] Prefer IPv4 stack is true, prefer IPv6 addresses is false
Oct 08, 2019 4:42:20 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [3.12.2] Picked [192.168.0.247]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
Oct 08, 2019 4:42:21 PM com.hazelcast.system
INFO: [192.168.0.247]:5701 [dev] [3.12.2] Hazelcast 3.12.2 (20190802 - e34b163) starting at [192.168.0.247]:5701
Oct 08, 2019 4:42:21 PM com.hazelcast.system
INFO: [192.168.0.247]:5701 [dev] [3.12.2] Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved.
Oct 08, 2019 4:42:21 PM com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator
INFO: [192.168.0.247]:5701 [dev] [3.12.2] Backpressure is disabled
Oct 08, 2019 4:42:21 PM com.hazelcast.instance.Node
INFO: [192.168.0.247]:5701 [dev] [3.12.2] Creating MulticastJoiner
Oct 08, 2019 4:42:21 PM com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl
INFO: [192.168.0.247]:5701 [dev] [3.12.2] Starting 16 partition threads and 9 generic threads (1 dedicated for priority tasks)
Oct 08, 2019 4:42:21 PM com.hazelcast.internal.diagnostics.Diagnostics
INFO: [192.168.0.247]:5701 [dev] [3.12.2] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
Oct 08, 2019 4:42:21 PM com.hazelcast.core.LifecycleService
INFO: [192.168.0.247]:5701 [dev] [3.12.2] [192.168.0.247]:5701 is STARTING
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.hazelcast.internal.networking.nio.SelectorOptimizer (file:/Users/patrick/.m2/repository/com/hazelcast/hazelcast/3.12.2/hazelcast-3.12.2.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of com.hazelcast.internal.networking.nio.SelectorOptimizer
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Oct 08, 2019 4:42:24 PM com.hazelcast.internal.cluster.ClusterService
INFO: [192.168.0.247]:5701 [dev] [3.12.2] 

Members {size:1, ver:1} [
    Member [192.168.0.247]:5701 - 1d3f21e8-0294-434a-84c2-cbf128286987 this
]

Oct 08, 2019 4:42:24 PM com.hazelcast.core.LifecycleService
INFO: [192.168.0.247]:5701 [dev] [3.12.2] [192.168.0.247]:5701 is STARTED
Oct 08, 2019 4:42:24 PM com.hazelcast.internal.partition.impl.PartitionStateManager
INFO: [192.168.0.247]:5701 [dev] [3.12.2] Initializing cluster partition table arrangement...
Customer with key 1: Joe
Map Size: 3
First customer: Tom
Second Customer: Mary
Queue size: 2
Oct 08, 2019 4:42:31 PM com.hazelcast.nio.tcp.TcpIpConnection
INFO: [192.168.0.247]:5701 [dev] [3.12.2] Initialized new cluster connection between /192.168.0.247:5701 and /192.168.0.247:49798
Oct 08, 2019 4:42:37 PM com.hazelcast.internal.cluster.ClusterService
INFO: [192.168.0.247]:5701 [dev] [3.12.2] 

Members {size:2, ver:2} [
    Member [192.168.0.247]:5701 - 1d3f21e8-0294-434a-84c2-cbf128286987 this
    Member [192.168.0.247]:5702 - ccc3af03-5783-4808-b2c1-c709ea94f562
]

Oct 08, 2019 4:42:37 PM com.hazelcast.internal.partition.impl.MigrationManager
INFO: [192.168.0.247]:5701 [dev] [3.12.2] Re-partitioning cluster data... Migration queue size: 271
Oct 08, 2019 4:42:39 PM com.hazelcast.internal.partition.impl.MigrationThread
INFO: [192.168.0.247]:5701 [dev] [3.12.2] All migration tasks have been completed. (lastRepartitionTime=Tue Oct 08 16:42:37 HKT 2019, completedMigrations=271, totalCompletedMigrations=271, elapsedMigrationTime=602ms, totalElapsedMigrationTime=602ms)
0 голосов
/ 07 октября 2019

Возможно, в вашей локальной среде установлено программное обеспечение для виртуализации? Возможно, многоадресный адрес по умолчанию в hazelcast конфликтует. Попробуйте изменить адрес на: 224.0.0.1:

cfg.getNetworkConfig (). GetJoin (). GetMulticastConfig (). SetMulticastGroup ("224.0.0.1");

...