command module
v0.0.0-...-6dffcca Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2015 License: Apache-2.0 Imports: 3 Imported by: 0


Cockroach cluster deployment


Cockroach-prod uses docker machine to create instances on various cloud services, and docker to start the cockroach processes.

To tie this all together and allow node and cluster discovery, it also creates a load balancer.

Many cloud settings use default values. This is to simplify setup and use. Additional customization will eventually be added.

The main parameter for all cockroach-prod commands is --region=<driver>:<name> specifying a cloud driver to use, and the region within the cloud.

Creating a cockroach cluster with 3 nodes is done as follows:

  1. Initialize the first node and setup cloud services
  • initialize load balancer and other cloud infrastructure
  • create one instance
  • initialize cluster and start the first node
  • register node with the load balancer
$ cockroach-prod init --region=<driver>:<region>
  1. Add nodes
  • create 2 new instances
  • start cockroach nodes
  • register nodes with the load balancer
$ cockroach-prod add-nodes 2 --region=<driver>:<region>
  1. Display status
  • display docker-machine status
  • display driver status: print the load balancer address
$ cockroach-prod status --region=<driver>:<region>
  1. Client connections
  • specify the load balancer address (as displayed by cockroach-prod status)
$ cockroach kv scan --insecure --addr=<load balancer address>
  • Build cockroach-prod
$ go get -d
$ cd $GOPATH/src/
$ make
  • Install docker and docker machine
  • Account on a supported cloud platform. See per-platform pre-requisites.
  • generate and push cockroach certs
  • use persistent storage as docker volumes (this is local disk only for now)

Amazon Web Services


Pick a region from the list (eg: us-east-1) and invoke using:

$ cockroach-prod <command> --region=aws:us-east-1

The credentials file will be parsed by cockroach-prod to configure the AWS client library, or passed to docker-machine.

Google Compute Engine

  • Google Cloud account
  • Create a project name cockroach-<username> where username is the local user on your machine. If using a different project name, pass the flag --gce-project=<project-name> to cockroach-prod.
  • Enable the Google Compute Engine and Google Compute Engine Instance Groups API APIs

Pick a region from the list (eg: us-central1) and invoke using:

$ cockroach-prod <command> --region=gce:us-central1

You will be prompted for oauth tokens granting permissions to cockroach-prod. The token is then shared with docker-machine.


This project uses bunch to manage its dependencies. Most of these details are handled in our Makefile. That said, changing dependencies requires special care:

  • If you wish to add a new dependency, run bunch install --save <dep> and commit the change to Bunchfile.lock
  • If you wish to update existing dependencies, run bunch update [dep] && bunch lock and commit the change to Bunchfile.lock


The Go Gopher

There is no documentation for this package.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL