Cockroach Design 翻译 ( 九) 逻辑Map内容、store和存储

来源:互联网 发布:腾讯高级php面试题 编辑:程序博客网 时间:2024/06/06 04:03

11  Logical Map Content逻辑Map内容

Logically,the map contains a series of reserved system key/value pairs preceding theactual user data (which is managed by the SQL subsystem).

逻辑上,该map在实际用户数据(由SQL子系统来管理)之前,包含了一系列预留系统K/V对。

l  \x02<key1>: Range metadata for range ending \x03<key1>. This a "meta1" key.

l  ...

l  \x02<keyN>: Range metadata for range ending \x03<keyN>. This a "meta1" key.

l  \x03<key1>: Range metadata for range ending <key1>. This a "meta2" key.

l  ...

l  \x03<keyN>: Range metadata for range ending <keyN>. This a "meta2" key.

l  \x04{desc,node,range,store}-idegen: ID generation oracles for various component types.

l  \x04status-node-<varintencoded Store ID>: Store runtime metadata.

l  \x04tsd<key>: Time-series data key.

l  <key>: A user key. In practice, these keys are managed by the SQLsubsystem, which employs its own key anatomy.

 

12  Stores and Storage(store和存储)

Nodes containone or more stores. Each store should be placed on a unique disk.Internally,each store contains a single instance of RocksDB with a block cache sharedamongst all of the stores in a node. And these stores in turn have a collectionof range replicas. More than one replica for a range will never be placed onthe same store or even the same node.

节点包含一个或多个store存储库。每个store都被放到一个单一磁盘。在内部,每个store包含一个RocksDB实例,该实例有一个该节点上所有存储库间共享的块缓存。这些store依次有一个range副本的集合。一个range的多个副本永远不会放在相同的store中,甚至相同的节点。

Early on,when a cluster is first initialized, the few default starting ranges will onlyhave a single replica, but as soon as other nodes are available they willreplicate to them until they've reached their desired replication factor, thedefault being 3.

刚开始,当集群第一次被初始化时,有几个默认的启动range只有一个副本,但迅即其他节点上线,他们将复制这些range直到达到期望的复制因子(默认是3)。

Zone configscan be used to control a range's replication factor and add constraints as towhere the range's replicas can be located. When there is a change in a range'szone config, the range willup or downreplicate to theappropriate number of replicas and move its replicas to the appropriate storesbased on zone config's constraints.

Zone配置被用于控制range的复制因子,并增加约束限制range副本位于哪个地方。当rangezone配置变化时,range将增加或减少副本的数量并基于zone配置的约束将它的副本移动到正确的store

0 0
原创粉丝点击