Skip to content

Latest commit

 

History

History
86 lines (55 loc) · 2.89 KB

02-Couchbase-Introduction.md

File metadata and controls

86 lines (55 loc) · 2.89 KB

02 Couchbase Introduction

Couchbase has a nice introduction:

http://hub.docker.com/r/couchbase/server

We will start off with the Community Edition (6.0.0 as of the time of writing):

$ docker run --name db -p 8091-8094:8091-8094 -p 11210:11210 --rm couchbase:community-6.0.0
Unable to find image 'couchbase:community-6.0.0' locally
community-6.0.0: Pulling from library/couchbase
7b722c1070cd: Pull complete 
5fbf74db61f1: Pull complete 
ed41cb72e5c9: Pull complete 
7ea47a67709e: Pull complete 
ca04de705515: Pull complete 
90771350bcab: Pull complete 
79af75d1044c: Pull complete 
41c3df01c635: Pull complete 
e6eb0512d813: Pull complete 
3d5ef856364c: Pull complete 
52d068d8593c: Pull complete 
ed268ff62c2b: Pull complete 
61cb7b758139: Pull complete 
Digest: sha256:5aa8172f1ef8fa78bd3d0b54caefa0c691496eb3f2eceb6fac053b900aba8fca
Status: Downloaded newer image for couchbase:community-6.0.0
Starting Couchbase Server -- Web UI available at http://<ip>:8091
and logs available in /opt/couchbase/var/lib/couchbase/logs
<...>

[This may take some time, depending upon download speed.]

This makes the Admin UI for our Couchbase server available at:

http://localhost:8091

It should look as follows:

Couchbase Server 1

We will click Setup New Cluster.

Couchbase Server 2

We will add values as shown (the password is admin123) and click Next: Accept Terms.

Couchbase Server 3

We will accept the terms and conditions as shown and click Configure Disk, Memory, Services.

Couchbase Server 4

We will accept the default values as shown and click Save & Finish.

Which should give us this spiffy dashboard:

Couchbase Dashboard

We will click on the sample bucket link, select the beer sample option and click Load Sample Data.

This will give rise to the following warning screen:

Couchbase Bucket warning

We will click on the Security tab, and then click ADD USER:

Couchbase Add User

And the following screen will be displayed:

Couchbase User

We will add values as shown (the password is test123) and click Add User.

And now we can query our database SELECT name FROM beer-sample WHERE brewery_id ="mishawaka_brewing";:

Couchbase Query

Note that the bucket is surrounded by backticks (`) and the result set is provided as JSON.

However, we can also display our result set as a Table or a Tree. We can also export our results as JSON.

[Unusually, Ctrl-C / Ctrl-D will not stop our Couchbase server. We will need to kill it from a new terminal.]