forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrated a CLI interface to the main cockroach binary which current…
…ly has two commands: init & start. Summary: A new cluster is init'd by specifying a single data directory as first argument and a default zone configuration file as second arg. A new RocksDB instance is created in the data directory (an error results if one is already there), and a new cluster UUID is generated to uniquely identify the cockroach cluster. The first range is created as a single replica with ident: NodeID: 1, StoreID: 1, RangeID: 1. meta1/meta2 records are created for the first range, and node id sequence generator, store id sequence generator, and store-local range id sequence generator are all created. The roach node is run using "cockroach start". Typically this will be accompanied by --bootstrap_hosts in order to connect to gossip network, and --data_dirs=dir1,dir2,... The --data_dirs can either have a list of paths or a list of "mem=100000,mem=200000,...", which creates in-mem stores. Any stores which are as yet uninitialized are bootstrapped using the cluster ID and new store IDs from the store id sequence generator. Stores other than the one used to init a new cluster, or all stores on a new node being added to an existing cluster will need initialization. Changed Replica specification to be a series of three integers: NodeID, StoreID & RangeID. Node & store IDs are 32-bit; range ID is 64-bit. Added convenience methods to kv.DB as well as storage.Engine for reading and writing arbitrary go values via interface{}. Test Plan: go test Reviewers: petermattis, andybons, bdarnell Reviewed By: bdarnell Subscribers: hrsht, levonlloyd Differential Revision: http://phabricator.andybons.com/D29
- Loading branch information
Spencer Kimball
committed
Apr 17, 2014
1 parent
8afb7eb
commit a97fee5
Showing
26 changed files
with
1,268 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2014 The Cockroach Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
// implied. See the License for the specific language governing | ||
// permissions and limitations under the License. See the AUTHORS file | ||
// for names of contributors. | ||
// | ||
// Author: Spencer Kimball ([email protected]) | ||
|
||
package gossip | ||
|
||
// Constants for gossip keys. | ||
const ( | ||
// KeyClusterID is the unique UUID for this Cockroach cluster. | ||
// The value is a string UUID for the cluster. | ||
KeyClusterID = "cluster-id" | ||
|
||
// KeyMaxCapacityPrefix is the key prefix for gossiping available | ||
// store capacity. The suffix is composed of: | ||
// <datacenter>-<hex node ID>-<hex store ID>. The value is a | ||
// storage.StoreAttributes struct. | ||
KeyMaxAvailCapacityPrefix = "max-avail-capacity-" | ||
|
||
// KeyNodeCount is the count of gossip nodes in the network. The | ||
// value is an int64 containing the count of nodes in the cluster. | ||
// TODO(spencer): should remove this and instead just count the | ||
// number of node ids being gossiped. | ||
KeyNodeCount = "node-count" | ||
|
||
// KeyNodeIDPrefix is the key prefix for gossiping node id | ||
// addresses. The actual key is suffixed with the hexadecimal | ||
// representation of the node id and the value is the host:port | ||
// string address of the node. E.g. node-1bfa: fwd56.sjcb1:24001 | ||
KeyNodeIDPrefix = "node-" | ||
|
||
// SentinelKey is a key for gossip which must not expire or else the | ||
// node considers itself partitioned and will retry with bootstrap hosts. | ||
KeySentinel = KeyClusterID | ||
|
||
// KeyFirstRangeMetadata is the metadata for the "first" range. The | ||
// "first" range contains the meta1 key range, the first level of | ||
// the bi-level key addressing scheme. The value is a slice of | ||
// storage.Replica structs. | ||
KeyFirstRangeMetadata = "first-range" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.