Skip to content

Commit

Permalink
[script][test] Supply --master_addresses for single master config
Browse files Browse the repository at this point in the history
Supplying --master_addresses to single master configuration
helps populate the 'last_known_addr' field in single master
Raft configuration which is a pre-requisite for migrating
to multi-master configuration.

Change a59d382 previously added support to supply
--master_addresses for single master configuration.
https://git.io/JOD25

This change:
- Updates scripts to start supplying --master_addresses by default
even for single master configurations. Fixes some port numbers
in a development documentation that uses the script.
- Updates the default in ExternalMiniCluster to start supplying
--master_addresses for single master configuration.

Change-Id: I38d091b3acc607d5faf9aeb075069482af75723a
Reviewed-on: http://gerrit.cloudera.org:8080/17335
Tested-by: Kudu Jenkins
Reviewed-by: Andrew Wong <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
  • Loading branch information
bbhavsar committed Apr 26, 2021
1 parent d21a0d3 commit de65aa6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions docker/kudu-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ fi
if [[ "$1" == "master" ]]; then
mkdir -p "$SERVICE_DIR"
wait_for_master_hosts
# Supply --master_addresses even if a single master address is specified.
if [[ -n "$KUDU_MASTERS" ]]; then
MASTER_ARGS="--master_addresses=$KUDU_MASTERS $MASTER_ARGS"
fi
Expand Down
6 changes: 3 additions & 3 deletions docs/quickstartdev.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ cd build/latest

== Check Kudu master server web interface

Open in browser: http://localhost:8764/
Open in browser: http://localhost:8765/

== Generate and load some data into Kudu

[source,bash]
----
./bin/kudu perf loadgen 127.0.0.1:8765 --keep_auto_table=true --num_rows_per_thread=100000 --run_scan=true
./bin/kudu perf loadgen 127.0.0.1:8764 --keep_auto_table=true --num_rows_per_thread=100000 --run_scan=true
----

== Query Kudu servers

[source,bash]
----
./bin/kudu master get_flags 127.0.0.1:8765
./bin/kudu master get_flags 127.0.0.1:8764
./bin/kudu tserver get_flags 127.0.0.1:9870
----

Expand Down
2 changes: 1 addition & 1 deletion src/kudu/mini-cluster/external_mini_cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static double kMasterCatalogManagerTimeoutSeconds = 60.0;

ExternalMiniClusterOptions::ExternalMiniClusterOptions()
: num_masters(1),
supply_single_master_addr(false),
supply_single_master_addr(true),
num_tablet_servers(1),
bind_mode(kDefaultBindMode),
num_data_dirs(1),
Expand Down
2 changes: 1 addition & 1 deletion src/kudu/mini-cluster/external_mini_cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct ExternalMiniClusterOptions {
int num_masters;

// Whether to supply 'master_addresses' field for single master configuration.
// Default: False
// Default: True
bool supply_single_master_addr;

// Number of TS to start.
Expand Down
4 changes: 1 addition & 3 deletions src/kudu/scripts/start_kudu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ function start_master() {
create_dirs_and_set_vars $1
set_port_vars_and_print $1 $2 $3
ARGS="$KUDUMASTER"
if [ $NUM_MASTERS -gt 1 ]; then
ARGS="$ARGS --master_addresses=$MASTER_ADDRESSES"
fi
ARGS="$ARGS --master_addresses=$MASTER_ADDRESSES"
ARGS="$ARGS --fs_data_dirs=$dir_data"
ARGS="$ARGS --fs_wal_dir=$dir_wal"
ARGS="$ARGS --log_dir=$dir_log"
Expand Down

0 comments on commit de65aa6

Please sign in to comment.