mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Merge pull request #259 from bigchaindb/bigchaindb-set-shards-revisions
Updated awsdeploy, fabfile, docs, test for bigchaindb set-shards
This commit is contained in:
commit
5d78b8edff
@ -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
|
||||
|
5
deploy-cluster-aws/fabfile.py
vendored
5
deploy-cluster-aws/fabfile.py
vendored
@ -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
|
||||
|
@ -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
|
||||
```
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user