Start YB-Masters
- The number of nodes in a cluster running YB-Masters must equal the replication factor.
- The number of comma-separated addresses present in should also equal the replication factor.
This section covers deployment for a single region or data center in a multi-zone/multi-rack configuration. Note that single zone configuration is a special case of multi-zone where all placement-related options are set to the same value across every node.
- Create a six-node cluster with replication factor of
3
.- YB-Master server should run on only three nodes, but as noted in the next section, the YB-TServer server should run on all six nodes.
- Assume the three YB-Master private IP addresses are
172.151.17.130
,172.151.17.220
and172.151.17.140
. - Cloud will be
aws
, region will beus-west
, and the three AZs will beus-west-2a
,us-west-2b
, andus-west-2c
. Two nodes will be placed in each AZ in such a way that one replica for each tablet (aka shard) gets placed in any one node for each AZ.
- Multiple data drives mounted on
/home/centos/disk1
, .
Run the yb-master
server on each of the three nodes as shown below. Note how multiple directories can be provided to the —fs_data_dirs
option. Replace the value with the private IP address of the host as well as the set the placement_cloud
,placement_region
and placement_zone
values appropriately. For single zone deployment, simply use the same value for the placement_zone
option.
Alternatively, you can also create a master.conf
file with the following flags and then run yb-master
with the —flagfile
option as shown below. For each YB-Master server, replace the configuration option with the private IP address of the YB-Master server.
--master_addresses=172.151.17.130:7100,172.151.17.220:7100,172.151.17.140:7100
--fs_data_dirs=/home/centos/disk1,/home/centos/disk2
--placement_cloud=aws
--placement_region=us-west
--placement_zone=us-west-2a
Make sure all the three YB-Masters are now working as expected by inspecting the INFO log. The default logs directory is always inside the first directory specified in the —fs_data_dirs
option.
$ cat /home/centos/disk1/yb-data/master/logs/yb-master.INFO
For the masters that become followers, you will see the following line in the log.
For the master that becomes the leader, you will see the following line in the log.
I0912 16:11:06.899287 27220 raft_consensus.cc:738] T 00000000000000000000000000000000 P 21171528d28446c8ac0b1a3f489e8e4b [term 2 LEADER]: Becoming Leader. State: Replica: 21171528d28446c8ac0b1a3f489e8e4b, State: 1, Role: LEADER
Now we are ready to start the YB-TServers.