Monthly Archives: February 2016

Couchbase Weekly, Feb 29, 2016

Learn what’s latest in the Couchbase Community.
Couchbase Developer Community

Let us know if we missed anything at @couchbasedev@couchbase or #Couchbase.

Couchbase Weekly

Couchbase Weekly

Media Mentions

Blogs

Couchbase Weekly 3

Upcoming Events

Webinars

twitter-logo

  • Enterprises like Cisco & Marriott are modernizing their legacy systems with #Couchbase #NoSQL. Why? ow.ly/YvENp
  • #Couchbase Server 4.5 Developer Preview is ready! Built-in query editor & schema browser, full-text search, and more http://ow.ly/YTsz4
  • Enterprises like Nielsen are picking #Couchbase the “more mature” database over #MongoDB for document store: http://ow.ly/YrrR3 #NoSQL
  • Learn how #Couchbase customers deploy #NoSQL at the enterprise level for maxium performance and reliability: http://ow.ly/Yv925
  • Get professional advice from the #Couchbase services team on everything from #JSON modeling to using #SQL for #NoSQL: http://ow.ly/XSFyr

Source: http://blog.couchbase.com/2016/february/couchbase-weekly-feb-29-2016

Couchbase on Kubernetes

This blog is possible because of this tweet!

kubernetes-logoKubernetes is an open source orchestration system by Google for Docker containers.  It manages containerized applications across multiple hosts and provides basic mechanisms for deployment, maintenance, and scaling of applications.

It allows the user to provide declarative primitives for the desired state, for example “need 5 Couchbase servers”. Kubernetes self-healing mechanisms, such as auto-restarting, re-scheduling, and replicating containers then ensure that this state is met. The user just define the state and Kubernetes ensures that the state is met at all times on the cluster.

Key Concepts of Kubernetes explains the key concepts of Kubernetes.

This multi-part blog series will show how to run Couchbase on Kubernetes in multiple ways. The first part starts with a simple setup using Vagrant.

Getting Started with Kubernetes

There are multiple ways to run Kubernetes but I found the simples (not necessarily predictable 😉 way is to run using Vagrant.

  • Download the latest Kubernetes release, 1.1.8 as of this writing, and expand the archive.
  • Start the Kubernetes cluster as:
    This shows the output as:

Run Couchbase on Kubernetes Cluster

The easiest way to start running a Docker container in Kubernetes is using the kubectl run command.

The command usage is:

The command runs a particular image, possibly replicated. The image replication is handled by creating a Replication Controller to manage the created container(s).

Complete list of options to run this command can be seen using:

Couchbase Docker Container explains the different Docker container for Couchbase. For this blog, we’ll use arungupta/couchbase image as that is pre-configured.

This shows the output:

The output confirms that a Replication Controller is created. Lets verify it:

Now, check the pods:

Lets check the status of the pod:

Fifth line of the output says the node’s IP is 10.245.1.4. This would be used to access the Web Console later.

The last line in this output shows that the pod is now ready. Checking the status of the pod again shows:

Couchbase Web Console on Kubernetes Cluster

Now that your Couchbase container is running in Kubernetes cluster, you may like to view the Web Console.

Each pod is assigned a unique IP address, but this address is only accessible within the cluster. It can exposed using the kubectl expose command.

This command takes a Replication Controller, Service or Pod and expose it as new Kubernetes Service. This can be done by giving the command:

In this command:

  • --target-port is the name or number for the port on the container that the service should direct traffic to
  • --port is the port that the service should serve on
  • --external-ip is the external IP address to set for the service. Note, this IP address was obtained with kubectl describe pod command earlier.

Now, you can access the Couchbase Web Console at http://10.245.1.4:8091 and looks like:

Couchbase Web Console on Kubernetes

Enter the password credentials as Administrator/password. These credentials are specified during Docker image creation at github.com/arun-gupta/docker-images/blob/master/couchbase/configure-cluster.sh#L9.

Couchbase Web Console in Kubernetes

Voila!

Discuss with us at StackOverflow or Couchbase Forums. You can also follow us at @couchbasedev and @couchbase.

Source: http://blog.couchbase.com/2016/couchbase-on-kubernetes

Docker Installation Scripts – CLI, Machine, Compose, Version Manager

Docker Logo

Docker Toolbox is cool! It is a single point download that gives you everything to get started with Docker. But it comes with other tools like VirtualBox and Kitematic which you may not want. So what do you do?

You install the tools that you like using CLI. This blog shows how to do exactly that.

All the commands are installed in the /usr/bin/local directory.

Latest Docker CLI

This command downloads and installs the latest Docker CLI.

Another simpler way to install and manage different versions of CLI are using Docker Version Manager or dvm.

DVM provides a decent set of commands:

Latest Docker Machine

This command downloads and installs the latest Docker Machine.

Latest Docker Compose

This command downloads and installs the latest Docker Compose.

Enjoy!

Source: http://blog.couchbase.com/2016/docker-installation-scripts

Couchbase Docker Container

Couchbase Docker images are always at hub.docker.com/_/couchbase/. Complete instructions to run Couchbase Docker Container are available at docs.docker.com/engine/examples/couchbase/.

Start Couchbase Docker Container

How do you start a Couchbase Docker container?

By default, this command starts Couchbase Server 4.1 Enterprise Edition. The latest GA images are always available using this image name.

This server needs to be manually configured by going to the Web Console on http://<DOCKERHOST>:8091. The IP address of the Docker Host in my case is obtained using:

The instructions to configure the server are available at at docs.docker.com/engine/examples/couchbase/.

Pre-configured Couchbase Docker Container

If you want a pre-configured server, then you can run the image:

This image is created using Dockerfile and configures the following:

  • Configures the memory
  • Configures Index, Query, and Data service
  • Sets up username/password credentials

Couchbase 4.5 Docker Container

Couchbase 4.5 Developer Preview was launched recently. It can run as a Docker container as:

Notice the image name is couchbase/server:enterprise-4.5.0-DP1.

The Couchbase Web Console is then accessible at http://<DOCKERHOST>:8091. The IP address of the Docker Host in my case is obtained using:

And so the Web Console looks like:

Couchbase 4.5 Developer Preview

After configuring the services, the Console looks like:

Couchbase 4.5 Developer Preview 1 Console

Pre-configured Couchbase 4.5 Docker Container

Now, if you want a pre-configured server, try this:

This image is created using Dockerfile and configures the following:

  • Configures the memory
  • Configures Index, Query, Data, and Full-text service
  • Sets up username/password credentials

So, here are the images you need to use:

Image Purpose
couchbase  Last GA version of Couchbase
couchbase/server  Intermediate builds of Couchbase, such as Developer Preview, Beta, etc
arungupta/couchbase  Last GA version of Couchbase, pre-configured
arungupta/couchbase-server  Intermediate builds of Couchbase, pre-configured

Easy, eh?

Originally published at: http://blog.couchbase.com/2016/february/couchbase-docker-container

Couchbase 4.5 Developer Preview Now Available!

Couchbase 4.5 Developer Preview is now available!

Couchbase 4.5 Developer Preview

As we head towards 4.5 GA, this is a significant milestone packed with many exciting features for more efficient querying, advanced data access, powerful indexing, and more comprehensive administration.

For developers, this is going to be a big preview release as it brings some exciting features including:

We’ve also introduced Debian 8 builds and this adds to the existing wide list of platforms we already run on.

Here are some quick links:

Interested in learning more about each feature, then watch different videos (more coming) in this playlist:

Enjoy!

Originally posted at: http://blog.couchbase.com/2016/february/couchbase-4.5-developer-preview-available

Couchbase Weekly, Feb 15, 2016

Learn what’s latest in the Couchbase Community.
Couchbase Developer Community

Let us know if we missed anything at @couchbasedev@couchbase or #Couchbase.

Couchbase Weekly

Couchbase Weekly

Media Mentions

Blogs

Couchbase Weekly 3

Upcoming Events

Webinars

5-part webinar series for building a fullstack application using the CEAN stack — for EMEA series see here, for US series see here.

  • 201: Bootstrapping an application using the CEAN stack
  • 202: Application logic, data model, and validation
  • 203: Build a responsive front end with Angular & Bootstrap
  • 204: Built-in URL permalinking & minification
  • 205: Mobile-first development with NativeScript

February 25: From MongoDB to Couchbase: How Gannett and Others Made the Switch (US)
February 25: From MongoDB to Couchbase: How Gannett and Others Made the Switch (EMEA)

twitter-logo

  • High performance distributed caching: #Couchbase scales your #mobile #web #IoT apps. Learn how: ow.ly/XVuMP
  • #Couchbase Mobile 1.2 rolls out enterprise grade enhancements including improved security & performance: http://ow.ly/Y5sRH
  • Read the top 10 #NoSQL enterprise use cases http://ow.ly/Y5C30 #couchbase #database
  • Read this step-by-step demo and learn how to move data from #Oracle to #Couchbase: http://ow.ly/Y9zu3
  • Only #Couchbase can support the complexity & scale of today’s #BigData. Learn why enterprises are moving off RDBMS http://ow.ly/XPExv

Originally posted at: blog.couchbase.com/2016/february/couchbase-weekly-feb15-2016

NetBeans Plugin for Couchbase Part 3 – Coffee on Couchbase

coffee-on-couchbase

This is part 3 (part 2part 1) of Coffee on Couchbase series where we are building a NetBeans plugin for Couchbase. This multi-part webinar series is a discussion with Geertjan Wielenga (@GeertjanW) and Eben Haber (@ebenhaber).

As part of this series, you’ll also learn how to build a NetBeans plugin from scratch and learn the awesomeness behind NetBeans platform.

The recording from part 3 is now available:

A lot of features have been added during this part. This episode shows the following features:

  1. Login to Couchbase server
  2. See Bucket list
  3. See Documents in Bucket
  4. Query data from buckets (basic queries, N1QL queries coming later)
  5. Compare Documents (NetBeans Diff Viewer)
  6. Open Documents (in JSON editor, not savable back to Couchbase)
  7. Multiple Couchbase hosts can be configured

The next episode will show how we built these features under the hood:

All the code is evolving at: github.com/arun-gupta/couchbase-netbeans-plugin.

NetBeans plugin module file (NBM) is now available.

Here is a snapshot of the work in progress:

NetBeans Plugin for Couchbase Part 3

Let us know by filing bugs on features that you’d like to see in this plugin.

We’d love to see your tweets containing snapshots of your document in NetBeans. Use  #NetBeans #Couchbase to let us know :)

Enjoy!

Originally posted at: blog.couchbase.com/2016/netbeans-plugin-couchbase-part-3-coffee-on-couchbase

Couchbase Weekly Feb 8, 2016

Learn what’s latest in the Couchbase Community.
Couchbase Developer Community

Let us know if we missed anything at @couchbasedev@couchbase or #Couchbase.

Couchbase Weekly

  • Couchbase Mobile 1.2 released delivering enterprise grade administration, security, performance, and scalability. Read more in the Press Release.
  • Today through February 10, Couchbase is sponsoring Sweden’s largest developer conference, Jfokus in Stockholm.

Couchbase Weekly

Press Releases

Media Mentions

Blogs

Couchbase Weekly 3

Upcoming Events

Webinars

5-part webinar series for building a fullstack application using the CEAN stack — for EMEA series see here, for US series see here.

201: Bootstrapping an application using the CEAN stack
202: Application logic, data model, and validation
203: Build a responsive front end with Angular & Bootstrap
204: Built-in URL permalinking & minification
205: Mobile-first development with NativeScript

February 25: From MongoDB to Couchbase: How Gannett and Others Made the Switch (US)
February 25: From MongoDB to Couchbase: How Gannett and Others Made the Switch (EMEA)

Couchbase Meetups

Other People Meetups (OPMs)

twitter-logo

  • Hit by #parseshutsdown? Read the blog on what you can do for your apps #couchbasemobile ow.ly/XRkMy
  • #Couchbase Lite 1.2 delivers 2 – 5x faster performance for key #database operations bit.ly/1VIHqaE #NoSQL #mobile
  • Learn #NoSQL with #Couchbase free online training: ow.ly/Xx84G
  • New McKinsey research shows how the U.S. #DigitalEconomy is a potential $2 trillion market: http://ow.ly/XtSny via @HarvardBiz
  • Data center infrastructure has evolved, yet databases remain largely unchanged. It’s time to scale up and scale out http://ow.ly/XS074

Originally posted at: blog.couchbase.com/2016/february/couchbase-weekly-feb8-2016

Enable Docker Remote API on Docker Machine on Mac OS X

Docker daemon provides a Remote REST API. This API is used by the Client to communicate with the engine. This API can be also be invoked by by other tools, such as curl or Chrome Postman REST Client.

If you are creating Docker daemons using Docker Machine on OSX Mavericks, then getting this API to work is a bit tricky. This blog will explain how to enable Docker Remote API on Docker Machines created on Mac OS X.

Connecting to the secure Docker port using curl gives the command as:

Couple of issues with this command:

  • This command does not even work for Docker Machine since the certificates for each Machine are stored in .docker/machine/machines/<machine-name> directory.
  • Even if this command is modified to match that path:
    It still gives the following error:
    The culprit for this is an updated curl utility for OSX Mavericks users. In summary, the new version of CURL uses Apple’s Secure Transport API instead of the OpenSSL API. This means the certificates need to be in P12 format.

Lets fix this!

  • Go to the directory where certificates for your Machine are stored. In my case, this is .docker/machine/machines/couchbase directory.
  • Generate *.p12 format for the certificate:
    More details here.
  • Now invoke the REST API as:
    Notice, --cert now points to the generated p12 certificate and certificate password is specified sing --pass.

    This will return the result as:

    OK, now that makes sense!

  • Lets try to start Couchbase server as:

    And invoke another REST API to view more details about this container:

Read through the complete API and go crazy now!

Originally posted at: blog.couchbase.com/2016/february/enabling-docker-remote-api-docker-machine-mac-osx

Docker 1.10, Machine 0.6.0, Compose 1.6.0 – better volumes and networking

Docker 1.10 is now released!

Docker Logo

Read about all the new features in Docker 1.10. A quick summary:

  • New Compose file format
  • Much better networking
  • Much better security
  • Swarm becomes 1.1, with Mesos integration

Read Docker 1.10 release notes.

Lets look at some of the key components.

Docker Machine 0.6.0

Docker Machine makes it really easy to create Docker hosts on your computer, on cloud providers and inside your own data center. It creates servers, installs Docker on them, then configures the Docker client to talk to them.

Latest version can be installed as:

docker-machine now shows the Docker server version:

The latest server version is 1.10. And so docker upgrade command can be used to fix that:

The updated list of Machines is now shown as:

Notice that Docker version is now 1.10.

Set up the environment variables such that Docker client can talk to it:

Docker Client 1.10

Lets download the latest client to connect to this Docker Engine.

Client and Server versions are shown separately.

Run Couchbase container as:

This starts up a fully-configured Couchbase server. It can be accessed at 192.168.99.100:8091 and looks like as shown:

Docker 1.10 - Couchbase Console

Note, 192.168.99.100 is obtained using docker-machine ip <MACHINE-NAME>.

Couchbase Developer Portal provide more details about the Couchbase Server.

Docker Compose 1.6.0

Docker Compose is a tool for defining and running complex applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.

Learn more about Docker Compose 1.6.0.

Install the latest version:

The experimental flags --x-networking and --x-network-driver, introduced in Compose 1.5, have been removed. Its no longer experimental and is the recommended way to enable communication between containers.

Compose 1.6.0 requires Docker Engine 1.9.1 or later, or 1.10.0 if you’re using version 2 of the Compose File format.

Updating Compose File

Compose 1.6 introduces a new version of the Compose file. Read more details about Upgrading Compose File.

Compose 1.6 will continue to run older version of Compose files. But now networking and volumes are first class citizens.

Here is an example of version 1 of Compose file:

Here is a version 2 of Compose file:

For simple use cases, the two main changes are:

  • Add a version: '2' line at the top of the file.
  • Indent the whole file by one level and put a services: key at the top.

Running services in this Compose file is:

This starts a fully configured Couchbase server based upon the image as explained at github.com/arun-gupta/docker-images/tree/master/couchbase-node.

Docker Swarm 1.1

Docker Swarm is native clustering for Docker. It allows you to create and access a pool of Docker hosts using the full suite of Docker tools. Because Docker Swarm serves the standard Docker API, any tool that already communicates with a Docker daemon can use Swarm to transparently scale to multiple hosts.

A new experimental support for container rescheduling on node failure is added.

Read more details about setting up Docker Swarm Cluster.

Finally, here are some useful links:

Enjoy!

Deploy Docker to Amazon Cloud using Tutum

Have you felt the need to run Docker containers on Amazon?

Amazon Container Service requires extensive setup and manual work. This is meant for programmers who have plenty of time and willing to debug through multiple steps. For mundane programmers, like me, who like simple and easy to use steps, there is Docker Tutum!

What is Docker Tutum?

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

Docker Hosting Tutum

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 party line is:

Experience the simplicity of PaaS with none of its constraints. Enjoy the flexibility of IaaS with none of its complexity.

Key Concepts of Docker Tutum

The main concepts of Docker Tutum are explained below:

Docker Tutum Architecture

  • (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.
  • (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.
  • (C) Containers, (D) Links and (E) Volumes are Docker concepts.
  • (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 is what I did to run Couchbase Docker container in Amazon using Docker Tutum:

  • Get started for free (at least while its in beta) by logging in using Docker Hub account.
  • 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.
  • Create a new node cluster at dashboard.tutum.co/node/launch/Docker Tutum New Node Cluster
    The three values that need to be specified/changed:

    • Node cluster name
    • Deploy tags (optional)
    • Type/size to t2.medium
    • Disk size reduce from 60 to 20 GB

    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

  • Create your first service at dashboard.tutum.co/container/launch/. Select “Public Repositories” and search for “arungupta/couchbase-node”.
    Docker Tutum New ServiceThis image is created from github.com/arun-gupta/docker-images/tree/master/couchbase-node. This image performs the following:

  • Click on “Select” and configure. You only need to override the ports and take all other defaults:
    Docker Tutum Couchbase ConfigurationClick on “Create and Deploy”.
  • Dashboard is updated after the service is deployed:
    Docker Tutum Couchbase Service
  • Click on “Logs” to see logs from the Couchbase Docker container:
    Docker Tutum Couchbase Logs
  • Find IP address from the AWS Console:
    Docker Tutum AWS Console IP Address
  • Access Couchbase Console at <IP-ADDRESS>:8091, in our case 54.67.111.235:8091. This will show the login screen:
    Docker Tutum Couchbase Console Login
    Enter the username “Administrator” and password “password”.
  • This shows the Couchbase Console:
    Docker Tutum Couchbase Console

Create/Access Sample Bucket on Couchbase

  • Click on “Settings”, “Sample Buckets”. This shows the list of sample buckets that can be installed.
  • Select “travel-sample” and click on “Create”. The updated console looks like:
    Docker Tutum Couchbase Travel Sample
  • If you’ve downloaded Couchbase server locally, then you can use Couchbase Query CLI Tool (cbq) to connect and query:
    Couchbase allows to query document database using SQL-like syntax, aka N1QL.

So this blog showed:

  • What is Docker Tutum?
  • How to get started with Docker Tutum?
  • Deploy Couchbase Docker container on Amazon using Tutum
  • Create/Access sample bucket on Couchbase

More details:

Enjoy!

Originally posted at: http://blog.couchbase.com/2016/deploy-docker-amazon-cloud-tutum

Couchbase Weekly Feb 1, 2016

Learn what’s latest in the Couchbase Community.
Couchbase Developer Community

Let us know if we missed anything at @couchbasedev@couchbase or #Couchbase.

Couchbase Weekly

Couchbase Weekly

Press Releases

Media Mentions

Blogs

Couchbase Weekly 3

Upcoming Events

Webinars

5-part webinar series for building a fullstack application using the CEAN stack — for EMEA series see here, for US series see here.

201: Bootstrapping an application using the CEAN stack
202: Application logic, data model, and validation
203: Build a responsive front end with Angular & Bootstrap
204: Built-in URL permalinking & minification
205: Mobile-first development with NativeScript

Couchbase Meetups

Other People Meetups (OPMs)

twitter-logo

  • Facebook #Parse calls it quits leaving 600K #developers with one question – whats next? #Couchbase Mobile http://ow.ly/XMrEV
  • Amadeus and Google use #Couchbase to maximize throughput for 1500 cores in 3 data centers spanning US, Europe & Asia ow.ly/XodDO
  • Configure #Simba and #Couchbase to directly execute schemaless #N1QL queries #SQL for #JSON http://ow.ly/WZemi
  • Walmart extends its leadership in the #DigitalEconomy releasing their OneOps cloud management tool http://ow.ly/XyCSx #opensource
  • In 2015, #Couchbase continued to lead the #NoSQL market in product innovation and nearly doubled sales http://ow.ly/XyWdq 

Originally posted at: blog.couchbase.com/2016/february/couchbase-weekly-feb1-2016