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";