Skip to content

Install

Gopal Kildoliya edited this page May 28, 2018 · 4 revisions

SwarmSense IoT Platform Setup

Download the latest swarmsense.tar.gz file from release.

Now extrect this swarmsense.tar.gz file and it has snms.zip file that has all files and packages required for the setup of SwarmSense IoT Platform. To extrect the snms.zip file, you may need to install unzip.

Now extrect the file:

$ unzip snms.zip

This will create a release folder. This folder has the frontend, backend and the configuration files.

First of all let's install the database and other dependencies.

Setup Postfix

Install postfix with following command.

apt-get install -y postfix

While installing it will ask for site type and hostname. For site type, select 'internet site' and use 'localhost' for host name.

Setup Nginx

apt-get install -y nginx

Setup InfluxDB

wget https://dl.influxdata.com/influxdb/releases/influxdb_1.3.6_amd64.deb
dpkg -i influxdb_1.3.6_amd64.deb
rm influxdb_1.3.6_amd64.deb
service influxdb start

Setup RabbitMQ

apt-get install -y  erlang-asn1 erlang-crypto erlang-eldap erlang-inets erlang-mnesia erlang-nox erlang-os-mon erlang-public-key erlang-ssl erlang-xmerl socat
wget -O rabbitmq-server.deb.asc "https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_6_12/rabbitmq-server_3.6.12-1_all.deb.asc"
wget -O rabbitmq-server.deb     "https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_6_12/rabbitmq-server_3.6.12-1_all.deb"
dpkg -i rabbitmq-server.deb
rm -f rabbitmq-server.deb*

Enable Plugins

rabbitmq-plugins enable rabbitmq_management
rabbitmq-plugins enable rabbitmq_mqtt
rabbitmq-plugins enable rabbitmq_web_mqtt
mkdir -p /usr/lib/rabbitmq/plugins
wget -O /usr/lib/rabbitmq/plugins/rabbitmq_auth_backend_http-3.6.12.ez https://dl.bintray.com/rabbitmq/community-plugins/rabbitmq_auth_backend_http-3.6.12.ez
rabbitmq-plugins enable rabbitmq_auth_backend_http

Setup PostgreSQL

apt-get install -y postgresql postgresql-contrib
service postgresql start

Setup Supervisor

apt-get install -y python3-pip
apt-get -f install -y
apt-get install -y python-setuptools
easy_install supervisor
mkdir -p /etc/supervisor/conf.d

Install Frontend Application

mkdir /var/www/snms
cp swarmsense-ui.tar.bz2 /var/www/snms
cd /var/www/snms/
tar -xf swarmsense-ui.tar.bz2
rm swarmsense-ui.tar.bz2

Install Backend Application

export LC_ALL=C.UTF-8
export LANG=C.UTF-8
pip3 install -r requirements.txt
pip3 install snms.tar.gz
snms db prepare
snms user create -a -c

Configure Services and Start All

service nginx reload
service nginx start
systemctl enable supervisor
systemctl start supervisor
/etc/init.d/celerybeat start
supervisorctl reload

------------------------------------- DONE --------------------------