You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by garrensmith <gi...@git.apache.org> on 2015/10/26 15:13:39 UTC

[GitHub] couchdb-nmo pull request: Replication

GitHub user garrensmith opened a pull request:

    https://github.com/apache/couchdb-nmo/pull/11

    Replication

    This adds `replicate-from` and `replicate-to`. Replication to and from a
    cluster to another CouchDB instance.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/garrensmith/couchdb-nmo replicate

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-nmo/pull/11.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #11
    
----
commit d22b0538b345a07ad997ece3ddbd0ebfb7b5be42
Author: Garren Smith <ga...@gmail.com>
Date:   2015-10-26T14:03:43Z

    Replication
    
    This adds `replicate-from` and `replicate-to`. Replication to and from a
    cluster to another CouchDB instance.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#discussion_r43252435
  
    --- Diff: doc/api/nmo-replicate-from.md ---
    @@ -0,0 +1,11 @@
    +nmo-replicateFrom(3) -- replicate-from
    +==============================
    +
    +## SYNOPSIS
    +
    +    nmo.commands.replicateFrom([<clusterurl> || <cluster>], database, url)
    --- End diff --
    
    hmm... 
    
    we have three types of commands now:
    
    ```
    nmo-couch-config     -- nmo.commands['couch-config']
    nmo-activetasks      -- nmo.commands.activetasks
    nmo-replicateFrom    -- nmo.commands.replicateFrom
    ```
    
    (divided by dash, without dash & all small, camelCase)
    
    we should decide for one - i would vote for all together, small (like activetasks) -- what do you think?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#discussion_r44915491
  
    --- Diff: doc/api/replicate-to.md ---
    @@ -0,0 +1,11 @@
    +nmo-replicateTo(3) -- replicate-to
    --- End diff --
    
    replicateto


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#discussion_r43252447
  
    --- Diff: doc/cli/nmo-replicate-from.md ---
    @@ -0,0 +1,24 @@
    +nmo-replicate-from(1) -- replicate a database from the cluster to another CouchDB database url
    +===========================================
    +
    +## SYNOPSIS
    +
    +    nmo replicate-from <cluster> <databasename> <url/dbname> [--continuous] [--create-target] [--json]
    +    nmo replicate-from <url> <databasename> <url/dbname> [--continuous] [--create-target] [--json]
    +
    +
    +## DESCRIPTION
    +
    +Replicate a database from the `cluster` to the supplied CouchDB instance url and database. Or it will replicate from a CouchDB url and database to the supplied CouchDB instance url and database.
    +
    +
    +Example:
    +
    +This will replicate the database `hello-database` from the cluster `mycluster` to the supplied url
    +    nmo replicate-from mycluster hello-database http://192.0.0.1/hello-database-replicated
    +
    +This will replicate the database `hello-database` from the cluster `mycluster` to the supplied url and create the target and make it a continuous replication
    +    nmo replicate-from mycluster hello-database http://192.0.0.1/hello-database-replicated --create-target --continuous
    +
    +This will replicate the database `hello-database` from the url `http://my-couchdb-cluster.com` to the supplied url
    +    nmo replicate-from http://my-couchdb-cluster hello-database http://192.0.0.1/hello-database-replicated
    --- End diff --
    
    url must be `http://my-couchdb-cluster.com`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#discussion_r44915475
  
    --- Diff: doc/api/nmo-replicate-from.md ---
    @@ -0,0 +1,11 @@
    +nmo-replicateFrom(3) -- replicate-from
    --- End diff --
    
    replicatefrom


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#discussion_r43252454
  
    --- Diff: doc/cli/replicate-to.md ---
    @@ -0,0 +1,24 @@
    +nmo-replicate-to(1) -- replicate a database to the cluster from another CouchDB database url
    +===========================================
    +
    +## SYNOPSIS
    +
    +    nmo replicate-to <cluster> <databasename> <url/dbname> [--continuous] [--create-target] [--json]
    +    nmo replicate-to <url> <databasename> <url/dbname> [--continuous] [--create-target] [--json]
    +
    +
    +## DESCRIPTION
    +
    +Replicate a database to the `cluster` from the supplied CouchDB instance url and database. Or it will replicate from a CouchDB url and database to the supplied CouchDB instance url and database.
    +
    +
    +Example:
    +
    +This will replicate the database `hello-database` from the url to database `hlloe-database-replicated` in cluster `mycluster`.
    +    nmo replicate-to mycluster hello-database-replicated http://192.0.0.1/hello-database
    +
    +This will replicate the database `hello-database` to the cluster `mycluster` and create the database and make it a continuous replication
    +    nmo replicate-to mycluster hello-database-replicated http://192.0.0.1/hello-database --create-target --continuous
    +
    +This will replicate the database `hello-database` to the url `http://my-couchdb-cluster.com` from the supplied url
    +    nmo replicate-from http://my-couchdb-cluster hello-database-replicated http://192.0.0.1/hello-database
    --- End diff --
    
    replicate-to?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#discussion_r44916219
  
    --- Diff: src/replicate-to.js ---
    @@ -0,0 +1,49 @@
    +import nmo from './nmo.js';
    +import Promise from 'bluebird';
    +import { getUrlFromCluster } from './utils';
    +import {replicate, createReplicatorDoc } from './replicate';
    +
    +
    +export function cli (cluster, dbname, url) {
    +  return new Promise((resolve, reject) => {
    +    if (!cluster) {
    +      const msg = [
    +        'Usage:',
    +        '',
    +        'nmo replicate-to <cluster> <databasename> <url/dbname> [--continuous] [--create-target] [--json]',
    +        'nmo replicate-to <url> <databasename> <url/dbname> [--continuous] [--create-target] [--json]',
    +      ].join('\n');
    --- End diff --
    
    Yes good point.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith closed the pull request at:

    https://github.com/apache/couchdb-nmo/pull/11


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#issuecomment-157009743
  
    looks good, merge after fixing the small nits i found :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#discussion_r43259732
  
    --- Diff: doc/api/nmo-replicate-from.md ---
    @@ -0,0 +1,11 @@
    +nmo-replicateFrom(3) -- replicate-from
    +==============================
    +
    +## SYNOPSIS
    +
    +    nmo.commands.replicateFrom([<clusterurl> || <cluster>], database, url)
    --- End diff --
    
    ```
    nmo.commands.replicateFrom([<clusterurl> || <cluster>], database, url)
    ```
    
    can the last argument (url) also be a cluster name?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#discussion_r44916221
  
    --- Diff: src/replicate-from.js ---
    @@ -0,0 +1,49 @@
    +import nmo from './nmo.js';
    +import Promise from 'bluebird';
    +import { getUrlFromCluster } from './utils';
    +import {replicate, createReplicatorDoc } from './replicate';
    +
    +
    +export function cli (cluster, dbname, url) {
    +  return new Promise((resolve, reject) => {
    --- End diff --
    
    we should test for the dbname and url too (see other command for example)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#discussion_r44916085
  
    --- Diff: src/replicate-to.js ---
    @@ -0,0 +1,49 @@
    +import nmo from './nmo.js';
    +import Promise from 'bluebird';
    +import { getUrlFromCluster } from './utils';
    +import {replicate, createReplicatorDoc } from './replicate';
    +
    +
    +export function cli (cluster, dbname, url) {
    +  return new Promise((resolve, reject) => {
    +    if (!cluster) {
    +      const msg = [
    +        'Usage:',
    +        '',
    +        'nmo replicate-to <cluster> <databasename> <url/dbname> [--continuous] [--create-target] [--json]',
    +        'nmo replicate-to <url> <databasename> <url/dbname> [--continuous] [--create-target] [--json]',
    +      ].join('\n');
    --- End diff --
    
    we should test for the dbname and url too, example of my wrong usage:
    
    ```
    (13:04:02) [robert@tequila-work] ~/apache/couchdb-nmo (pr/11) $ ./bin/nmo-cli.js replicate-to anemone https://examples.cloudant.com/animaldb
    http request POST http://127.0.0.1:15984/_replicator
    http 403 http://127.0.0.1:15984/_replicator
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#discussion_r44512447
  
    --- Diff: doc/api/nmo-replicate-from.md ---
    @@ -0,0 +1,11 @@
    +nmo-replicateFrom(3) -- replicate-from
    +==============================
    +
    +## SYNOPSIS
    +
    +    nmo.commands.replicateFrom([<clusterurl> || <cluster>], database, url)
    --- End diff --
    
    No the last one has to be a url for now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-nmo pull request: Replication

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-nmo/pull/11#issuecomment-157024834
  
    Thanks for reviewing @robertkowalski. Merged.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---