我有一个项目,我正在执行用 Java 编写的彼此独立的单个任务,并在跨 LAN 的计算机上执行任务,以有效地解决任务。如果任务是线程安全的,它们将作为线程执行,否则作为新的 JVM(在原始计算机上确定)执行,并且结果将发送回原始计算机进行输出。
我在谷歌上搜索了这个主题,但一直对网格、集群和分布式计算感到困惑。在上述场景中,如果有的话我应该使用哪一个?
应该注意的是,LAN 上的计算机正在运行 Windows 7,这意味着无论我找到什么解决方案,它都需要在 Windows 上运行(某些解决方案可能仅限于 *nix)。
最佳答案
我理解它如何让你对你提到的三个词感到困惑,但它们不能相互比较,让我解释一下原因;
维基百科:
Cluster: A computer cluster consists of a set of loosely or tightly connected computers that work together so that, in many respects, they can be viewed as a single system
Grid: Grid computing is the collection of computer resources from multiple locations to reach a common goal.
Distributed Computing: Distributed computing is a field of computer science that studies distributed systems. A distributed system is a software system in which components located on networked computers communicate and coordinate their actions by passing messages.
- 因此,集群基本上是(在网络或软件层)许多计算机充当一台计算机。
- 网格(计算)使用集群来执行任务。
- 分布式计算是执行任务的一种方式。
现在您需要的是使用 Hadoop 或 Apache Spark 来完成此类任务,或者使用任何内存中的 DataGrid 来实现此类目的,但这可能有点矫枉过正,除非您知道自己到底在做什么。
关于java - 我应该在这个项目中使用什么?集群、网格还是分布式计算?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32416322/