GithubHelp home page GithubHelp logo

kadira-compose's Introduction

kadira-compose

This will get open-source Kadira running on a dedicated host, almost fully automatically using docker-compose. Specifically, it includes the following dockers:

  • MongoDB server: storing data in /opt/kadira-mongo, and accessible via port 27017
  • nginx-proxy: maps ports 80, 443 (SSL), and 22022 (SSL) to kadira-engine's 11011
  • letsencrypt-nginx-proxy-companion: Acquires Let's Encrypt SSL certificate to support https access.
  • kadira-engine: This is where Meteor apps send their data. Accessible via http://HOST:11011 or https://HOST:22022.
  • kadira-rma: This computes statistics every minute as needed by kadira-ui.
  • kadira-ui: Meteor app to present Kadira user interface, accessible via http://HOST:4000.

The Dockerification of open-source Kadira was originally done by Vlad Holubiev, as described in this Meteor forum post. What I've added here is:

  • https access to kadira-engine (via nginx-proxy)
  • built-in Mongo server instead of relying on an external service like mlab.com
  • cron job to clear out old database entries (see below)

Unfortunately, because of the way letsencrypt-nginx-proxy-companion works, I need ports 80 and 443 to point to kadira-engine instead of kadira-ui. So you need to access the UI via http port 4000.

Configuration

  • Expose the following ports on your host:

    • 22 (if you want to ssh in)
    • 80 & 443 (for letsencrypt to work)
    • 4000 (for Kadira UI)
    • 11011 (if your Meteor app uses http)
    • 22022 (if your Meteor app uses https)
  • Do not expose port 27017, or else your MongoDB will be vulnerable.

  • Install Docker

  • Install/download docker-compose

  • Clone this repo.

  • Edit .env to change HOST and EMAIL environment variables.

  • If you want to clear out database of old entries (as recommended here for long-term performance), add the included crontab to your existing crontab, or if you don't have one, just run crontab crontab (on Linux). You may need to edit the path to the included flush-mongo script.

Running

  • Launch dockers, and initialize Mongo replica set:

    ./docker-compose up -d mongo
    ./docker-compose exec mongo mongo --eval 'rs.initiate({_id:"kadira", members: [{_id: 0, host: "mongo:27017"}]})'
    ./docker-compose up -d
    
  • Open http://HOST:4000 and login with email [email protected] (initial password admin -- change it immediately in the UI)

  • Create your apps

  • Upgrade apps to business plan:

    ./docker-compose exec mongo mongo kadira --eval 'db.apps.update({},{$set:{plan:"business"}},{multi:true})'
    
  • Visit http://HOST:4000 to monitor your apps.

Meteor Setup

If your server is running on https, use the port-22022 endpoint to kadira-engine. For example, add the following line to server/kadira.js:

Kadira.connect(APP_ID, APP_SECRET, {endpoint: 'https://HOST:22022'})

If your server is running on http, use the port-11011 endpoint:

Kadira.connect(APP_ID, APP_SECRET, {endpoint: 'http://HOST:11011'})

kadira-compose's People

Contributors

edemaine avatar narigondelsiglo avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.