A quick starting kit for developers deploying via Docker Compose the Sync Gateway +3.1.3 & Couchbase +7.2.3 cluster environment using Scope & Collections
- Docker Compose
- Build SGW docker image
docker compose build
- Setup Docker Compose Couchbase Server & Sync Gateway Instances
docker-compose up
- Wait Until Buckets & Sync Gateway are ready
Wait until your Sync Gateway is available in the following link http://localhost:4984
Verify the Couchbase Server Admin Console with username: Administrator
and password password
on http://localhost:8091
Check the Couchbase Server demo
bucket and custom
scope with the three collections: typeA
, typeB
& typeC
.
Check the Couchbase Server User sync_gateway
with mobile sync gateway role on demo bucket and metrics_user
for prometheus metrics scrapping in Sync Gateway and Couchbase Server.
Note: This Sync Gateway configuration does not include TLS connections.
Verify Sync Gateway Database & Users
From your host CMD/terminal you can check the db
database and userdb1
user creation:
curl http://localhost:4985/db/
Note: This database configuration has defined num_index_replicas: 0
. Please change this parameter to the default value 1 when your Couchbase Server cluster contains at least 2 indexes service nodes.
In this example, we have setup a custom
scope and collections typeA
and typeB
. Note: collection typeC
is not synced with this Sync Gateway database.
curl http://localhost:4985/db/_config
Let´s verify the database users
curl http://localhost:4985/db/_user/
And the user userdb1
details info:
curl http://localhost:4985/db/_user/userdb1
Verify your Monitoring System
- Node Exporter at http://localhost:9100
- Prometheus at http://localhost:9090
- Grafana at http://localhost:3000
Let´s load the sync gateway dashboard...
- Run your own Couchbase Mobile App
replication sgw url: ws://127.0.0.1:4984/db
replication scope: custom
replication collections: typeA,typeB
authenticator:
username: userdb1
password: password
- Start docker compose
docker-compose up
- Stop docker compose
ctrl-c
& then
docker-compose down
- Clean up logs & data from Couchbase Server mapped into localhost volume
./cleanup-data.sh
-- TBD --
-- TBD --