From user-return-11278-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Mon Jul 05 14:07:06 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 57672 invoked from network); 5 Jul 2010 14:07:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Jul 2010 14:07:06 -0000 Received: (qmail 97076 invoked by uid 500); 5 Jul 2010 14:07:04 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 97026 invoked by uid 500); 5 Jul 2010 14:07:04 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 97018 invoked by uid 99); 5 Jul 2010 14:07:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 14:07:03 +0000 X-ASF-Spam-Status: No, hits=3.6 required=10.0 tests=FREEMAIL_FROM,FS_REPLICA,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of robert.newson@gmail.com designates 74.125.82.54 as permitted sender) Received: from [74.125.82.54] (HELO mail-ww0-f54.google.com) (74.125.82.54) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jul 2010 14:06:56 +0000 Received: by wwb17 with SMTP id 17so1960187wwb.23 for ; Mon, 05 Jul 2010 07:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=TvZmeOqLfS15gqRNs2Sb8MvcAQwoY0a72UWXy3mqTao=; b=rFsSOkO8e/t8PPpCPA12QIPOZLxq3bNHAUNe8U65MusYo+4BPi2CFw/9RFiTmNBAZe ggRSR7mOmHu8g+Hci6307lYgn6YFky4vyb80FPxoyylLoeLNKZeeUYwCvK/GVp281r+K 4/daeTNdhyLJQ/IhTuZfGo8GusHgq/jW/LLEA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=wGeZ6Yw8JZT4hE+vXxeAcaofQ6uCYquzHGAfCp21wXExsyrXcM4yIIe/RZ/4NtoZ8g gf3zqDdDL2kOMwoVoDGToFTlG/qJYvEdneKzTLGZvH1mfN6aIh33bp31Jv501QVQxyBG F70ZQTgCJcw2hTdu05sDU1mBk/iFtCwtANdEU= MIME-Version: 1.0 Received: by 10.103.226.19 with SMTP id d19mr284048mur.83.1278338736317; Mon, 05 Jul 2010 07:05:36 -0700 (PDT) Received: by 10.103.224.9 with HTTP; Mon, 5 Jul 2010 07:05:36 -0700 (PDT) In-Reply-To: <3E714D46-936C-411A-87B6-FD55078416E4@googlemail.com> References: <3E714D46-936C-411A-87B6-FD55078416E4@googlemail.com> Date: Mon, 5 Jul 2010 10:05:36 -0400 Message-ID: Subject: Re: How to monitor continuous replication status? From: Robert Newson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on 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. On Mon, Jul 5, 2010 at 9:58 AM, Sebastian Cohnen wrote: > 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? > > On 05.07.2010, at 15:53, Robert Newson wrote: > >> 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. >> >> On Mon, Jul 5, 2010 at 7:47 AM, Rachel Willmer wrote: >>> 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 >>> > >