diff --git a/deploy-cluster-aws/awsdeploy.sh b/deploy-cluster-aws/awsdeploy.sh index b68b0a5e..6290d01e 100755 --- a/deploy-cluster-aws/awsdeploy.sh +++ b/deploy-cluster-aws/awsdeploy.sh @@ -131,7 +131,7 @@ if [ "$WHAT_TO_DEPLOY" == "servers" ]; then # this will only be sent to one of the nodes, see the # definition of init_bigchaindb() in fabfile.py to see why. fab init_bigchaindb - fab configure_sharding:$NUM_NODES + fab set_shards:$NUM_NODES else # Deploying clients # The only thing to configure on clients is the api_endpoint diff --git a/deploy-cluster-aws/fabfile.py b/deploy-cluster-aws/fabfile.py index 581a1c1b..9e4a1d47 100644 --- a/deploy-cluster-aws/fabfile.py +++ b/deploy-cluster-aws/fabfile.py @@ -166,10 +166,11 @@ def init_bigchaindb(): run('bigchaindb init', pty=False) +# Set the number of shards (in the backlog and bigchain tables) @task @hosts(public_dns_names[0]) -def configure_sharding(num_shards): - run('bigchaindb sharding {}'.format(num_shards)) +def set_shards(num_shards): + run('bigchaindb set-shards {}'.format(num_shards)) # Start BigchainDB using screen diff --git a/docs/source/bigchaindb-cli.md b/docs/source/bigchaindb-cli.md index 43f8dbb0..ad9fd5a0 100644 --- a/docs/source/bigchaindb-cli.md +++ b/docs/source/bigchaindb-cli.md @@ -44,9 +44,9 @@ This command is used to run benchmarking tests. You can learn more about it usin $ bigchaindb load -h ``` -### bigchaindb sharding +### bigchaindb set-shards -This command is used to configure the number of shards in the underlying datastore, for example: +This command is used to set the number of shards in the underlying datastore. For example, the following command will set the number of shards to four: ```text -$ bigchaindb sharding 3 +$ bigchaindb set-shards 4 ``` \ No newline at end of file diff --git a/tests/test_commands.py b/tests/test_commands.py index 4b35edbb..12c1350e 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -227,11 +227,11 @@ def test_start_rethinkdb_exits_when_cannot_start(mock_popen): utils.start_rethinkdb() -def test_configure_sharding(b): +def test_set_shards(b): import rethinkdb as r from bigchaindb.commands.bigchain import run_set_shards - # change number of shards + # set the number of shards args = Namespace(num_shards=3) run_set_shards(args) @@ -241,7 +241,7 @@ def test_configure_sharding(b): .filter(r.row['db'] == b.dbname) .run(b.conn)) - # check shard configuration + # check that the number of shards got set to the correct value for table in table_config: if table['name'] in ['backlog', 'bigchain']: assert len(table['shards']) == 3