Skip to content

Latest commit

 

History

History
135 lines (118 loc) · 5.74 KB

docker-tutum.adoc

File metadata and controls

135 lines (118 loc) · 5.74 KB

Deploy Docker Containers to Amazon using Tutum

Key Concepts

Docker Tutum is a SaaS that allows you to build, deploy and manage Docker containers in a variety of clouds.

There are three main features:

  • Build and run your code using Tutum’s free private registry

  • Deploy applications using Tutum to manage Clusters that are fault tolerant and scalable. Tutum handles the orchestration of your infrastructure and application containers.

  • Manage your applications through Tutum’s intuitive Dashboard, simple API, or CLI tool. With built-in logs and data monitoring, all the info you need is at your fingertips.

The main concepts of Docker Tutum are explained below:

Tutum Architecture

docker tutum architecture

  1. (A) Node clusters are logical groups of nodes of the same type. Tutum pools your nodes resources, so your apps can run together thereby reducing complexity and waste. Node Clusters can be easily scaled with a drag of the slider.

  2. (B) Nodes are individual Linux hosts/VMs used to deploy and run your applications. New nodes can be provisioned right from within Tutum to increase the capacity of your Node Clusters.

  3. © Containers, (D) Links and (E) Volumes are Docker concepts.

  4. (F) Services are logical groups of Docker containers from the same image. Services make it simple to scale your application across different nodes. Simply drag a slider to increase or decrease the availability, performance, and redundancy of your application.

Deploy Couchbase Docker Container on Amazon using Tutum

Docker Tutum Getting Started provides detailed steps on how to get started. Here are the steps that you need to follow to run Couchbase Docker container in Amazon using Docker Tutum.

  1. Get started for free (at least while its in beta) by logging in using Docker Hub account.

  2. Link Amazon Web Services credentials with Tutum. I just had to specify Access Key Id and Secret Access Key.If you create a new account for this then you may have to attach a policy to enable privileges such that new instances can be provisioned on your behalf.

  3. Create a new node cluster at dashboard.tutum.co/node/launch/

    docker tutum new node cluster

    The values that need to be specified/changed:

    1. Node cluster name

    2. Deploy tags (optional)

    3. Type/size to t2.medium

    4. Disk size reduce from 60 to 20 GB (optional)

      Takes a few minutes to provision the AMI. Updated status could be seen on AWS Console:

      docker tutum aws console

      Tutum dashboard shows the following status after the node is created:

      docker tutum node created

  4. Create your first service at http://dashboard.tutum.co/container/launch/. Select “Public Repositories” and search for “arungupta/couchbase-node”.

    docker tutum new service

    This image is created from http://github.com/arun-gupta/docker-images/tree/master/couchbase-node. This image performs the following:

    1. Starts Couchbase server

    2. Configures the server using Couchbase REST API

  5. Click on “Select” and configure. You only need to override the ports and take all other defaults:

    docker tutum couchbase configuration

    Click on “Create and Deploy”.

  6. Dashboard is updated after the service is deployed:

    docker tutum couchbase service

  7. Click on “Logs” to see logs from the Couchbase Docker container:

    docker tutum couchbase logs

  8. Find IP address from the AWS Console:

    docker tutum aws console ipaddress

  9. Access Couchbase Console at <IP-ADDRESS>:8091, in our case http://54.67.111.235:8091. This will show the login screen of Couchbase:

    docker tutum couchbase console login

    Enter the username “Administrator” and password “password”.

  10. This shows the Couchbase Console:

    docker tutum couchbase console

Create/Access Sample Bucket on Couchbase

  1. Click on “Settings”, “Sample Buckets”. This shows the list of sample buckets that can be installed.

  2. Select “travel-sample” and click on “Create”. The updated console looks like:

    docker tutum couchbase travel sample

  3. If you’ve downloaded Couchbase server locally, then you can use Couchbase Query CLI Tool (cbq) to connect and query:

    bin > ./cbq -engine=http://54.67.111.235:8093
    Couchbase query shell connected to http://54.67.111.235:8093/ . Type Ctrl-D to exit.
    cbq> select * from `travel-sample` limit 1;
    {
        "requestID": "aec63fba-a85a-4763-9453-1d7ea0c5409c",
        "signature": {
            "*": "*"
        },
        "results": [
            {
                "travel-sample": {
                    "callsign": "MILE-AIR",
                    "country": "United States",
                    "iata": "Q5",
                    "icao": "MLA",
                    "id": 10,
                    "name": "40-Mile Air",
                    "type": "airline"
                }
            }
        ],
        "status": "success",
        "metrics": {
            "elapsedTime": "10.135335ms",
            "executionTime": "10.091507ms",
            "resultCount": 1,
            "resultSize": 300
        }
    }

    Couchbase allows to query document database using SQL-like syntax, aka N1QL.

Access Couchbase using Java application