I have installed Couchbase Server and Sync Gateway locally on my Mac. What I am trying to do is push the data in a Couchbase Lite database in an app to a Couchbase Server using Sync Gateway.
First baby step: attempt to get the Sync Gateway configured and running.
Using Couchbase Server's admin console I created a new bucket (e.g. mybucket). Confused about databases and buckets...I would have thought I would create a database, but there seems to be no option to do this so I created a bucket instead.
Created a config file for the Sync Gateway:
{
"interface":"4984",
"adminInterface":"4985",
"databases":{
"mybucket":{
"server":"
http://localhost:8091",
"sync":`function(doc) { channel(doc.channels);}`
}
}
}
macbook:bin me$ ./sync_gateway /some/path/sync_gateway_config.json
09:54:23.344462 ==== Couchbase Sync Gateway/1.00 (1.0.0-23; commit 46d2fdaf) ====
09:54:23.344560 Configured Go to use all 4 CPUs; setenv GOMAXPROCS to override this
09:54:23.344567 Configured MaxFileDescriptors (RLIMIT_NOFILE) to 5000
09:54:23.344579 Opening db /mybucket as bucket "mybucket", pool "default", server <
http://localhost:8091>
09:54:23.344611 Opening Couchbase database mybucket on <
http://localhost:8091>
09:54:23.389506 Recomputing document channels...
09:54:23.410012 Starting admin server on 4985
09:54:23.411217 Starting server on 4984 ...
09:54:23.411334 FATAL: Failed to start HTTP server on 4985: listen tcp: missing port in address 4985 -- rest.(*ServerConfig).serve() at config.go:346
What am I doing wrong?
One additional complication: The account I am logged in as on my Mac is a "standard" account. To install Couchbase Server successfully I had to switch to an "Administrator" account. As such, I run Couchbase Server and Sync Gateway from the command line, first logging in as an administrator using su - <admin account>.