英文:
Hazelcast: client is shutdown, when I start Hazelcast container on Mac
问题
I have a docker-compose.yml
file:
version: "2"
services:
postgres:
image: postgres:12.4
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=password
ports:
- 5432:5432
hazelcast:
image: hazelcast/hazelcast:3.11
ports:
- 5701:5701
environment:
- JAVA_OPTS=-Dhazelcast.local.publicAddress=localhost:5701
And I have 2 computers: 1 with Ubuntu, 1 with MacOs on ARM.
- After starting Hazelcast container on MacOs, the log:
########################################
# JAVA_OPTS=-Djava.net.preferIPv4Stack=true
# -Dhazelcast.local.publicAddress=localhost:5701
# CLASSPATH=/opt/hazelcast:/opt/hazelcast/*
# starting now....
########################################
+ exec java -server -Djava.net.preferIPv4Stack=true -Dhazelcast.local.publicAddress=localhost:5701 com.hazelcast.core.server.StartServer
Then, I try to run my **Spring-Boot** app.
Log:
hz.client_1 [dev] [3.12.12] HazelcastClient 3.12.12 (20210209 - 35096ec) is SHUTTING_DOWN
hz.client_1 [dev] [3.12.12] Could not connect to any cluster, shutting down the client: Giving up retrying to connect to cluster since the client is shutdown.
hz.client_1 [dev] [3.12.12] HazelcastClient 3.12.12 (20210209 - 35096ec) is SHUTDOWN
- When I start the Hazelcast container on Ubuntu, its log:
########################################
# JAVA_OPTS=-Djava.net.preferIPv4Stack=true -Dhazelcast.local.publicAddress=localhost:5701
# CLASSPATH=/opt/hazelcast:/opt/hazelcast/*
# starting now....
########################################
+ exec java -server -Djava.net.preferIPv4Stack=true -Dhazelcast.local.publicAddress=localhost:5701 com.hazelcast.core.server.StartServer
Feb 23, 2023 12:41:45 PM com.hazelcast.config.XmlConfigLocator INFO: Loading 'hazelcast-default.xml' from classpath.
Feb 23, 2023 12:41:45 PM com.hazelcast.instance.AddressPicker INFO: [LOCAL] [dev] [3.11] Prefer IPv4 stack is true, prefer IPv6 addresses is false
Feb 23, 2023 12:41:45 PM com.hazelcast.instance.AddressPicker INFO: [LOCAL] [dev] [3.11] Picked [172.22.0.2]:5701, using socket ServerSocket[addr=/0.0.0.0, localport=5701], bind any local is true
Feb 23, 2023 12:41:45 PM com.hazelcast.instance.AddressPicker INFO: [LOCAL] [dev] [3.11] Using public address: [localhost]:5701
Feb 23, 2023 12:41:46 PM com.hazelcast.system INFO: [localhost]:5701 [dev] [3.11] Hazelcast 3.11 (20181023 - 1500bbb) starting at [localhost]:5701
Feb 23, 2023 12:41:46 PM com.hazelcast.system INFO: [localhost]:5701 [dev] [3.11] Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
Feb 23, 2023 12:41:46 PM com.hazelcast.instance.Node INFO: [localhost]:5701 [dev] [3.11] A non-empty group password is configured for the Hazelcast member. Starting with Hazelcast version 3.8.2, members with the same group name, but with different group passwords (that do not use authentication) form a cluster. The group password configuration will be removed completely in a future release.
Feb 23, 2023 12:41:46 PM com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator INFO: [localhost]:5701 [dev] [3.11] Backpressure is disabled
Feb 23, 2023 12:41:46 PM com.hazelcast.instance.Node INFO: [localhost]:5701 [dev] [3.11] Creating MulticastJoiner
Feb 23, 2023 12:41:46 PM com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl INFO: [localhost]:5701 [dev] [3.11] Starting 8 partition threads and 5 generic threads (1 dedicated for priority tasks)
Feb 23, 2023 12:41:46 PM com.hazelcast.internal.diagnostics.Diagnostics INFO: [localhost]:5701 [dev] [3.11] Diagnostics disabled. To enable, add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
Feb 23, 2023 12:41:46 PM com.hazelcast.core.LifecycleService INFO: [localhost]:5701 [dev] [3.11] [localhost]:5701 is STARTING
Feb 23, 2023 12:41:49 PM com.hazelcast.internal.cluster.ClusterService INFO: [localhost]:5701 [dev] [3.11] Members {size:1, ver:1} [Member [localhost]:5701 - 704a653c-7a09-4b9e-83cf-85b136c2e6d0 this]
Feb 23, 2023 12:41:49 PM com.hazelcast.core.LifecycleService INFO: [localhost]:5701 [dev] [3.11] [localhost]:5701 is STARTED
And the Spring-Boot app starts successfully.
Why does the same project not work properly on MacOs?
Why does Postgres work correctly?
How can I fix the problem with Hazelcast?
英文:
I have docker-compose.yml file:
version: "2"
services:
postgres:
image: postgres:12.4
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=password
ports:
- 5432:5432
hazelcast:
image: hazelcast/hazelcast:3.11
ports:
- 5701:5701
environment:
- JAVA_OPTS=-Dhazelcast.local.publicAddress=localhost:5701
And I have 2 computers: 1 with ubuntu, 1 with MacOs on arm.
-
After starting Hazelcast container in MacOs, the log:
> ########################################
> # JAVA_OPTS=-Djava.net.preferIPv4Stack=true
> -Dhazelcast.local.publicAddress=localhost:5701<br/>
> # CLASSPATH=/opt/hazelcast:/opt/hazelcast/* <br/>
> # starting now.... <br/>
> ########################################<br/>
> + exec java -server -Djava.net.preferIPv4Stack=true -Dhazelcast.local.publicAddress=localhost:5701 com.hazelcast.core.server.StartServerThen, I try to run my Spring-Boot app.
Log:
> hz.client_1 [dev] [3.12.12] HazelcastClient 3.12.12 (20210209 - 35096ec) is SHUTTING_DOWN<br/> hz.client_1 [dev] [3.12.12] Could not
connect to any cluster, shutting down the client: Giving up retrying
to connect to cluster since client is shutdown.<br/> hz.client_1
[dev] [3.12.12] HazelcastClient 3.12.12 (20210209 - 35096ec) is
SHUTDOWN
2 When I starting Hazelcast container on Ubuntu, its log
########################################
# JAVA_OPTS=-Djava.net.preferIPv4Stack=true -Dhazelcast.local.publicAddress=localhost:5701
# CLASSPATH=/opt/hazelcast:/opt/hazelcast/*
# starting now....
########################################
+ exec java -server -Djava.net.preferIPv4Stack=true -Dhazelcast.local.publicAddress=localhost:5701 com.hazelcast.core.server.StartServer
Feb 23, 2023 12:41:45 PM com.hazelcast.config.XmlConfigLocator
INFO: Loading 'hazelcast-default.xml' from classpath.
Feb 23, 2023 12:41:45 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [3.11] Prefer IPv4 stack is true, prefer IPv6 addresses is false
Feb 23, 2023 12:41:45 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [3.11] Picked [172.22.0.2]:5701, using socket ServerSocket[addr=/0.0.0.0,localport=5701], bind any local is true
Feb 23, 2023 12:41:45 PM com.hazelcast.instance.AddressPicker
INFO: [LOCAL] [dev] [3.11] Using public address: [localhost]:5701
Feb 23, 2023 12:41:46 PM com.hazelcast.system
INFO: [localhost]:5701 [dev] [3.11] Hazelcast 3.11 (20181023 - 1500bbb) starting at [localhost]:5701
Feb 23, 2023 12:41:46 PM com.hazelcast.system
INFO: [localhost]:5701 [dev] [3.11] Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
Feb 23, 2023 12:41:46 PM com.hazelcast.instance.Node
INFO: [localhost]:5701 [dev] [3.11] A non-empty group password is configured for the Hazelcast member. Starting with Hazelcast version 3.8.2, members with the same group name, but with different group passwords (that do not use authentication) form a cluster. The group password configuration will be removed completely in a future release.
Feb 23, 2023 12:41:46 PM com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator
INFO: [localhost]:5701 [dev] [3.11] Backpressure is disabled
Feb 23, 2023 12:41:46 PM com.hazelcast.instance.Node
INFO: [localhost]:5701 [dev] [3.11] Creating MulticastJoiner
Feb 23, 2023 12:41:46 PM com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl
INFO: [localhost]:5701 [dev] [3.11] Starting 8 partition threads and 5 generic threads (1 dedicated for priority tasks)
Feb 23, 2023 12:41:46 PM com.hazelcast.internal.diagnostics.Diagnostics
INFO: [localhost]:5701 [dev] [3.11] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
Feb 23, 2023 12:41:46 PM com.hazelcast.core.LifecycleService
INFO: [localhost]:5701 [dev] [3.11] [localhost]:5701 is STARTING
Feb 23, 2023 12:41:49 PM com.hazelcast.internal.cluster.ClusterService
INFO: [localhost]:5701 [dev] [3.11]
Members {size:1, ver:1} [
Member [localhost]:5701 - 704a653c-7a09-4b9e-83cf-85b136c2e6d0 this
]
Feb 23, 2023 12:41:49 PM com.hazelcast.core.LifecycleService
INFO: [localhost]:5701 [dev] [3.11] [localhost]:5701 is STARTED
And Spring-Boot app starts successfully.
Why does the same project doesn't work proper on MacOs?
Why postrgres works correctly?
How can I fix problem with Hazelcast?
答案1
得分: 0
我使用了Hazelcast 3.12.2,但在Mac M1芯片的Docker上无法运行。更新版本如4.和5的Hazelcast不兼容Hazelcast客户端3.*版本。
但是3.12.12版本的Hazelcast,虽然不针对arm进行优化,却可以正常工作。
英文:
I used Hazelcast:3.12.2 and it doesn’t work in docker on Mac m* chips. Newer versions such 4.* and 5* of Hazelcast don’t work with Hazelcast client 3.* versions.
But 3.12.12 Hazelcast version which also doesn’t not optimised for arm, works properly.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论