mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Merge pull request #1261 from bigchaindb/rm-bigchaindb-load-stuff-from-aws-scripts
Removed all stuff related to 'bigchaindb load' in AWS scripts
This commit is contained in:
commit
a9f0f9de54
@ -39,7 +39,6 @@ fi
|
|||||||
|
|
||||||
echo "NUM_NODES = "$NUM_NODES
|
echo "NUM_NODES = "$NUM_NODES
|
||||||
echo "BRANCH = "$BRANCH
|
echo "BRANCH = "$BRANCH
|
||||||
echo "WHAT_TO_DEPLOY = "$WHAT_TO_DEPLOY
|
|
||||||
echo "SSH_KEY_NAME" = $SSH_KEY_NAME
|
echo "SSH_KEY_NAME" = $SSH_KEY_NAME
|
||||||
echo "USE_KEYPAIRS_FILE = "$USE_KEYPAIRS_FILE
|
echo "USE_KEYPAIRS_FILE = "$USE_KEYPAIRS_FILE
|
||||||
echo "IMAGE_ID = "$IMAGE_ID
|
echo "IMAGE_ID = "$IMAGE_ID
|
||||||
@ -85,7 +84,7 @@ if [[ $CONFILES_COUNT != $NUM_NODES ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Auto-generate the tag to apply to all nodes in the cluster
|
# Auto-generate the tag to apply to all nodes in the cluster
|
||||||
TAG="BDB-"$WHAT_TO_DEPLOY"-"`date +%m-%d@%H:%M`
|
TAG="BDB-Server-"`date +%m-%d@%H:%M`
|
||||||
echo "TAG = "$TAG
|
echo "TAG = "$TAG
|
||||||
|
|
||||||
# Change the file permissions on the SSH private key file
|
# Change the file permissions on the SSH private key file
|
||||||
@ -121,25 +120,24 @@ fab install_base_software
|
|||||||
fab get_pip3
|
fab get_pip3
|
||||||
fab upgrade_setuptools
|
fab upgrade_setuptools
|
||||||
|
|
||||||
if [ "$WHAT_TO_DEPLOY" == "servers" ]; then
|
# (Re)create the RethinkDB configuration file conf/rethinkdb.conf
|
||||||
# (Re)create the RethinkDB configuration file conf/rethinkdb.conf
|
if [ "$ENABLE_WEB_ADMIN" == "True" ]; then
|
||||||
if [ "$ENABLE_WEB_ADMIN" == "True" ]; then
|
if [ "$BIND_HTTP_TO_LOCALHOST" == "True" ]; then
|
||||||
if [ "$BIND_HTTP_TO_LOCALHOST" == "True" ]; then
|
python create_rethinkdb_conf.py --enable-web-admin --bind-http-to-localhost
|
||||||
python create_rethinkdb_conf.py --enable-web-admin --bind-http-to-localhost
|
|
||||||
else
|
|
||||||
python create_rethinkdb_conf.py --enable-web-admin
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
python create_rethinkdb_conf.py
|
python create_rethinkdb_conf.py --enable-web-admin
|
||||||
fi
|
fi
|
||||||
# Rollout RethinkDB and start it
|
else
|
||||||
fab prep_rethinkdb_storage:$USING_EBS
|
python create_rethinkdb_conf.py
|
||||||
fab install_rethinkdb
|
|
||||||
fab configure_rethinkdb
|
|
||||||
fab delete_rethinkdb_data
|
|
||||||
fab start_rethinkdb
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Rollout RethinkDB and start it
|
||||||
|
fab prep_rethinkdb_storage:$USING_EBS
|
||||||
|
fab install_rethinkdb
|
||||||
|
fab configure_rethinkdb
|
||||||
|
fab delete_rethinkdb_data
|
||||||
|
fab start_rethinkdb
|
||||||
|
|
||||||
# Rollout BigchainDB (but don't start it yet)
|
# Rollout BigchainDB (but don't start it yet)
|
||||||
if [ "$BRANCH" == "pypi" ]; then
|
if [ "$BRANCH" == "pypi" ]; then
|
||||||
fab install_bigchaindb_from_pypi
|
fab install_bigchaindb_from_pypi
|
||||||
@ -156,48 +154,40 @@ fi
|
|||||||
|
|
||||||
# Configure BigchainDB on all nodes
|
# Configure BigchainDB on all nodes
|
||||||
|
|
||||||
if [ "$WHAT_TO_DEPLOY" == "servers" ]; then
|
# The idea is to send a bunch of locally-created configuration
|
||||||
# The idea is to send a bunch of locally-created configuration
|
# files out to each of the instances / nodes.
|
||||||
# files out to each of the instances / nodes.
|
|
||||||
|
|
||||||
# Assume a set of $NUM_NODES BigchaindB config files
|
# Assume a set of $NUM_NODES BigchaindB config files
|
||||||
# already exists in the confiles directory.
|
# already exists in the confiles directory.
|
||||||
# One can create a set using a command like
|
# One can create a set using a command like
|
||||||
# ./make_confiles.sh confiles $NUM_NODES
|
# ./make_confiles.sh confiles $NUM_NODES
|
||||||
# (We can't do that here now because this virtual environment
|
# (We can't do that here now because this virtual environment
|
||||||
# is a Python 2 environment that may not even have
|
# is a Python 2 environment that may not even have
|
||||||
# bigchaindb installed, so bigchaindb configure can't be called)
|
# bigchaindb installed, so bigchaindb configure can't be called)
|
||||||
|
|
||||||
# Transform the config files in the confiles directory
|
# Transform the config files in the confiles directory
|
||||||
# to have proper keyrings etc.
|
# to have proper keyrings etc.
|
||||||
if [ "$USE_KEYPAIRS_FILE" == "True" ]; then
|
if [ "$USE_KEYPAIRS_FILE" == "True" ]; then
|
||||||
python clusterize_confiles.py -k confiles $NUM_NODES
|
python clusterize_confiles.py -k confiles $NUM_NODES
|
||||||
else
|
|
||||||
python clusterize_confiles.py confiles $NUM_NODES
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Send one of the config files to each instance
|
|
||||||
for (( HOST=0 ; HOST<$NUM_NODES ; HOST++ )); do
|
|
||||||
CONFILE="bcdb_conf"$HOST
|
|
||||||
echo "Sending "$CONFILE
|
|
||||||
fab set_host:$HOST send_confile:$CONFILE
|
|
||||||
done
|
|
||||||
|
|
||||||
# Initialize BigchainDB (i.e. Create the RethinkDB database,
|
|
||||||
# the tables, the indexes, and genesis glock). Note that
|
|
||||||
# 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 set_shards:$NUM_NODES
|
|
||||||
echo "To set the replication factor to 3, do: fab set_replicas:3"
|
|
||||||
echo "To start BigchainDB on all the nodes, do: fab start_bigchaindb"
|
|
||||||
else
|
else
|
||||||
# Deploying clients
|
python clusterize_confiles.py confiles $NUM_NODES
|
||||||
fab send_client_confile:client_confile
|
|
||||||
|
|
||||||
# Start sending load from the clients to the servers
|
|
||||||
fab start_bigchaindb_load
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Send one of the config files to each instance
|
||||||
|
for (( HOST=0 ; HOST<$NUM_NODES ; HOST++ )); do
|
||||||
|
CONFILE="bcdb_conf"$HOST
|
||||||
|
echo "Sending "$CONFILE
|
||||||
|
fab set_host:$HOST send_confile:$CONFILE
|
||||||
|
done
|
||||||
|
|
||||||
|
# Initialize BigchainDB (i.e. Create the RethinkDB database,
|
||||||
|
# the tables, the indexes, and genesis glock). Note that
|
||||||
|
# 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 set_shards:$NUM_NODES
|
||||||
|
echo "To set the replication factor to 3, do: fab set_replicas:3"
|
||||||
|
echo "To start BigchainDB on all the nodes, do: fab start_bigchaindb"
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
rm add2known_hosts.sh
|
rm add2known_hosts.sh
|
||||||
|
@ -23,10 +23,6 @@ NUM_NODES=3
|
|||||||
# It's where to get the BigchainDB code to be deployed on the nodes
|
# It's where to get the BigchainDB code to be deployed on the nodes
|
||||||
BRANCH="master"
|
BRANCH="master"
|
||||||
|
|
||||||
# WHAT_TO_DEPLOY is either "servers" or "clients"
|
|
||||||
# What do you want to deploy?
|
|
||||||
WHAT_TO_DEPLOY="servers"
|
|
||||||
|
|
||||||
# SSH_KEY_NAME is the name of the SSH private key file
|
# SSH_KEY_NAME is the name of the SSH private key file
|
||||||
# in $HOME/.ssh/
|
# in $HOME/.ssh/
|
||||||
# It is used for SSH communications with AWS instances.
|
# It is used for SSH communications with AWS instances.
|
||||||
|
15
deploy-cluster-aws/fabfile.py
vendored
15
deploy-cluster-aws/fabfile.py
vendored
@ -237,15 +237,6 @@ def send_confile(confile):
|
|||||||
run('bigchaindb show-config')
|
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
|
# Initialize BigchainDB
|
||||||
# i.e. create the database, the tables,
|
# i.e. create the database, the tables,
|
||||||
# the indexes, and the genesis block.
|
# the indexes, and the genesis block.
|
||||||
@ -278,12 +269,6 @@ def start_bigchaindb():
|
|||||||
sudo('screen -d -m bigchaindb -y start &', pty=False)
|
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
|
# Install and run New Relic
|
||||||
@task
|
@task
|
||||||
@parallel
|
@parallel
|
||||||
|
@ -26,7 +26,7 @@ import boto3
|
|||||||
from awscommon import get_naeips
|
from awscommon import get_naeips
|
||||||
|
|
||||||
|
|
||||||
SETTINGS = ['NUM_NODES', 'BRANCH', 'WHAT_TO_DEPLOY', 'SSH_KEY_NAME',
|
SETTINGS = ['NUM_NODES', 'BRANCH', 'SSH_KEY_NAME',
|
||||||
'USE_KEYPAIRS_FILE', 'IMAGE_ID', 'INSTANCE_TYPE', 'SECURITY_GROUP',
|
'USE_KEYPAIRS_FILE', 'IMAGE_ID', 'INSTANCE_TYPE', 'SECURITY_GROUP',
|
||||||
'USING_EBS', 'EBS_VOLUME_SIZE', 'EBS_OPTIMIZED',
|
'USING_EBS', 'EBS_VOLUME_SIZE', 'EBS_OPTIMIZED',
|
||||||
'ENABLE_WEB_ADMIN', 'BIND_HTTP_TO_LOCALHOST']
|
'ENABLE_WEB_ADMIN', 'BIND_HTTP_TO_LOCALHOST']
|
||||||
@ -77,9 +77,6 @@ if not isinstance(NUM_NODES, int):
|
|||||||
if not isinstance(BRANCH, str):
|
if not isinstance(BRANCH, str):
|
||||||
raise SettingsTypeError('BRANCH should be a string')
|
raise SettingsTypeError('BRANCH should be a string')
|
||||||
|
|
||||||
if not isinstance(WHAT_TO_DEPLOY, str):
|
|
||||||
raise SettingsTypeError('WHAT_TO_DEPLOY should be a string')
|
|
||||||
|
|
||||||
if not isinstance(SSH_KEY_NAME, str):
|
if not isinstance(SSH_KEY_NAME, str):
|
||||||
raise SettingsTypeError('SSH_KEY_NAME should be a string')
|
raise SettingsTypeError('SSH_KEY_NAME should be a string')
|
||||||
|
|
||||||
@ -117,11 +114,6 @@ if NUM_NODES > 64:
|
|||||||
'The AWS deployment configuration file sets it to {}'.
|
'The AWS deployment configuration file sets it to {}'.
|
||||||
format(NUM_NODES))
|
format(NUM_NODES))
|
||||||
|
|
||||||
if WHAT_TO_DEPLOY not in ['servers', 'clients']:
|
|
||||||
raise ValueError('WHAT_TO_DEPLOY should be either "servers" or "clients". '
|
|
||||||
'The AWS deployment configuration file sets it to {}'.
|
|
||||||
format(WHAT_TO_DEPLOY))
|
|
||||||
|
|
||||||
if SSH_KEY_NAME in ['not-set-yet', '', None]:
|
if SSH_KEY_NAME in ['not-set-yet', '', None]:
|
||||||
raise ValueError('SSH_KEY_NAME should be set. '
|
raise ValueError('SSH_KEY_NAME should be set. '
|
||||||
'The AWS deployment configuration file sets it to {}'.
|
'The AWS deployment configuration file sets it to {}'.
|
||||||
|
@ -86,7 +86,6 @@ Step 2 is to make an AWS deployment configuration file, if necessary. There's an
|
|||||||
```text
|
```text
|
||||||
NUM_NODES=3
|
NUM_NODES=3
|
||||||
BRANCH="master"
|
BRANCH="master"
|
||||||
WHAT_TO_DEPLOY="servers"
|
|
||||||
SSH_KEY_NAME="not-set-yet"
|
SSH_KEY_NAME="not-set-yet"
|
||||||
USE_KEYPAIRS_FILE=False
|
USE_KEYPAIRS_FILE=False
|
||||||
IMAGE_ID="ami-8504fdea"
|
IMAGE_ID="ami-8504fdea"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user