Run Sync Gateway + Couchbase Server Under CoreOS on AWS

77 views
Skip to first unread message

Traun Leyden

unread,
Nov 3, 2014, 2:22:26 PM11/3/14
to mobile-c...@googlegroups.com

I put together instructions on running Sync Gateway + Couchbase Server under CoreOS / Docker:

https://github.com/tleyden/sync-gateway-coreos

CoreOS is a custom distribution of Linux that is geared towards running Docker containers.  Docker is essentially a lighter weight virtualization method than traditional virtualization, where processes in the container run on the host OS directly and avoid any CPU emulation overhead.  

CoreOS also includes etcd, which is a distributed key-value store and is useful for service discovery, which turns out to be very useful in the case of Couchbase Server.

As a word of caution, running Couchbase Server inside a Docker container is considered "experimental", so you'd probably want to do a lot of testing before running this in production.  This is really geared towards spinning up servers to develop against as quick as possible.  But one day, it will hopefully become a recommended production practice.

It's using "docker volumes" for storing the Couchbase database files, which should avoid any potential performance pitfalls with using the container filesystem.  If you find any issues, please post them either here or as issues on the repo listed above.

Currently it does require a bit more manual setup than I'd want, and I'm working on  streamline it a bit.  But having said that, you should be able to spin-up an n-node Couchbase Server cluster plus a sync gateway server on AWS in under 30 minutes, where most of that is just waiting for things to happen rather than having to do much work on your own.


Todd Freese

unread,
Jan 26, 2015, 6:53:45 PM1/26/15
to mobile-c...@googlegroups.com
Is there anyway to define the availability zones for the nodes?

For example, if you have 2 nodes, they should really be in two different zones.

Also, is there a way to point to a release version of SG instead of running off master?

Todd

Traun Leyden

unread,
Jan 26, 2015, 7:12:14 PM1/26/15
to mobile-c...@googlegroups.com

Hey Todd,


Is there anyway to define the availability zones for the nodes?


I haven't looked into that yet, but I'll keep it in mind.  If you try it, please let me know how it goes, and I can try to fold that into the scripts / config.  

 
For example, if you have 2 nodes, they should really be in two different zones.

Also, is there a way to point to a release version of SG instead of running off master?


Yep, there is a command line argument for that, pass in the commit in the -c flag.  For example to run the commit corresponding to the 1.0.4 release tag:

./sync-gw-cluster-init.sh -n 1 -c 04138fd46da1a7ccd49377fd91e6e543cefb4046 -b "todos" -z 512 -g $SG_CONFIG_URL -v 3.0.1 -m 3 -u user:passw0rd

Or if you already have your cluster spun up, you'd want to do this:

 $ fleetctl stop sync_gw_...@1.service sync_g...@1.service
 $ etcdctl set /couchbase.com/sync-gateway/commit 04138fd46da1a7ccd49377fd91e6e543cefb4046
 $ fleetctl start sync_gw_...@1.service sync_g...@1.service

Let me know if that works for you.

 
Todd

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/ed72560f-c455-4844-ac8f-8f6109969272%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages