X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8380AD1B53C for ; Fri, 17 Oct 2003 08:43:19 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 83446-10 for ; Fri, 17 Oct 2003 05:42:50 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 98CB8D1B510 for ; Fri, 17 Oct 2003 05:42:48 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id h9H8gmNu098145 for ; Fri, 17 Oct 2003 08:42:48 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h9H8Zwiv097344 for pgsql-admin@postgresql.org; Fri, 17 Oct 2003 08:35:58 GMT Date: Fri, 17 Oct 2003 10:36:47 +0200 From: Oli Sennhauser User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 X-Newsgroups: comp.databases.postgresql.admin Subject: Solution: Second postmaster / second DB cluster References: <3F8EB07D.7040603@bluewin.ch> <20031016100239.C52937@megazone.bigpanda.com> In-Reply-To: <20031016100239.C52937@megazone.bigpanda.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Original-NNTP-Posting-Host: 81.62.219.111 Message-ID: <3f8fa9ea_4@news.bluewin.ch> Organization: Bluewin AG Lines: 113 Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/207 X-Sequence-Number: 10768 Stephan Szabo wrote: > On Thu, 16 Oct 2003, Oli Sennhauser wrote: > > >>I would like to start a second postmaster on my server. >>First problem was the lock file /tmp/.s.PGSQL.5432.lock >>and its socket. But you can workaround that by the -k >>parameter. So I was able to start at least 3 clusters... > > > If you want to use separate directories for the socket, you > need to use -h (and -p if it's not the default) > when connecting with psql. However, you probably just want to > use different port numbers to start the postmasters and then use > psql -p to connect. > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > >>Thank you for answering. >>> >>> Do you mean -k (or -h )? -k is exactly >>> what I did. And it did not work in my case. In my opinion we should not >>> need -i and -h in this example, because I only want to do local connects. > >psql -h /u00/app/pgsql/data/CLUSTER1 >means use a local socket located in that directory (with the >"port" number of 5432 - which is used in determing the filename). > >>From the 7.3 psql manpage: >-h hostname >--host hostname >Specifies the host name of the machine on which the postmaster is >running. If host begins with a slash, it is used as the directory for >the >Unix-domain socket. Ok, now I understand it! Thank you verry much Stephan Here is my final solution: $ CLUSTER1 $ pg_ctl start -D $PG_DATA -l $PG_DATA/$PG_CID.log -o "-k $PG_DATA -p $PG_PORT" postmaster successfully started $ CLUSTER2 $ pg_ctl start -D $PG_DATA -l $PG_DATA/$PG_CID.log -o "-k $PG_DATA -p $PG_PORT" postmaster successfully started $ CLUSTER3 $ pg_ctl start -D $PG_DATA -l $PG_DATA/$PG_CID.log -o "-k $PG_DATA -p $PG_PORT" postmaster successfully started $ ps -fu postgres UID PID PPID C STIME TTY TIME CMD postgres 402 1 0 10:29 pts/1 00:00:00 /u00/app/pgsql/products/7.4.0/bin/postmaster -k /u00/app/pgsql/data/CLUSTER1 -p 5 postgres 404 402 0 10:29 pts/1 00:00:00 postgres: stats buffer process postgres 406 404 0 10:29 pts/1 00:00:00 postgres: stats collector process postgres 436 1 0 10:29 pts/1 00:00:00 /u00/app/pgsql/products/7.4.0/bin/postmaster -k /u00/app/pgsql/data/CLUSTER2 -p 5 postgres 438 436 0 10:29 pts/1 00:00:00 postgres: stats buffer process postgres 439 438 0 10:29 pts/1 00:00:00 postgres: stats collector process postgres 469 1 0 10:29 pts/1 00:00:00 /u00/app/pgsql/products/7.3.3/bin/postmaster -k /u00/app/pgsql/data/CLUSTER3 -p 5 postgres 471 469 0 10:29 pts/1 00:00:00 postgres: stats buffer process postgres 473 471 0 10:29 pts/1 00:00:00 postgres: stats collector process $ netstat -ap | grep PGSQL unix 2 [ ACC ] STREAM LISTENING 287991 402/postmaster /u00/app/pgsql/data/CLUSTER1/.s.PGSQL.5432 unix 2 [ ACC ] STREAM LISTENING 288022 436/postmaster /u00/app/pgsql/data/CLUSTER2/.s.PGSQL.5434 unix 2 [ ACC ] STREAM LISTENING 288051 469/postmaster /u00/app/pgsql/data/CLUSTER3/.s.PGSQL.5436 $ CLUSTER1 $ psql -l -h $PG_DATA List of databases Name | Owner | Encoding -----------+----------+----------- T740A | postgres | SQL_ASCII T740B | postgres | SQL_ASCII template0 | postgres | SQL_ASCII template1 | postgres | SQL_ASCII $ CLUSTER2 $ psql -l -h $PG_DATA List of databases Name | Owner | Encoding -----------+----------+----------- template0 | postgres | SQL_ASCII template1 | postgres | SQL_ASCII $ CLUSTER3 $ psql -l -h $PG_DATA List of databases Name | Owner | Encoding -----------+----------+----------- template0 | postgres | SQL_ASCII template1 | postgres | SQL_ASCII