Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 947659FB38C for ; Mon, 26 Feb 2007 10:05:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 79031-01 for ; Mon, 26 Feb 2007 10:04:55 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id E05289FB665 for ; Mon, 26 Feb 2007 10:04:54 -0400 (AST) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 2B37F76F67; Mon, 26 Feb 2007 14:03:20 +0000 (GMT) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 0A90E274092; Mon, 26 Feb 2007 14:03:20 +0000 (GMT) Message-ID: <45E2E8A7.90008@archonet.com> Date: Mon, 26 Feb 2007 14:03:19 +0000 From: Richard Huxton User-Agent: IceDove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: Gauri Kanekar Cc: PostgreSQL Performance Subject: Re: Server Startup Error References: <7e4ba9550702260522t3e2815em8136be53da6aa3ec@mail.gmail.com> <45E2E0A2.4070900@archonet.com> <7e4ba9550702260535q2c94b77elaf0b85c185237c75@mail.gmail.com> In-Reply-To: <7e4ba9550702260535q2c94b77elaf0b85c185237c75@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.217 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200702/291 X-Sequence-Number: 23345 Note - try to cc: the mailing list, I don't always read this inbox Gauri Kanekar wrote: > On 2/26/07, Richard Huxton wrote: >> >> Gauri Kanekar wrote: >> > Hi List, >> > >> > Machine was down due to some hardware problem. >> > >> > After then when i issue this command /usr/local/pgsql/bin/psql -l >> > its giving me the following error >> > >> > psql: could not connect to server: No such file or directory >> > Is the server running locally and accepting >> > connections on Unix domain socket "/tmp/.s.PGSQL.5432"? >> > >> > Can anybody tell me what going wrong?? >> >> Well, it's either looking in the wrong place or the server isn't >> actually running. >> >> 1. Do your startup scripts start PG? > > Yes OK - so we know it should have started, which means the logs should say something about our problem. > 2. Is there a server process? "ps auxw | grep postgres" > > This is the result given by the command > root 8907 0.0 0.1 37496 2640 ? Ss 03:47 0:00 sshd: > postgres [priv] > postgres 8910 0.0 0.0 37636 1684 ? S 03:47 0:00 sshd: > postgres@pts/1 > postgres 8911 0.0 0.1 10152 2564 pts/1 Ss+ 03:47 0:00 -bash > root 9470 0.0 0.1 37500 2644 ? Ss 04:28 0:00 sshd: > postgres [priv] > postgres 9473 0.0 0.0 37640 1688 ? S 04:28 0:00 sshd: > postgres@pts/2 > postgres 9474 0.0 0.1 10104 2412 pts/2 Ss 04:28 0:00 -bash > postgres 9724 0.0 0.0 3496 892 pts/2 R+ 04:44 0:00 ps auxw > postgres 9725 0.0 0.0 3868 784 pts/2 R+ 04:44 0:00 grep > postgres Hmm - nothing there but "ssh" connections. So, it's not started, which is why psql is complaining. > 3. What do your logfiles say? > > > HINT: In a moment you should be able to reconnect to the database and > repeat your command. > LOG: database system was interrupted at 2007-02-23 20:14:24 IST > LOG: could not open file "pg_xlog/00000001000000390000001A" (log file 57, > segment 26): No such file or directory > LOG: invalid primary checkpoint record > LOG: could not open file "pg_xlog/000000010000003900000017" (log file 57, > segment 23): No such file or directory > LOG: invalid secondary checkpoint record > PANIC: could not locate a valid checkpoint record > LOG: startup process (PID 9057) was terminated by signal 6 > LOG: aborting startup due to startup process failure > FATAL: pre-existing shared memory block (key 5432001, ID 1900546) is still > in use > HINT: If you're sure there are no old server processes still running, > remove the shared memory block with the command "ipcclean", "ipcrm", or > just > delete the file "postmaster.pid". OK - this last bit is the first thing to deal with. Find your postmaster.pid file and delete it. Your postmaster.pid file should be in your data directory - try "locate postmaster.pid" or "find /usr/local/ -name postmaster.pid". Then restart postgresql (as root "/etc/init.d/postgresql start" or similar) and check the logs again. -- Richard Huxton Archonet Ltd