diff --git a/deploy-cluster-aws/fabfile-monitor.py b/deploy-cluster-aws/fabfile-monitor.py index b0ff4841..71c5b100 100644 --- a/deploy-cluster-aws/fabfile-monitor.py +++ b/deploy-cluster-aws/fabfile-monitor.py @@ -17,7 +17,7 @@ def install_docker_engine(): Example: fab --fabfile=fabfile-monitor.py \ --hosts=ec2-52-58-106-17.eu-central-1.compute.amazonaws.com \ - install_docker + install_docker_engine """ # install prerequisites @@ -40,13 +40,40 @@ def install_docker_engine(): @task def install_docker_compose(): + """Install docker-compose on an ec2 ubuntu 14.04 instance + + Example: + fab --fabfile=fabfile-monitor.py \ + --hosts=ec2-52-58-106-17.eu-central-1.compute.amazonaws.com \ + install_docker_compose + """ sudo('curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-`uname \ -s`-`uname -m` > /usr/local/bin/docker-compose') sudo('chmod +x /usr/local/bin/docker-compose') +@task +def install_docker(): + """Install docker and docker-compose on an ec2 ubuntu 14.04 instance + + Example: + fab --fabfile=fabfile-monitor.py \ + --hosts=ec2-52-58-106-17.eu-central-1.compute.amazonaws.com \ + install_docker + """ + install_docker_engine() + install_docker_compose() + + @task def run_monitor(): + """Run bigchaindb monitor on an ec2 ubuntu 14.04 instance + + Example: + fab --fabfile=fabfile-monitor.py \ + --hosts=ec2-52-58-106-17.eu-central-1.compute.amazonaws.com \ + run_monitor + """ # copy docker-compose-monitor to the ec2 instance put('../docker-compose-monitor.yml') - run('docker-compose -f docker-compose-monitor.yml up -d') + run('INFLUXDB_DATA=/influxdb-data docker-compose -f docker-compose-monitor.yml up -d') diff --git a/docs/source/deploy-on-aws.md b/docs/source/deploy-on-aws.md index 49c83021..0d23fdeb 100644 --- a/docs/source/deploy-on-aws.md +++ b/docs/source/deploy-on-aws.md @@ -149,6 +149,28 @@ You have 2 allocated elactic IPs which are not associated with instances (It has Domain = vpc.) ``` +## BigchainDB Monitor Deployment + +The deployment for the monitor requires an aws ec2 instance running Ubuntu 14.04 with a system folder `/influxdb-data`. +This folder can be a [mount point of an EBS volume](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html) +for data persistence. + +With the instance setup we first need to install `docker` and `docker-compose`: +```text +$ fab --fabfile=fabfile-monitor.py --hosts= install_docker +``` + +After docker is installed run the monitor with: +```text +$ fab --fabfile=fabfile-monitor.py --hosts= run_monitor +``` + +To access the monitor follow the instructions on [Monitoring](monitoring.html) replacing `localhost` with the +hostname of the ec2 instance running the monitor. + +To configure bigchaindb to start sending statistics to the monitor change statsd host in the configuration file +(in `$HOME/.bigchaindb` by default) to the hostname of the ec2 instance running the monitor. + ## Known Deployment Issues ### NetworkError diff --git a/docs/source/monitoring.md b/docs/source/monitoring.md index 4fb53072..dd3b1c6f 100644 --- a/docs/source/monitoring.md +++ b/docs/source/monitoring.md @@ -16,7 +16,12 @@ $ docker-compose -f docker-compose-monitor.yml build $ docker-compose -f docker-compose-monitor.yml up ``` -then point a browser tab to: +It is also possible to mount a host directory as a data volume for influxdb by settings the `INFLUXDB_DATA` env. +```text +$ INFLUXDB_DATA=/data docker-compose -f docker-compose-monitor up +``` + +After starting docker-compose point a browser tab to: [http://localhost:3000/dashboard/script/bigchaindb_dashboard.js](http://localhost:3000/dashboard/script/bigchaindb_dashboard.js)