PrerequisitesRep assumes the user has:
- Set up and configured the ability to build and run a local CouchDB 2.0 cluster. See the README for more details
- Python 2.7
Setting up a local database clusterThe start command might look like:
After running the start command, a three-node cluster in development mode should be running. The first node listens on port 15984, with adm as the admin user and pass as the password.$ cd $couchdb_source_dir $ ./configure ... $ make $ ./dev/run --admin=adm:pass
Launching RepThen after cloning or downloading CouchDyno, run the ./build.sh script in its top directory. build.sh is just a wrapper around virtualenv and pip requirements install. Now, let’s launch Rep.
Notice this prompt looks remarkably like a Jupyter / IPython prompt. That’s because it uses Jupyter/IPython underneath and adds a few extra auto-imports and other nice things. Also, a lot of the module-level functions can be discovered by pressing the [Tab] key after typing “rep.” and the prompt should auto-complete with a set of choices. Here is how to set up one source to two targets replication scenario. The source will contain 10 documents. These 10 documents should be replicated to the two targets. Rep will then verify that is the case. And will also repeat the whole thing thing times in a row:$ ./venv/bin/rep Interactive replication toolbox rep, rep.getsrv, rep.getrdb and couchdb modules are auto-imported Assumes the cluster runs on http://adm:pass@localhost:5984 Type rep. and press
to auto-complete available functions ... In:
rep.replicate_1_to_n_and_compare(n=2, cycles=3, num=10) configuration: cluster_branch = None cluster_repo = None cluster_reset_data = True cluster_settings = None cluster_tmpdir = None connection_timeout = 30000 create_target = False http_connections = 20 prefix = cdyno replicator_url = None server_url = http://adm:pass@localhost:15984 source_url = None target_url = None timeout = 0 worker_processes = 4 ...