yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.87k stars 1.05k forks source link

Initial multi-node options for yugabyte-db #2057

Open WesleyW opened 5 years ago

WesleyW commented 5 years ago

From our discussion, the following is how preliminary multi-node will look for yugabyte-db:

New flags being added

How users would add nodes

  1. Start yugabyte-db start --listen-addr LISTEN_ADDR on the first node. This is the master-leader. An optional --rf REPLICATION_FACTOR flag may be added if desired.
  2. On the new node, run yugabyte-db start --listen_addr LISTEN_ADDR --join NODE1, where NODE1 is the LISTEN_ADDR from step 1. If the node already exists, add a --force flag to destroy existing data and join the cluster.
  3. The "ready" status will display and users may pull up yugaware on either node to interact with the universe.

(1) translates to starting up yb-master with --master_addresses=NODE1 --rpc_bind_addresses=0.0.0.0 --server_broadcast_addresses=NODE1 and yb-tserver with same arguments (public ip NODE1 is not part of the local network interfaces)

How --join works

Assume we have nodes N1, N2 and N3. Assume we have started the cluster on the first node N1 by running yugabyte-db start --rf 3. To add N2 and N3 to this cluster, you would run yugabyte-db start --join N1 on these nodes.

The following steps would happen on N2 and N3:

  1. Query N1 for list of the current master_addresses using the Rest API, which would currently return N1:7100. This is written as the master_addresses flag to the local yugabyte-db conf file.
  2. Bring up yb-master in shell mode on N2.
  3. Bring up yb-tserver will start up pointing to N1:7100 as the master_addresses.
  4. Make a Rest API call to N1 to add the current node
  5. Bring up yugaware, pointing to the local yb-tserver as the DB.

The add node Rest API on N1 would do the following:

TODOs

iSignal commented 4 years ago

Three parts to this:

(1) Translate --listen_addr and --join_addr to corresponding master and tserver flags

NODE1: yugabyte-db start --listen=NODE1_ip

NODE_2: yugabyte-db start --listen=NODE2_ip --join=NODE1_ip

(2.1) When the second node is brought up, perform an ADD_SERVER on the master.

(3) When a third node is added, do the same as above, plus add_node_to_imported(new_node_ip) would also issue a replication factor change that is the equivalent of yb-admin --master_addresses=NODE1_ip:7100 modify_placement_info <default_placement_info> 3 to change the replication factor to 3

Observations:

raarts commented 4 years ago

I was referred here by https://docs.yugabyte.com/latest/quick-start/create-local-cluster/docker/. It states multi-node clustering is not available yet. What does that mean? Is YB still constrained to one instance? What is the status of multi-node?

schoudhury commented 4 years ago

@raarts the above comment refers specifically to the yugabyted server which is a new "parent" server for the 2 yugabytedb servers (yb-tserver, the data server and yb-master, the metadata server).

yugabytedb can indeed be deployed as a multi-node cluster -- the following tutorials show you how. note that this approach shows how to create the multi-node cluster using a different approach than yugabyted. https://docs.yugabyte.com/latest/explore/linear-scalability/docker/ https://docs.yugabyte.com/latest/explore/fault-tolerance/docker/