How to monitor continuous replication status?

1 view
Skip to first unread message

Rachel Willmer

unread,
Jul 5, 2010, 7:47:01 AM7/5/10
to us...@couchdb.apache.org
Once you have started a continuous replication, is there a way to
monitor that it is still running?

For example, will it always be visible in _active_tasks even if there
is no active replication occurring?

Or is there a URL you can ping, passing on the _local_id which is
given when you start the continuous replication?

Or failing that, is there a URL on the couchdb server which returns
when it was last restarted?

Rachel

Robert Newson

unread,
Jul 5, 2010, 9:53:56 AM7/5/10
to us...@couchdb.apache.org
Continuous replication tasks remain in _active_tasks until they are
cancelled or fail (for example, by the remote end crashing).

You can grep the front of the "task" string to match it to the
returned _local_id or infer it from from the rest of the string. E.g,

curl -X PUT http://localhost:5984/_replicate -d
'{"source":"db1","target":"db2","continuous":true}'

gives;

{"ok":true,"_local_id":"56a810250d6aed082fa4aae1dc58fb6c"}

If you poll /_active_tasks, you can see it's still alive;

curl http://localhost:5984/_active_tasks
[{"type":"Replication","task":"56a810: db1 ->
db2","status":"Starting","pid":"<0.370.0>"}]

I don't think you can get the timestamp for when couchdb last started,
but I think the per-db "instance_start_time" is probably fine, since I
believe it's used in finding replication checkpoints;

curl http://localhost:5984/db2
{"db_name":"db2" .... ,"instance_start_time":"1278337744957334"....}

I believe there's an effort to persistent continuous replication tasks
so that they are restarted if they fail, so hopefully the answers to
these questions have only short-term validity.

B.

Sebastian Cohnen

unread,
Jul 5, 2010, 9:58:06 AM7/5/10
to us...@couchdb.apache.org
a little bit OT maybe, but wouldn't it be nice if _active_task would be a feed like _changes? So everyone who is interested in monitoring could simply consume the feed rather than having to poll and check for changes?

Robert Newson

unread,
Jul 5, 2010, 10:05:36 AM7/5/10
to us...@couchdb.apache.org
Even if couchdb was monitoring (and restarting) these tasks in the
next release or two?

I'm a little on the fence here, I think it would be largely redundant
if couchdb does it, but I also seen the value in couchdb being
monitorable from the outside. Perhaps the right way to do that is via
HTTP like everything else, but I've always meant to dig into Erlang's
monitoring support, and particularly SNMP, since, like it or loathe
it, it's pervasive.

B.

Rachel Willmer

unread,
Jul 5, 2010, 10:33:31 AM7/5/10
to us...@couchdb.apache.org
Robert said:
"Continuous replication tasks remain in _active_tasks until they are
cancelled or fail (for example, by the remote end crashing)."

Thanks! That's what I needed confirmed.
Rachel

Reply all
Reply to author
Forward
0 new messages