集群中2个节点之间的通信 [英] Communication between 2 nodes in a cluster

查看:834
本文介绍了集群中2个节点之间的通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚如何实现:

I am trying to figure out how this will work out:


  1. 通过 NIO / BIO进行客户端-服务器通信

  2. 通过 JGroups 进行服务器-服务器通信(复制,成员身份等)(复制数据可能会很麻烦?)

  1. client-server communication via NIO/BIO
  2. Server-server communication (replication, membership etc) via JGroups (replication of data can be a pain?)

您有什么建议,使用这种架构的利弊,为什么选择jgroups,还有其他选择?

What are your suggestion, pros/cons of using such an architecture, why go for jgroups, any alternatives?

我应该使用本机NIO还是使用Mina或Netty之类的库?

Should I go with native NIO or use some libraries like Mina or Netty?

更新


  1. 没有REST,它不是Web服务器。我正在建立一个像分布式数据库的发电机。

  2. activeMQ就像我认为的JMS,在那里我将出现单点故障。 JGroups解决了这个问题,对吧?


推荐答案

我想知道为什么要实现二进制协议用于客户端-服务器通信?我的建议是使用REST或WebServices。与专有的二进制协议相比,它具有巨大的优势。

I wonder why you you want to implement binary protocol for client-server communication? My advice is to go with REST or WebServices. It has huge advantages compared to proprietary binary protocol.

关于服务器之间的通信...有很多选择,我想知道为什么您选择了JGroups。您能详细说明一下吗?我建议您使用某些消息传递解决方案,例如JMS。有很多可用的实现,例如 ActiveMQ 。它将很好地使服务器彼此分离。

About server-server communication... There are huge number of choices and I wonder why you have chosen JGroups. Can you elaborate on this? I will advice you to go with some messaging solution like JMS. There are a lot of available implementation like ActiveMQ. It will nicely decouple servers from each other.

如果您需要维护共享的配置信息,命名以及在服务器之间进行分布式同步,则可以查看 Apache ZooKeeper 项目。

If you need to maintain shared configuration information, naming, have distributed synchronization between servers you can look at Apache ZooKeeper project.

如果您的服务器部署在Amazon EC2实例上,那么我认为最好的解决方案是使用SQS和/或SNS服务进行服务器之间的通信。

If your servers are deployed at Amazon EC2 instances, than I think the best solution is to use SQS and/or SNS services for server-server communication.

您可以使用 Terracotta 复制服务器的状态(仍然建议您使服务器尽可能地变为无状态)。

You can use Terracotta for replication of your server's state (still I will recommend you to make your servers as stateless as possible).

但是,建议更具体的内容确实很难,因为您也没有描述您的系统或对它的要求。我认为这将非常有帮助!

But it's really hard to advice anything more concrete because you have not described neither your system nor requirements to it. I think it would be very helpful!

这篇关于集群中2个节点之间的通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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