Skip to content
Browse files

CBD-594: Add cbdocloader func spec

Change-Id: I086222c5e6eede296a29435a2f4bd490ac3f7061
Reviewed-on: http://review.couchbase.org/20996
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Bin Cui <bin.cui@gmail.com>
  • Loading branch information...
1 parent 0a08bf1 commit 693225bbf5939f91bb58757e067ff58643d4ca3b @bcui6611 bcui6611 committed with Peter Wansch Sep 20, 2012
Showing with 61 additions and 10 deletions.
  1. +0 −10 README
  2. +61 −0 README.md
View
10 README
@@ -1,10 +0,0 @@
-
-1. Install couchbase python client library
- git clone git://github.com/couchbase/couchbase-python-client.git
- python setup.py install
-
-2. Run cbdocloader
- cbdocloader.py -u Administrator -p 123456 -b mybucket testapp.zip
-or cbdocloader.py -u Administrator -p 123456 -b mybucket testapp.zip
-or cbdocloader -p 8091 -b newsim -u newsim -p newsim gamesim-sample.zip
-
View
61 README.md
@@ -0,0 +1,61 @@
+Docloader
+=============
+
+We use this tool to upload a bunch of json documents into Couchbase Server.
+
+Build
+-------
+
+After you clone the project from `git@github.com:couchbase/couchbase-examples.git`, run the following command:
+
+ config/autorun.sh
+
+To build the package, run
+
+ make bdist
+
+Run command
+------------
+
+ cbdocloader OPTIONS DOCUMENTS
+
+DOCUMENTS:
+
+The documents parameter can be either a directory name which contains all the json documents or a .zip file which archives the document directory.
+
+Generally speaking, the document directory should have the following layout:
+
+ /design_docs which contains all the design docs for views.
+ /docs which contains all the raw json data files. It can have other sub directories too.
+
+All json files should be well formatted. And no spaces allowed in file names. Design docs will be uploaded after all other data files.
+
+OPTIONS:
+
+ `-n HOST[:PORT]`, --node=HOST[:PORT] Default port is 8091
+
+ `-u USERNAME`, --user=USERNAME REST username of the cluster. It can be specified in environment variable REST_USERNAME.
+
+ `-p PASSWORD`, --password=PASSWORD REST password of the cluster. It can be specified in environment variable REST_PASSWORD.
+
+ `-b BUCKETNAME`, --bucket=BUCKETNAME Specific bucket name. Default is default bucket. Bucket will be created if it doesn't exist.
+
+ `-s QUOTA`, RAM quota for the bucket. Unit is MB. Default is 100MB.
+
+ `-h` --help Show this help message and exit
+
+Example
+-------
+
+ # Upload documents archived in zip file ../samples/gamesim.zip. All data will be inserted in bucket mybucket
+ #
+ ./cbdocloader -n localhost:8091 -u Administrator -p password -b mybucket ../samples/gamesim.zip
+
+Errors
+------
+
+These are kinds of error cases to consider ...
+
+* JSON files are not well formatted
+* Wrong REST username and password
+* Bucket cannot be created due to too large ram quota specified.

0 comments on commit 693225b

Please sign in to comment.
Something went wrong with that request. Please try again.