Skip to content

Installation

Tom Steele edited this page Sep 10, 2015 · 26 revisions

These install instructions will walk you through installing individual server components. Most users will prefer using Lair Manager over this method.

For simplicity and for this guide to deal with various operating systems and configurations, each of these services will not run in the background. It is up to the reader to determine the best tools (upstart, systemd, etc) and configuration to use outside of this.

Lair requires the following services to be fully functional:

  • Lair App is the Meteor server used to drive the UI.
  • Lair API is the HTTP JSON API used by drones to import and export data. This is also used for file uploads.
  • Mongodb is the database.
  • Reverse HTTPS proxy which is used for TLS and to proxy requests to the app and API through a single service. We'll be using Caddy, but nginx will also work.

The rest of this guide will assume you are using a clean install of Ubuntu 14.04. Not much changes for other operating systems beyond downloading dependencies.

Setup

Start off by creating a tmux session and a directory to house all of our dependencies:

$ tmux
$ mkdir lair
$ cd lair

Mongodb

Next, we will download, start, and configure Mongodb. Download Mongodb for your operating system here.

Download and extract:

$ curl -o mongodb.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1404-3.0.6.tgz
$ tar -zxvf mongodb.tgz

Create a directory to hold our database:

$ mkdir db

Start Mongodb with the following options:

$ ./mongodb-linux-x86_64-ubuntu1404-3.0.6/bin/mongod --dbpath=db --bind_ip=localhost --quiet --nounixsocket --replSet rs0

If you choose to install Mongodb in some other way, the most important thing to note is that it must be configured to use a replica set, and will have to be configured to be the primary.

Configure Mongodb to be the primary in the replica set:

Login to Mongodb:

$ ./mongodb-linux-x86_64-ubuntu1404-3.0.6/bin/mongo admin
MongoDB shell version: 3.0.6
connecting to: admin

From the console, configure the replica set:

> rs.initiate({_id:"rs0", members: [{_id: 1, host: "localhost:27017"}]})
{ "ok" : 1 }
rs0:OTHER> quit()

Lair APP

Lair API

Reverse HTTPS Proxy

Clone this wiki locally