Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Couchbase XDCR Simulator in Sinatra
tree: 56ecfa8860

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Cross-Data Center Replication (XDCR) Simulator in Sinatra

When working, can be used to "do stuff" with documents as they are streamed through XDCR to Sinatra. Still a work in progress...


gem 'sinatra'
gem 'sinatra-basicauth'
gem 'json'
gem 'active_support' # for generating UUID's


$ git clone
$ cd xdcr-sinatra
$ ruby xdcr.rb
  1. In Couchbase Web Admin, click on XDCR Tab
  2. Click on Create Cluster Reference Button
  3. Create a name, and Add host and port (i.e.
  4. Enter your u: Administrator p: [your password]
  5. Click Done

Right now not everything is working for the Cluster Reference to work all the way through the Registration Process

Couchbase Requests supported:


  • /pools (GET)
  • /pools/default (GET)
  • /pools/default/buckets (GET)
  • /pools/default/buckets/{bucket} (GET)
  • /{database} (HEAD, GET)
  • /{database}/{vbucket};{uuid}
  • /{database}/master/{vbucket};{uuid}
  • /{database}/{docid} (GET)

  • /{database}/_ensure_full_commit (POST)

  • /{database}/_revs_diff (POST) GETTING STUCK HERE on the Response
  • /{database}/_bulk_docs (POST)

Currently Working on...

Current Error Error replicating vbucket 965:

  { nocatch,  { bad_request, <<"Invalid rev format">> }
    { couch_doc,parse_rev,1 }, 
    { couch_api_wrap, '-get_missing_revs/2-fun-0-', 1 }, 
    { lists,map,2 }, 
    { couch_api_wrap, '-get_missing_revs/2-fun-1-', 3 }, 
    { xdc_vbucket_rep_worker, find_missing,2 }, 
    { xdc_vbucket_rep_worker, queue_fetch_loop,4 }
Something went wrong with that request. Please try again.