Andrew Wong has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/17528 )
Change subject: [master] AddMaster and copy sys catalog automatically ...................................................................... [master] AddMaster and copy sys catalog automatically This patch updates the masters to ping all other masters, collect their UUIDs and Raft configs, and detect whether the master being started meant to join the cluster via AddMaster RPC. If so, it sends the RPC, performs a tablet copy, and bootstraps the master from the copy. This patch is fairly conservative about when it will perform the automatic operations -- the existing master Raft config must be in good health, with all masters agreeing on members and the current term. Otherwise, the new master will fail to come up, as it's not a part of the existing cluster. This patch includes a gflag with which to disable this behavior. It is disabled in the following cases: - when running the `kudu master add` tooling - tests for the existing tooling Some test utility updates come along with this patch as well, used in newly introduced tests: - the ExternalMiniCluster can now add a master - ExternalMiniCluster::WaitForCatalogManager() is made more robust to the shutting down and starting up of a master In order to get this to work in a secured environment, this patch also updates the coarse grained authz requirements of the AddMaster endpoint to allow the service user to send RPCs. Sample usage (from build/latest): $ ../../src/kudu/scripts/start_kudu.sh $ mkdir -p master-1/log $ ./bin/kudu-master --master_addresses=127.0.0.1:8764,127.0.0.1:8766 --fs_data_dirs=$PWD/master-1/data --fs_wal_dir=$PWD/master-1/wal --log_dir=$PWD/master-1/log --rpc_bind_addresses=127.0.0.1:8766 --time_source=system_unsync --unlock_unsafe_flags --webserver_port=8767 --webserver_interface=127.0.0.1 --webserver_doc_root=$PWD/../../www --logtostderr ... $ ../../src/kudu/scripts/stop_kudu.sh $ ../../src/kudu/scripts/start_kudu.sh --num-masters 2 Change-Id: Ic7635723f30317a45799ad7b9c9b725eafbd735b Reviewed-on: http://gerrit.cloudera.org:8080/17528 Reviewed-by: Alexey Serbin <[email protected]> Tested-by: Alexey Serbin <[email protected]> --- M src/kudu/master/CMakeLists.txt M src/kudu/master/dynamic_multi_master-test.cc M src/kudu/master/master.proto M src/kudu/master/master_options.h M src/kudu/master/master_runner.cc M src/kudu/mini-cluster/external_mini_cluster-test.cc M src/kudu/mini-cluster/external_mini_cluster.cc M src/kudu/mini-cluster/external_mini_cluster.h M src/kudu/tools/tool_action_master.cc 9 files changed, 1,043 insertions(+), 243 deletions(-) Approvals: Alexey Serbin: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/17528 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic7635723f30317a45799ad7b9c9b725eafbd735b Gerrit-Change-Number: 17528 Gerrit-PatchSet: 6 Gerrit-Owner: Andrew Wong <[email protected]> Gerrit-Reviewer: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Bankim Bhavsar <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241)
