mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Auto-generate server tag for AWS nodes
This commit is contained in:
parent
443589bb67
commit
a250c6b35a
@ -4,32 +4,27 @@
|
|||||||
# if any command has a non-zero exit status
|
# if any command has a non-zero exit status
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
function printErr()
|
USAGE="usage: ./awsdeploy_servers.sh <number_of_nodes_in_cluster> <pypi_or_branch>"
|
||||||
{
|
|
||||||
echo "usage: ./awsdeploy_servers.sh <tag> <number_of_nodes_in_cluster> <pypi_or_branch>"
|
# Auto-generate the tag to apply to all nodes in the cluster
|
||||||
echo "No argument $1 supplied"
|
TAG="bcdb-"`date +%m-%d@%H:%M`
|
||||||
}
|
echo "TAG = "$TAG
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
printErr "<tag>"
|
echo $USAGE
|
||||||
|
echo "No first argument <number_of_nodes_in_cluster> was specified"
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
NUM_NODES=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$2" ]; then
|
# If they don't include a second argument (<pypi_or_branch>)
|
||||||
printErr "<number_of_nodes_in_cluster>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
TAG=$1
|
|
||||||
NUM_NODES=$2
|
|
||||||
|
|
||||||
# If they don't include a third argument (<pypi_or_branch>)
|
|
||||||
# then assume BRANCH = "pypi" by default
|
# then assume BRANCH = "pypi" by default
|
||||||
if [ -z "$3" ]; then
|
if [ -z "$2" ]; then
|
||||||
echo "No third argument was specified, so BigchainDB will be installed from PyPI"
|
echo "No second argument was specified, so BigchainDB will be installed from PyPI"
|
||||||
BRANCH="pypi"
|
BRANCH="pypi"
|
||||||
else
|
else
|
||||||
BRANCH=$3
|
BRANCH=$2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for AWS private key file (.pem file)
|
# Check for AWS private key file (.pem file)
|
||||||
|
@ -103,22 +103,22 @@ You can look inside those files if you're curious. In step 2, they'll be modifie
|
|||||||
|
|
||||||
Step 2 is to launch the nodes ("instances") on AWS, to install all the necessary software on them, configure the software, run the software, and more.
|
Step 2 is to launch the nodes ("instances") on AWS, to install all the necessary software on them, configure the software, run the software, and more.
|
||||||
|
|
||||||
Here's an example of how one could launch a BigchainDB cluster of three (3) nodes tagged `wrigley` on AWS:
|
Here's an example of how one could launch a BigchainDB cluster of three (3) nodes on AWS:
|
||||||
```text
|
```text
|
||||||
# in a Python 2.5-2.7 virtual environment where fabric, boto3, etc. are installed
|
# in a Python 2.5-2.7 virtual environment where fabric, boto3, etc. are installed
|
||||||
cd bigchaindb
|
cd bigchaindb
|
||||||
cd deploy-cluster-aws
|
cd deploy-cluster-aws
|
||||||
./awsdeploy_servers.sh wrigley 3 pypi
|
./awsdeploy_servers.sh 3 pypi
|
||||||
```
|
```
|
||||||
|
|
||||||
The `pypi` on the end means that it will install the latest (stable) `bigchaindb` package from the [Python Package Index (PyPI)](https://pypi.python.org/pypi). That is, on each node, BigchainDB is installed using `pip install bigchaindb`.
|
The `pypi` on the end means that it will install the latest (stable) `bigchaindb` package from the [Python Package Index (PyPI)](https://pypi.python.org/pypi). That is, on each node, BigchainDB is installed using `pip install bigchaindb`.
|
||||||
|
|
||||||
`awsdeploy_servers.sh` is a Bash script which calls some Python and Fabric scripts. The usage is:
|
`awsdeploy_servers.sh` is a Bash script which calls some Python and Fabric scripts. The usage is:
|
||||||
```text
|
```text
|
||||||
./awsdeploy_servers.sh <tag> <number_of_nodes_in_cluster> <pypi_or_branch>
|
./awsdeploy_servers.sh <number_of_nodes_in_cluster> <pypi_or_branch>
|
||||||
```
|
```
|
||||||
|
|
||||||
The first two arguments are self-explanatory. The third argument can be `pypi` or the name of a local Git branch (e.g. `master` or `feat/3752/quote-asimov-on-tuesdays`). If you don't include a third argument, then `pypi` will be assumed by default.
|
The first argument is the number of nodes to deploy. The second argument can be `pypi` or the name of a local Git branch (e.g. `master` or `feat/3752/quote-asimov-on-tuesdays`). If you don't include a second argument, then `pypi` will be assumed by default.
|
||||||
|
|
||||||
If you're curious what the `awsdeploy_servers.sh` script does, the source code has lots of explanatory comments, so it's quite easy to read. Here's a link to the latest version on GitHub: [`awsdeploy_servers.sh`](https://github.com/bigchaindb/bigchaindb/blob/master/deploy-cluster-aws/awsdeploy_servers.sh)
|
If you're curious what the `awsdeploy_servers.sh` script does, the source code has lots of explanatory comments, so it's quite easy to read. Here's a link to the latest version on GitHub: [`awsdeploy_servers.sh`](https://github.com/bigchaindb/bigchaindb/blob/master/deploy-cluster-aws/awsdeploy_servers.sh)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user