Code Monkey home page Code Monkey logo

triton-touchbase's Introduction

triton-touchbase

Touchbase stack designed for container-native deployment on Joyent's Triton platform

This repo is a demonstation of a multi-tier container-native application architecture on Joyent's Triton platform. It uses Touchbase and its supporting services as an example. It includes the following components:

  • Touchbase, a Node.js application
  • Nginx, acting as a load balancer for Touchbase nodes
  • Couchbase, for the data tier
  • Consul, acting as a discovery service
  • Containerbuddy, to help with service discovery
  • CloudFlare-watcher, to update DNS
  • CloudFlare DNS, to make the site accessible by domain name on the Internet
  • Triton, our container-native infrastructure platform

Diagram of Touchbase architecture

Running the example

You can run this entire stack using the start.sh script found at the top of the repo. You'll need a CloudFlare account and a domain for which you've delegated DNS to CloudFlare, but if you'd like to skip that part you can simply comment out startCloudflare line.

Once you're ready:

  1. Get a Joyent account and add your SSH key.
  2. Install the Docker Toolbox (including docker and docker-compose) on your laptop or other environment, as well as the Joyent CloudAPI CLI tools (including the smartdc and json tools)
  3. Have your CloudFlare API key handy.
  4. Configure Docker and Docker Compose for use with Joyent:
curl -O https://raw.githubusercontent.com/joyent/sdc-docker/master/tools/sdc-docker-setup.sh && chmod +x sdc-docker-setup.sh
./sdc-docker-setup.sh -k us-east-1.api.joyent.com <ACCOUNT> ~/.ssh/<PRIVATE_KEY_FILE>

At this point you can run the example on Triton:

./start.sh env
# here you'll be asked to fill in the .env file
./start.sh

or in your local Docker environment (note that you may need to increase the memory available to your docker-machine VM to run the full-scale cluster):

./start.sh env
./start.sh -f docker-compose-local.yml

The .env file that's created will need to be filled in with the values described below:

CF_API_KEY=<your CloudFlare API key>
CF_AUTH_EMAIL=<the email address associated with your CloudFlare account>
CF_ROOT_DOMAIN=<the root domain you want to manage. ex. example.com>
SERVICE=nginx <the name of the service you want to monitor>
RECORD=<the A-record you want to manage. ex. my.example.com>
TTL=600 <the DNS TTL you want, in seconds. min 120, max 2147483647>
COUCHBASE_USER=<the administrative user you want for your Couchbase cluster>
COUCHBASE_PASSWORD=<the password you want for that Couchbase user>

As the start script runs, it will launch the Consul web UI and the Couchbase web UI. Once Nginx is running, it will launch the login page for the Touchbase site. At this point there is only one Couchbase node, one application server and one Nginx server and you will see the message:

Touchbase cluster is launched!
Try scaling it up by running: ./start.sh scale

If you do so you'll be running docker-compose scale operations that add 2 more Couchbase and Touchbase nodes and 1 more Nginx node. You can watch as nodes become live by checking out the Consul and Couchbase web UIs.

triton-touchbase's People

Contributors

tgross avatar xmikus01 avatar

Watchers

Ahmed Farooki avatar James Cloos 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.