Skip to content

Running Sync Gateway on RPi 2

Andrew Reslan edited this page Mar 26, 2015 · 6 revisions

#Running Sync Gateway on RPi 2

Follow these steps to Build and Run Sync Gateway on Raspberry Pi 2.

##Why is this useful

Couchbase mobile can support tree topologies, where Sync Gateway instances are deployed to distributed geographical locations to provide local sync points.

These remote Sync Gateway instances can do local processing of documents and send aggregate information to a central Sync Gateway in a data centre.

In many cases deploying a full Sync Gateway cluster at remote locations will not be practical or cost effective, e.g. in retail stores or hostile (to computers) environments.

A low power embedded system may be more suited to these environments.

Embedded Sync Gateway may also be useful for mini-hacks and hands on demonstrations.

##Setup RPi 2 Follow standard instructions to install Raspbian operating system

##Installing Go Lang tools on RPi

wget http://dave.cheney.net/paste/go1.4.2.linux-arm~multiarch-armv7-1.tar.gz
sudo tar -C /usr/local -xzf  go1.4.2.linux-arm~multiarch-armv7-1.tar.gz

##Add Go Lang tools to PATH

export PATH=$PATH:/usr/local/go/bin

##Install Git client

sudo apt-get install git sudo apt-get install bc

##Download Sync Gateway source

git clone https://github.com/couchbase/sync_gateway.git
git submodule update --init --recursive

Build Sync Gateway

cd sync_gateway
./build.sh

##Run Sync Gateway

bin/sync_gateway examples/admin_party.json

##Test Sync Gateway

curl -X GET http://localhost:4985/db/

#Known Issues

Embedded Sync Gateway is using the walrus embedded DB, this DB is designed for local development and testing and does not provide write ahead logs for durability e.t.c

Sync Gateway could use an Embedded ForestDB instance for durable and scalable storage/indexing.

Clone this wiki locally