I’m trying to use CouchBase Server and Sync Gateway using Docker and Docker Compose. Here is my docker-compose.yml file:
version: "3"
services:
couchbase-server:
image: couchbase/server
ports:
- "8091:8091"
- "11210:11210"
volumes:
- /opt/couchbase/var:/opt/couchbase/var
sync-gateway:
image: couchbase/sync-gateway
ports:
- "4984:4984"
- "4985:4985"
volumes:
- ./sync-gateway-config.json:/etc/sync_gateway/config.json
- ./wait-for-it.sh:/wait-for-it.sh
depends_on:
- couchbase-server
entrypoint: ['/wait-for-it.sh', 'couchbase-server:8091', '--timeout=64', '--', '/entrypoint.sh', '/etc/sync_gateway/config.json']
Here is my sync-gateway-config.json:
{
"log": ["HTTP+"],
"adminInterface":":4985",
"interface": ":4984",
"databases": {
"db": {
"server": "http://couchbase-server:8091",
"bucket": "default",
"username": "sync-gateway",
"password": "password",
"num_index_replicas": 0,
"users": {
"GUEST": {"disabled": false, "admin_channels": ["*"] }
}
}
}
}
Here what I get on “docker-compose up”:
Starting couchbase-docker-compose_couchbase-server_1 ...
e[1Ae[2K
Starting couchbase-docker-compose_couchbase-server_1 ... e[32mdonee[0m
e[1BStarting couchbase-docker-compose_sync-gateway_1 ...
e[1Ae[2K
Starting couchbase-docker-compose_sync-gateway_1 ... e[32mdonee[0m
e[1BAttaching to couchbase-docker-compose_couchbase-server_1, couchbase-docker-compose_sync-gateway_1
sync-gateway_1 | wait-for-it.sh: waiting 64 seconds for couchbase-server:8091
couchbase-server_1 | Starting Couchbase Server -- Web UI available at http://<ip>:8091
couchbase-server_1 | and logs available in /opt/couchbase/var/lib/couchbase/logs
sync-gateway_1 | wait-for-it.sh: couchbase-server:8091 is available after 12 seconds
sync-gateway_1 | 2019-01-12T20:05:29.118Z [WRN] Using deprecated config option: log. Use logging.console.log_keys instead. -- rest.(*ServerConfig).deprecatedConfigLoggingFallback() at config.go:623
sync-gateway_1 | 2019-01-12T20:05:29.118Z [ERR] No logFilePath configured, and --defaultLogFilePath flag is not set. Log files required for product support are not being generated. -- base.(*LoggingConfig).Init() at logging_config.go:40
sync-gateway_1 | 2019-01-12T20:05:29.118Z ==== Couchbase Sync Gateway/2.1.2(2;35fe28e) ====
sync-gateway_1 | 2019-01-12T20:05:29.118Z [INF] Console LogKeys: [HTTP HTTP+]
sync-gateway_1 | 2019-01-12T20:05:29.118Z [INF] Console LogLevel: info
sync-gateway_1 | 2019-01-12T20:05:29.118Z [INF] Log Redaction Level: none
sync-gateway_1 | 2019-01-12T20:05:29.118Z [INF] requestedSoftFDLimit < currentSoftFdLimit (5000 < 1048576) no action needed
sync-gateway_1 | 2019-01-12T20:05:29.118Z [INF] Opening db /db as bucket "default", pool "default", server <http://couchbase-server:8091>
sync-gateway_1 | 2019-01-12T20:05:29.118Z [INF] GoCBCustomSGTranscoder Opening Couchbase database default on <http://couchbase-server:8091> as user "sync-gateway"
sync-gateway_1 | 2019-01-12T20:05:30.318Z [INF] Successfully opened bucket
sync-gateway_1 | 2019-01-12T20:05:32.821Z [ERR] Error opening database db: operation has timed out
sync-gateway_1 | Unrecoverable GoCB error calling Stats()
sync-gateway_1 | github.com/couchbase/sync_gateway/base.(*CouchbaseBucketGoCB).CouchbaseServerVersion
sync-gateway_1 | /home/couchbase/jenkins/workspace/sgw-unix-build/2.1.2/enterprise/godeps/src/github.com/couchbase/sync_gateway/base/bucket_gocb.go:2254
sync-gateway_1 | github.com/couchbase/sync_gateway/base.IsMinimumServerVersion
sync-gateway_1 | /home/couchbase/jenkins/workspace/sgw-unix-build/2.1.2/enterprise/godeps/src/github.com/couchbase/sync_gateway/base/bucket.go:546
sync-gateway_1 | github.com/couchbase/sync_gateway/rest.(*ServerContext)._getOrAddDatabaseFromConfig
sync-gateway_1 | /home/couchbase/jenkins/workspace/sgw-unix-build/2.1.2/enterprise/godeps/src/github.com/couchbase/sync_gateway/rest/server_context.go:477
sync-gateway_1 | github.com/couchbase/sync_gateway/rest.(*ServerContext).getOrAddDatabaseFromConfig
sync-gateway_1 | /home/couchbase/jenkins/workspace/sgw-unix-build/2.1.2/enterprise/godeps/src/github.com/couchbase/sync_gateway/rest/server_context.go:301
sync-gateway_1 | github.com/couchbase/sync_gateway/rest.(*ServerContext).AddDatabaseFromConfig
sync-gateway_1 | /home/couchbase/jenkins/workspace/sgw-unix-build/2.1.2/enterprise/godeps/src/github.com/couchbase/sync_gateway/rest/server_context.go:755
sync-gateway_1 | github.com/couchbase/sync_gateway/rest.RunServer
sync-gateway_1 | /home/couchbase/jenkins/workspace/sgw-unix-build/2.1.2/enterprise/godeps/src/github.com/couchbase/sync_gateway/rest/config.go:902
sync-gateway_1 | github.com/couchbase/sync_gateway/rest.ServerMain
sync-gateway_1 | /home/couchbase/jenkins/workspace/sgw-unix-build/2.1.2/enterprise/godeps/src/github.com/couchbase/sync_gateway/rest/config.go:964
sync-gateway_1 | main.main
sync-gateway_1 | /home/couchbase/jenkins/workspace/sgw-unix-build/2.1.2/enterprise/godeps/src/github.com/couchbase/sync_gateway/main.go:40
sync-gateway_1 | runtime.main
sync-gateway_1 | /usr/local/go/1.8.5/go/src/runtime/proc.go:185
sync-gateway_1 | runtime.goexit
sync-gateway_1 | /usr/local/go/1.8.5/go/src/runtime/asm_amd64.s:2197 -- rest.RunServer() at config.go:903
couchbase-docker-compose_sync-gateway_1 exited with code 1
I can access the default bucket from web UI without any problems. What should I do?