Couchbase Docker#
Couchbase Server is a NoSQL document database with a distributed architecture for performance, scalability, and availability. It enables developers to build applications easier and faster by leveraging the power of SQL with the flexibility of JSON.
Docker#
docker run -d --name db -p 8091-8097:8091-8097 -p 9123:9123 -p 11207:11207 -p 11210:11210 -p 11280:11280 -p 18091-18097:18091-18097 couchbase
Docker Compose#
couchbase.yml
Visit http://localhost:8091
on the host machine to see the Web Console and start Couchbase Server setup.
Walk through the Setup wizard and choose โFinish With Defaults.โ
Multi Node Couchbase Server Cluster Deployment Topologies#
With multi node Couchbase Server clusters, there are 2 popular topologies.
All Couchbase Server containers on one physical machine#
This model is commonly used for scale-minimized deployments simulating production deployments for development and test purposes.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Host OS (Linux) โ
โ โ
โ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โ โ Container OS โ โ Container OS โ โ Container OS โ โ
โ โ (Ubuntu) โ โ (Ubuntu) โ โ (Ubuntu) โ โ
โ โ โโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโ โ โ
โ โ โ Couchbase โ โ โ โ Couchbase โ โ โ โ Couchbase โ โ โ
โ โ โ Server โ โ โ โ Server โ โ โ โ Server โ โ โ
โ โ โโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Each Couchbase Server container on its own machine#
This model is commonly used for production deployments.
โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ
โ Host OS (Linux) โ โ Host OS (Linux) โ โ Host OS (Linux) โ
โ โโโโโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโโโโ โ
โ โ Container OS โ โ โ โ Container OS โ โ โ โ Container OS โ โ
โ โ (Ubuntu) โ โ โ โ (Ubuntu) โ โ โ โ (Ubuntu) โ โ
โ โ โโโโโโโโโโโโโ โ โ โ โ โโโโโโโโโโโโโ โ โ โ โ โโโโโโโโโโโโโ โ โ
โ โ โ Couchbase โ โ โ โ โ โ Couchbase โ โ โ โ โ โ Couchbase โ โ โ
โ โ โ Server โ โ โ โ โ โ Server โ โ โ โ โ โ Server โ โ โ
โ โ โโโโโโโโโโโโโ โ โ โ โ โโโโโโโโโโโโโ โ โ โ โ โโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโโโโ โ โ โโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ
Running A N1QL Query on the Couchbase Server Cluster#
N1QL is the SQL based query language for Couchbase Server. Simply switch to the Query tab on the Web Console at http://localhost:8091
and run the following N1QL Query in the query window:
SELECT name FROM `beer-sample` WHERE brewery_id="mishawaka_brewing";
You can also execute N1QL queries from the command line.
$ docker exec -it db cbq --user Administrator
cbq> SELECT name FROM `beer-sample` WHERE brewery_id ="mishawaka_brewing";