Question about choosing a Raft master and running Raft on a single node cluster

[source: an email to info@cockroachlabs.com - June 9, 2016]

  1. Could we decide where to locate our data? For example, can we choose Raft master for a in machine A, and replica in machine B, and nothing on C?

  2. Can we set up database individually on different machines and make them aware of each other ?

  3. When only one machine is running, if update request on a is received, does it still go through Raft method ? (how does it decide to write for only one instance?)

@bdarnell

  1. Could we decide where to locate our data? For example, can we choose Raft master for a in machine A, and replica in machine B, and nothing on C?

    You cannot control raft leadership. You can control which nodes have replicas of your data by setting attributes: https://www.cockroachlabs.com/docs/configure-replication-zones.html

    Note that you should use at least three replicas; a two-replica configuration is not fault-tolerant because a majority is required for all operations, and a majority of two is two.

  2. Can we set up database individually on different machines and make them aware of each other ?

    You cannot start them up independently and then join them later. The --join flag must be passed when starting each node except the first.

  3. When only one machine is running, if update request on a is received, does it still go through Raft method ? (how does it decide to write for only one instance?)

    Yes, it still goes through the raft code, but raft commits the command immediately without sending any messages.