Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 83195 invoked from network); 24 Oct 2009 04:04:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Oct 2009 04:04:41 -0000 Received: (qmail 80001 invoked by uid 500); 24 Oct 2009 04:04:40 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 79873 invoked by uid 500); 24 Oct 2009 04:04:40 -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 79862 invoked by uid 99); 24 Oct 2009 04:04:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Oct 2009 04:04:40 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of couchdby@autosys.us designates 216.99.218.149 as permitted sender) Received: from [216.99.218.149] (HELO delora.autosys.us) (216.99.218.149) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Oct 2009 04:04:37 +0000 Received: by delora.autosys.us (Postfix, from userid 1000) id E45F025C14E; Fri, 23 Oct 2009 21:04:16 -0700 (PDT) Date: Fri, 23 Oct 2009 21:04:16 -0700 From: Michael McDaniel To: user@couchdb.apache.org Subject: Re: [long] multiple couchdb invocations, single machine Message-ID: <20091024040416.GE3633@delora.autosys.us> Mail-Followup-To: user@couchdb.apache.org References: <20091024011927.GC3633@delora.autosys.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: http://autosys.us User-Agent: Mutt/1.5.18 (2008-05-17) Though setting log level = debug, and running strace (per earlier Chris mail) might be useful for discovery, I think the empirical evidence already proves that the local.ini and local_mike.ini config files are getting read (and if they weren't, changing log level in either would have no effect). Per earlier information, the proper log files are getting created which are defined in local.ini and local_mike.ini hence those ini files are getting read. That is the only place the respective log files couchdb_pat.log and couchdb_mike.log are defined. Additionally, Futon config.html indicates proper reading of the ini files based on the respectively displayed database_dir and view_index_dir variables. However, because some may still not be convinced from the existing evidence, and I have no immediate other ideas, and I would like some help with this, I changed from level = info to level = debug in each of local.ini and local_mike.ini (which are being read). Looking at couchdb_pat.stdout and couchdb_mike.stdout showed the same database_dir and view_index_dir that shows per information in Futon config.html as described below. I then started _mike using strace as follows: sudo strace couchdb -i -p /usr/local/var/run/couchdb_prod.pid -o /home/erl/couchdb/logs/couchdb_prod.stdout -e /home/erl/couchdb/logs/couchdb_prod.stderr -a /usr/local/etc/couchdb/prod/local_prod.ini > foo.log 2>&1 database_dir in foo.log shows writev(1, [{""..., 0}, {" [couchdb] database_dir =\"/usr/"..., 61}], 2 [couchdb] database_dir ="/usr/local/var/lib/couchdb_prod" view_index_dir in foo.log shows writev(1, [{""..., 0}, {" [couchdb] view_index_dir=\"/usr/"..., 61}], 2 [couchdb] view_index_dir="/usr/local/var/lib/couchdb_prod" It appears that the ini files are getting read. Has anyone run two separate invocations on one machine, using different ports with database isolation to separate directories unavailable to the other invocation ? Perhaps this a use case that is not tested ? ~M On Fri, Oct 23, 2009 at 10:42:46PM -0400, Paul Davis wrote: > You could also set the log level to debug and start each without -b to > see what config files are being read. > > Paul Davis > > On Fri, Oct 23, 2009 at 10:25 PM, Chris Stockton > wrote: > > I would try starting them with strace -f and see what ini files they are > > reading and look for other clues. > > > > On Oct 23, 2009 6:19 PM, "Michael McDaniel" wrote: > > > > > > �SHORT VERSION: > > > > �Multiple couchdb invocations on a single machine are not > > �behaving as I would expect to isolate databases. > > > > �Does someone have a tested configuration they will share ? > > > > > > > > �LONG VERSION: > > > > �I have installed > > > > �couchdb - Apache CouchDB 0.11.0b828784 > > > > �and am trying to do what I thought would be simple. > > > > �Run two independent invocations of couchdb on the same machine. > > �With the expectation that by running separate invocations, I > > �could keep respective databases isolated from each. > > > > > > �Here's what I want > > > > �* one invocation on default port 5984 � (let's call this one PAT) > > �* other invocation on non-default port 5985 (let's call this one MIKE) > > �* PAT should not see or have access to MIKE databases > > �* MIKE should not see or have access to PAT databases > > �* PAT can hang with no effect on MIKE > > �* MIKE can hang and have no effect on PAT > > �* long running events on either have no effect on the other > > > > �Here's what I tried (all pertinent directories and files are created with > > �rw permissions to invoking user). �default.ini is as created by couchdb > > �build/install. > > --- > > > > �Added the following to /usr/local/etc/couchdb/local.ini > > > > [couchdb] > > > > database_dir � = /usr/local/var/lib/couchdb_pat > > view_index_dir = /usr/local/var/lib/couchdb_pat > > > > [log] > > file = /home/erl/couchdb/logs/couch_pat.log > > level = info > > --- > > > > �Added the following to �/usr/local/etc/couchdb/mike/local_mike.ini > > > > [couchdb] > > database_dir � = /usr/local/var/lib/couchdb_mike > > view_index_dir = /usr/local/var/lib/couchdb_mike > > > > > > [log] > > file = /home/erl/couchdb/logs/couch_mike.log > > level = info > > > > [httpd] > > port = 5985 > > --- > > > > �start PAT with > > couchdb �-b �-p �/usr/local/var/run/couchdb_pat.pid � � � �\ > > � � � � � �-o �/home/erl/couchdb/logs/couchdb_pat.stdout \ > > � � � � � �-e �/home/erl/couchdb/logs/couchdb_pat.stderr > > --- > > > > �start MIKE with > > couchdb �-b �-p �/usr/local/var/run/couchdb_mike.pid � � � �\ > > � � � � � �-a �/usr/local/etc/couchdb/mike/local_mike.ini \ > > � � � � � �-o /home/erl/couchdb/logs/couchdb_mike.stdout �\ > > � � � � � �-e /home/erl/couchdb/logs/couchdb_mike.stderr > > --- > > > > > > �NOW, in Futon, for PAT http://localhost:5984/_utils/config.html > > > > > > �database_dir � � � /usr/local/var/lib/couchdb > > �database_dir � � � /usr/local/var/lib/couchdb_pat > > �view_index_dir � � /usr/local/var/lib/couchdb_pat > > > > �AND, for MIKE http://localhost:5985/_utils/config.html > > > > �database_dir � � � /usr/local/var/lib/couchdb > > �database_dir � � � /usr/local/var/lib/couchdb_pat > > �view_index_dir � � /usr/local/var/lib/couchdb_pat > > > > > > �BUT ... both show all the databases already existing in the default > > �/usr/local/var/lib/couchdb directory. > > > > > > �AND > > > > �If I create a new database from either PAT or MIKE URI > > �http://localhost:5984/_utils/index.html > > �http://localhost:5985/_utils/index.html > > > > �the new database winds up in the /usr/local/var/lib/couchdb > > �directory (and, as previously mentioned, either invocation > > �of couchdb can see all of the databases there). > > > > > > �If I comment out database_dir and view_index_dir in default.ini > > �then both invocations see the databases (in Futon Overview) as, > > �e.g. > > > > � couchdb/foo_db > > � couchdb/bar_db > > > > �Although each Futon Configuration shows only the respective > > �database_dir � �/usr/local/var/lib/couchdb_pat > > �view_index_dir �/usr/local/var/lib/couchdb_pat > > > > �database_dir � �/usr/local/var/lib/couchdb_mike > > �view_index_dir �/usr/local/var/lib/couchdb_mike > > �. > > > > > > �Logs are getting written per respective PAT and MIKE local ini files. > > > > > > �QUESTION: > > > > �How do I run more than one invocation of couchdb on a single machine > > �with database and process isolation ? > > > > > > ~Michael > >