1
0
mirror of https://github.com/bigchaindb/bigchaindb.git synced 2024-06-28 00:27:45 +02:00

Updated awsdeploy, fabfile, docs, test for bigchaindb set-shards

This commit is contained in:
troymc 2016-05-09 18:13:20 +02:00
parent c2e8a5712a
commit e212828182
4 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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
```

View File

@ -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