cassandra nosql 数据库中的节点、集群和数据中心有什么区别? [英] What are the differences between a node, a cluster and a datacenter in a cassandra nosql database?

查看:34
本文介绍了cassandra nosql 数据库中的节点、集群和数据中心有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 datastax ops 中心为学校项目复制 cassandra nosql 数据库中的数据.从我读到的,有三个关键字:集群、节点和数据中心,据我所知,一个节点中的数据可以复制到另一个节点中,该节点存在于另一个集群中.并且所有包含相同(重复)数据的节点组成一个数据中心.是吗?

I am trying to duplicate data in a cassandra nosql database for a school project using datastax ops center. From what I have read, there is three keywords: cluster, node, and datacenter, and from what I have understand, the data in a node can be duplicated in another node, that exists in another cluster. And all the nodes that contains the same (duplicated) data compose a datacenter. Is that right?

如果不是,有什么区别?

If it is not, what is the difference?

推荐答案

Cassandra 中元素的层次结构是:

The hierarchy of elements in Cassandra is:

  • 集群
    • 数据中心
      • 机架
        • 服务器
          • 节点(更准确地说,是一个 vnode)

          集群是数据中心的集合.

          A Cluster is a collection of Data Centers.

          数据中心是机架的集合.

          A Data Center is a collection of Racks.

          机架是服务器的集合.

          一个服务器默认包含 256 个虚拟节点(或 vnodes).

          A Server contains 256 virtual nodes (or vnodes) by default.

          vnode 是服务器内的数据存储层.

          A vnode is the data storage layer within a server.

          注意:服务器是 Cassandra 软件.服务器安装在机器上,其中机器可以是物理服务器、EC2 实例或类似的.

          Note: A server is the Cassandra software. A server is installed on a machine, where a machine is either a physical server, an EC2 instance, or similar.

          现在专门解决您的问题.

          Now to specifically address your questions.

          单个数据单元称为分区.是的,分区是跨多个节点复制的.分区的每个副本称为一个副本.

          An individual unit of data is called a partition. And yes, partitions are replicated across multiple nodes. Each copy of the partition is called a replica.

          在多数据中心集群中,复制是按数据中心进行的.例如,如果您在旧金山有一个名为 dc-sf 的数据中心,在纽约有另一个名为 dc-ny 的数据中心,那么您可以控制每个数据中心的副本数量.

          In a multi-data center cluster, the replication is per data center. For example, if you have a data center in San Francisco named dc-sf and another in New York named dc-ny then you can control the number of replicas per data center.

          例如,您可以将 dc-sf 设置为 3 个副本,将 dc-ny 设置为 2 个副本.

          As an example, you could set dc-sf to have 3 replicas and dc-ny to have 2 replicas.

          这些数字称为复制因子.您可以特别说 dc-sf 的复制因子为 3,而 dc-ny 的复制因子为 2.简单来说,dc-sf 将具有分布在三个 vnode 上的 3 个数据副本,而 dc-sf 将具有2 个数据副本分布在两个 vnode 上.

          Those numbers are called the replication factor. You would specifically say dc-sf has a replication factor of 3, and dc-ny has a replication factor of 2. In simple terms, dc-sf would have 3 copies of the data spread across three vnodes, while dc-sf would have 2 copies of the data spread across two vnodes.

          虽然默认情况下每个服务器有 256 个 vnode,但 Cassandra 足够聪明,可以选择存在于不同物理服务器上的 vnode.

          While each server has 256 vnodes by default, Cassandra is smart enough to pick vnodes that exist on different physical servers.

          总结:

          • 跨多个虚拟节点复制数据(每个服务器默认包含 256 个虚拟节点)
          • 数据的每个副本称为一个副本
          • 数据的单位称为分区
          • 复制由每个数据中心控制

          这篇关于cassandra nosql 数据库中的节点、集群和数据中心有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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