使用TCPIP在多节点码头环境中进行Hazelcast [英] Hazelcast in multinode docker environments with TCPIP

查看:745
本文介绍了使用TCPIP在多节点码头环境中进行Hazelcast的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在努力解决以下问题:



我有一个可以在集群中运行的Java EE应用程序(实际上是这样)。对于节点之间的数据交换,我使用了Hazelcast 3.3.3。
由于我们的客户害怕UDP我们使用TCP。
所以我每个节点配置3个hazelcast参数:
要使用的网络接口,端口和集群的成员。
在现实生活中(不是码头环境)一切都有效。
现在我想将我的Java EE服务器放入码头集装箱(每个节点一个),并通过Hazelcast链接。



我所做的是: p>

在运行docker容器的主机上,我创建了几个虚拟网络接口(172.21.0.X)。
为每个docker容器我提供网络映射,如-p 172.21.0.X:5190:5190(5190是我用于Hazelcast的端口)



我的Java EE应用程序在容器内我配置了hazelcast来监听界面172.21.0.X,端口5190成员172.21.0.X:5190,......
现在的问题是:docker会分配一个每个cointainer的内部IP号码。提前,我无法确定泊车员将分配哪个IP号码。
它绝对不是我想要使用的IP(172.21.0.X)。
Hazelcast启动并告诉我:找不到匹配的界面。当然不是。
Hazelcast将检查docker容器的IP接口,就像172.4.XX一样。这不适合我给hazelcast的配置(使用172.21.XX)。



到目前为止,似乎无法指定码头的内部IP号码容器。我可以从运行的容器查询它,但是这是太晚了,因为我需要在启动容器之前对Java EE服务器进行配置。



任何提示那?是否可以使用TCPIP来运行Hazelcast?

解决方案

这个线程和Nick Scavelli的答案是我认为你是



https://groups.google.com/forum/#!msg/vertx/MvKcz_aTaWM/QM6CfllX9HQJ


I am currently struggling with the following problem:

I have a Java EE application that shall be able to run in a cluster (it actually does). For the data exchange between the nodes I use Hazelcast 3.3.3. Since our customers are afraid of UDP we use TCP. So I configure 3 hazelcast parameters per node: The network interface to use, the port and the members of the cluster. In real life (not a docker environment) everything works. Now I want to put my Java EE servers into docker containers (one per node) and also link them via Hazelcast.

What I did was:

On the host machine running the docker containers I created several virtual network interfaces (172.21.0.X). for each docker container I gave network mappings like -p 172.21.0.X:5190:5190 (5190 is the port I use for Hazelcast)

In my Java EE application within the container I configured hazelcast to listen to interface 172.21.0.X, port 5190 members 172.21.0.X:5190,...... The problem now is: docker will assign an internal IP number to each cointainer. In advance I cannot be sure which IP number docker will assign. It definitly is not the IP I would like to use (172.21.0.X). Hazelcast starts up and tells me: no matching interface found. Of course not. Hazelcast will check the IP interfaces of the docker container which is something like 172.4.XX. This does not fit to the config I gave to hazelcast (use 172.21.X.X).

So far it seems not to be possible to specify the internal IP number of a docker container. I could query it from a running container, but that is too late since I need to do the configuration of my Java EE server BEFORE I start the container.

Any hints on that? Is it possible to get the Hazelcast running with TCPIP?

解决方案

This thread and the answer from Nick Scavelli is what I think you are looking for.

https://groups.google.com/forum/#!msg/vertx/MvKcz_aTaWM/QM6CfllX9HQJ

这篇关于使用TCPIP在多节点码头环境中进行Hazelcast的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆