Couchbase Logo

Couchbase 4.1 was recently released. Highlights of this release are:

  • N1QL: Complete SQL CRUD Support with N1QL for Batch and OLTP Applications
  • Covering Indexes
  • Prepared Statements
  • Additional Supported Platforms

You can read all about it in this article: Introducing Couchbase Server 4.1, and also watch a replay of Hands-on Introduction to What’s New in Couchbase 4.1:

Getting Started with Couchbase 4.1 and Docker

Use the following Docker Compose file:

mycouchbase:
  image: arungupta/couchbase
  ports:
    - 8091:8091
    - 8092:8092 
    - 8093:8093 
    - 11210:11210

to start a pre-configured Couchbase 4.1 Docker container:

docker-compose up -d
Creating couchbase_mycouchbase_1

This will:

The logs can be seen as:

docker-compose logs
Attaching to couchbase_mycouchbase_1
mycouchbase_1 | Starting Couchbase Server -- Web UI available at http://<ip>:8091
mycouchbase_1 | *   Trying 127.0.0.1...
mycouchbase_1 |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
mycouchbase_1 |                                  Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 8091 (#0)
mycouchbase_1 | > POST /pools/default HTTP/1.1
mycouchbase_1 | > User-Agent: curl/7.40.0-DEV
mycouchbase_1 | > Host: 127.0.0.1:8091
mycouchbase_1 | > Accept: */*
mycouchbase_1 | > Content-Length: 36
mycouchbase_1 | > Content-Type: application/x-www-form-urlencoded
mycouchbase_1 | > 
mycouchbase_1 | } [36 bytes data]
mycouchbase_1 | * upload completely sent off: 36 out of 36 bytes
mycouchbase_1 | < HTTP/1.1 200 OK
mycouchbase_1 | < Server: Couchbase Server
mycouchbase_1 | < Pragma: no-cache
mycouchbase_1 | < Date: Thu, 17 Dec 2015 05:30:16 GMT
mycouchbase_1 | < Content-Length: 0
mycouchbase_1 | < Cache-Control: no-cache
mycouchbase_1 | < 
100    36    0     0  100    36      0   1820 --:--:-- --:--:-- --:--:--  2000
mycouchbase_1 | * Connection #0 to host 127.0.0.1 left intact
mycouchbase_1 | *   Trying 127.0.0.1...
mycouchbase_1 |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
mycouchbase_1 |                                  Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 8091 (#0)
mycouchbase_1 | > POST /node/controller/setupServices HTTP/1.1
mycouchbase_1 | > User-Agent: curl/7.40.0-DEV
mycouchbase_1 | > Host: 127.0.0.1:8091
mycouchbase_1 | > Accept: */*
mycouchbase_1 | > Content-Length: 26
mycouchbase_1 | > Content-Type: application/x-www-form-urlencoded
mycouchbase_1 | > 
mycouchbase_1 | } [26 bytes data]
mycouchbase_1 | * upload completely sent off: 26 out of 26 bytes
mycouchbase_1 | < HTTP/1.1 200 OK
mycouchbase_1 | < Server: Couchbase Server
mycouchbase_1 | < Pragma: no-cache
mycouchbase_1 | < Date: Thu, 17 Dec 2015 05:30:16 GMT
mycouchbase_1 | < Content-Length: 0
mycouchbase_1 | < Cache-Control: no-cache
mycouchbase_1 | < 
100    26    0     0  100    26      0   2670 --:--:-- --:--:-- --:--:--  2888
mycouchbase_1 | * Connection #0 to host 127.0.0.1 left intact
mycouchbase_1 | *   Trying 127.0.0.1...
mycouchbase_1 |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
mycouchbase_1 |                                  Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 8091 (#0)
mycouchbase_1 | > POST /settings/web HTTP/1.1
mycouchbase_1 | > User-Agent: curl/7.40.0-DEV
mycouchbase_1 | > Host: 127.0.0.1:8091
mycouchbase_1 | > Accept: */*
mycouchbase_1 | > Content-Length: 50
mycouchbase_1 | > Content-Type: application/x-www-form-urlencoded
mycouchbase_1 | > 
mycouchbase_1 | } [50 bytes data]
mycouchbase_1 | * upload completely sent off: 50 out of 50 bytes
mycouchbase_1 | < HTTP/1.1 200 OK
mycouchbase_1 | < Server: Couchbase Server
mycouchbase_1 | < Pragma: no-cache
mycouchbase_1 | < Date: Thu, 17 Dec 2015 05:30:16 GMT
mycouchbase_1 | {"newBaseUri":"http://127.0.0.1:8091/"}< Content-Type: application/json
mycouchbase_1 | < Content-Length: 39
mycouchbase_1 | < Cache-Control: no-cache
mycouchbase_1 | < 
mycouchbase_1 | { [39 bytes data]
100    89  100    39  100    50   3544   4543 --:--:-- --:--:-- --:--:--  5000
mycouchbase_1 | * Connection #0 to host 127.0.0.1 left intact
mycouchbase_1 | *   Trying 127.0.0.1...
mycouchbase_1 |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
mycouchbase_1 |                                  Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 8091 (#0)
mycouchbase_1 | * Server auth using Basic with user 'Administrator'
mycouchbase_1 | > POST /sampleBuckets/install HTTP/1.1
mycouchbase_1 | > Authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==
mycouchbase_1 | > User-Agent: curl/7.40.0-DEV
mycouchbase_1 | > Host: 127.0.0.1:8091
mycouchbase_1 | > Accept: */*
mycouchbase_1 | > Content-Length: 17
mycouchbase_1 | > Content-Type: application/x-www-form-urlencoded
mycouchbase_1 | > 
mycouchbase_1 | } [17 bytes data]
mycouchbase_1 | * upload completely sent off: 17 out of 17 bytes
mycouchbase_1 | < HTTP/1.1 202 Accepted
mycouchbase_1 | < Server: Couchbase Server
mycouchbase_1 | < Pragma: no-cache
mycouchbase_1 | < Date: Thu, 17 Dec 2015 05:30:16 GMT
mycouchbase_1 | < []Content-Type: application/json
mycouchbase_1 | < Content-Length: 2
mycouchbase_1 | < Cache-Control: no-cache
mycouchbase_1 | < 
mycouchbase_1 | { [2 bytes data]
100    19  100     2  100    17     29    251 --:--:-- --:--:-- --:--:--   253
mycouchbase_1 | * Connection #0 to host 127.0.0.1 left intact
mycouchbase_1 | /entrypoint.sh couchbase-server

Connect to CBQ (Couchbase Query tool):

docker run -it couchbase /opt/couchbase/bin/cbq -engine=http://$(docker-machine ip couchbase):8093
Couchbase query shell connected to http://192.168.99.102:8093/ . Type Ctrl-D to exit.
cbq>

Learn more about Running N1QL Queries from Command Line.

Stop the server:

docker-compose stop
Stopping couchbase_mycouchbase_1 ... done

Remove the container:

docker-compose rm -f
Going to remove couchbase_mycouchbase_1
Removing couchbase_mycouchbase_1 ... done

Read more about Couchbase 4.1:

Share feedback with us at forums.couchbase.com or Stackoverflow.

Enjoy!

Get Acquainted with Couchbase 4.1 Docker Container

| Cloud| 143 views | 0 Comments
About The Author
- Arun Gupta is the vice president of developer advocacy at Couchbase. He has been building developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of a best-selling book, an avid runner, a globe trotter, a Java Champion, and a JUG leader, he is easily accessible at @arungupta.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>