awsdeploy.sh can now deploy N servers or N clients

This commit is contained in:
troymc 2016-05-03 21:02:58 +02:00
parent 19819b880f
commit d8a0765a2a
2 changed files with 56 additions and 30 deletions

View File

@ -74,15 +74,16 @@ python launch_ec2_nodes.py --tag $TAG --nodes $NUM_NODES
chmod +x add2known_hosts.sh
./add2known_hosts.sh
# (Re)create the RethinkDB configuration file conf/rethinkdb.conf
python create_rethinkdb_conf.py
# Rollout base packages (dependencies) needed before
# storage backend (RethinkDB) and BigchainDB can be rolled out
fab install_base_software
if [ "$WHAT_TO_DEPLOY" == "servers" ]; then
# (Re)create the RethinkDB configuration file conf/rethinkdb.conf
python create_rethinkdb_conf.py
# Rollout storage backend (RethinkDB) and start it
fab install_rethinkdb
fi
# Rollout BigchainDB (but don't start it yet)
if [ "$BRANCH" == "pypi" ]; then
@ -102,6 +103,7 @@ fi
# Configure BigchainDB on all nodes
if [ "$WHAT_TO_DEPLOY" == "servers" ]; then
# The idea is to send a bunch of locally-created configuration
# files out to each of the instances / nodes.
@ -132,6 +134,15 @@ fab init_bigchaindb
# Start BigchainDB on all the nodes using "screen"
fab start_bigchaindb
else
# Deploying clients
# The only thing to configure on clients is the api_endpoint
# It should be the public DNS name of a BigchainDB server
fab send_client_confile:client_confile
# Start sending load from the clients to the servers
fab start_bigchaindb_load
fi
# cleanup
rm add2known_hosts.sh

View File

@ -146,6 +146,15 @@ def send_confile(confile):
run('bigchaindb show-config')
@task
@parallel
def send_client_confile(confile):
put(confile, 'tempfile')
run('mv tempfile ~/.bigchaindb')
print('For this node, bigchaindb show-config says:')
run('bigchaindb show-config')
# Initialize BigchainDB
# i.e. create the database, the tables,
# the indexes, and the genesis block.
@ -164,6 +173,12 @@ def start_bigchaindb():
sudo('screen -d -m bigchaindb -y start &', pty=False)
@task
@parallel
def start_bigchaindb_load():
sudo('screen -d -m bigchaindb load &', pty=False)
# Install and run New Relic
@task
def install_newrelic():