Comments (7)
Creating Replications
There are two ways to create replications:
-
POST-ing to the
/_replicate
HTTP endpoint. Let's call thesetransient
. -
Creating a document in the
_replicator
database. Any database which ends in the/_replicator
will work as a replicator database. Let's call thesepersistent
.
Each are slightly different. For the transient ones there is no document backing the replication job. If the server crashes the job will just disappear. When jobs finish there is no way to query their state. This method of replicating was implemented initially.
Persistent
ones are backed by a document in a _replicator db. They will persist across server restarts and it is possible to inspect their state after they finished.
The reason there are two is because transient
ones where implemented first and were kept for backwards compatibility and are actually useful in some cases when programmatically creating replication jobs.
Monitoring Replications
Transient
replications can be monitored via the/_active_tasks
endpoint or the/_scheduler/jobs
endpoint. It might take a a few minutes between the time a replication is created and it appears as a replication job in these endpoints.
http://docs.couchdb.org/en/latest/api/server/common.html#scheduler-jobs
Permanent
replications can be monitored via the/_scheduler/docs
endpoint as well as the/_scheduler/jobs
and/_active_tasks
. The/_scheduler/docs
is preferred as it will show the state of the replication document before it becomes a replication job. Some documents could be invalid and could not become a replication job. Others might be delayed because they are fetching say the filter code from a slow source database.
http://docs.couchdb.org/en/latest/api/server/common.html#get--_scheduler-docs-replicator_db
Replication States
Replication documents become replication jobs and then replication jobs do all the replication work. There are a number of states a replication goes through so this chart might be helpful:
http://docs.couchdb.org/en/latest/replication/replicator.html#replication-states
from couchdb-documentation.
what about
{"id":"_design/_replicator","key":"_design/_replicator","value":{"rev":"1-85a961d0d9b235b7b4f07baed1a38fda"}}
which is a default document in the _replication
db?
from couchdb-documentation.
FYI
<vatamane> ufobat: try checking _scheduler/docs/ instead
<vatamane> _replicate endpoint is to create replications that are not backed by a document from the _replicator database
<vatamane> also note there is the http /_replicate endpoint and a _replicator database I think you might be confusing the two
<ufobat> vatamane, when if i only use _replicator db?
<ufobat> i can POST and GET from there?
<ufobat> i just care about the configruation, not of the replication results/states
<vatamane> you can create replications by creating documents in the _replicator database
<ufobat> vatamane, i actually did :-(
<vatamane> these replication will persist even after a server is restarted (unlike replication from the _replicate endpoint)
<vatamane> to check the status of your replication try http://docs.couchdb.org/en/stable/api/server/common.html#scheduler-docs
<ufobat> because of my confusion i wrote https://github.com/apache/couchdb-documentation/issues/346
<vatamane> thanks ufobat, I'll update the ticket with more info
<ufobat> is the scheduler-doc information about which documents in which db where replicated?
<ufobat> my db is currently empty
<vatamane> _scheduler/doc allows you to track the state of replications which are backed by a document in a _replicator database
<ufobat> ah and _scheduler/jobs is for the _replicate api?
<vatamane> _scheduler/jobs tracks replication jobs that started broth from the _replicate endpoint and by creating documents in the _replicator db
<ufobat> and this applys also if i have a "custom_replicator" database, because docs says i could use one ( which would fit perfectly for my script approach, cause i wouldnt see other replications that dont belong to me)
<vatamane> you could use one, yeah, any database that end with the /_replicator suffix will work as a replicator db
<vatamane> when you query _scheduler/docs you'd have to pass that database name in the path explicitly like say _scheduler/docs/mycustom/_replicator
<ufobat> i think thats missin in the documentation as well
from couchdb-documentation.
<vatamane> that's expected it's automatically created and is used to validate replicate documents created in that database
<rnewson> it enforces correctness of the docs, it's an internal detail really
<ufobat> i am just asking because when i do a get on _replicator/_all_docs i need to know that this is there in order to skip over it
<vatamane> you can skip over it
<ufobat> because "remove anything thats not my desired replication configuration" would be wrong
<ufobat> ty :)
from couchdb-documentation.
@ufobat do you have everything you need to write a PR?
from couchdb-documentation.
@wohali I think I do, thank you :-)
from couchdb-documentation.
I am not sure if and where i should mention the _design/_replicator
document. any idea?
from couchdb-documentation.
Related Issues (20)
- error in string sorting HOT 1
- Documentation: misleading $title in Selector Basics section HOT 1
- `POST /{db}/index` seems to desribe old behaviour.
- Make it clear which version the docs are for
- Include the SSL FAQ content as a new page in the docs HOT 1
- MacOS installation guide download link is incorrect HOT 2
- Outdated JavaScript development tips HOT 1
- Remove partial filter selector field from POST /{db}/_index query parameters list HOT 1
- Replace all references to couch_httpd_auth with chttpd_auth HOT 2
- Document query_response option HOT 3
- Documentation on 3.1.1 version includes `$keyMapMatch` operator, which is missing in tag version. HOT 1
- Adding an information about max_partition_limit in the Partition Database introduction section
- Broken links (and problably travis build) because they are pointing to old master branch HOT 1
- Broken links on Installation pages HOT 2
- Reverse Proxying CouchDB in a subdirectory with nginx example does not handle URL encoded path fragments HOT 1
- Fix timeout time-unit (milliseconds instead of seconds) in /_db_updates doc page HOT 1
- I can't update couch-db via sudo apt-get update in Debain 10, I got 403 forbidden error message! HOT 2
- Couchdb repository is forbidden. HOT 1
- Linux installation information is incorrect - bintray.com service has been shut down by JFrog HOT 1
- no progress field when GET /_active_tasks HTTP/1.1 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from couchdb-documentation.