Thread: Server not Starting

Server not Starting

From
raghavendra t
Date:
Hi All,
 
Please find the below scenario, and suggest me...
 
Trying to start the server, but not starting.
----------------------------------------------------------
[postgres@dbarhel564 mypg]$ pg_ctl -D /usr/local/pgsql/mypg/ start
server starting
[postgres@dbarhel564 mypg]$ psql -p 5432 -d postgres
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"?
[postgres@dbarhel564 mypg]$
 
Checked in the Data Directory
-------------------------------------------
[postgres@dbarhel564 mypg]$ ls
arch  db.dmp  mypg.dmp     mytablespace  pg_hba.conf    pg_log        pg_stat_tmp  pg_tblspc    PG_VERSION  postgresql.conf
base  global  mypgtar.tar  pg_clog       pg_ident.conf  pg_multixact  pg_subtrans  pg_twophase  pg_xlog     postmaster.opts
[postgres@dbarhel564 mypg]$
I havnt find the postmaster.pid here.
 
Could you please guide me.
 
Regards
Raghavendra
 

Re: Server not Starting

From
Ashesh Vashi
Date:
What is the value set for the port in postgresql.conf?

--
Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise Postgres Company



On Wed, Apr 14, 2010 at 10:57 AM, raghavendra t <raagavendra.rao@gmail.com> wrote:
Hi All,
 
Please find the below scenario, and suggest me...
 
Trying to start the server, but not starting.
----------------------------------------------------------
[postgres@dbarhel564 mypg]$ pg_ctl -D /usr/local/pgsql/mypg/ start
server starting
[postgres@dbarhel564 mypg]$ psql -p 5432 -d postgres
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"?
[postgres@dbarhel564 mypg]$
 
Checked in the Data Directory
-------------------------------------------
[postgres@dbarhel564 mypg]$ ls
arch  db.dmp  mypg.dmp     mytablespace  pg_hba.conf    pg_log        pg_stat_tmp  pg_tblspc    PG_VERSION  postgresql.conf
base  global  mypgtar.tar  pg_clog       pg_ident.conf  pg_multixact  pg_subtrans  pg_twophase  pg_xlog     postmaster.opts
[postgres@dbarhel564 mypg]$
I havnt find the postmaster.pid here.
 
Could you please guide me.
 
Regards
Raghavendra
 

Re: Server not Starting

From
raghavendra t
Date:
Hi Ashesh
 
Postgresql.conf file (port part of conf file)
================
# - Connection Settings -
listen_addresses = 'localhost'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost', '*' = all
                                        # (change requires restart)
port = 5432                             # (change requires restart)
max_connections = 100                   # (change requires restart)

regards
raghavendra
 
 
On Wed, Apr 14, 2010 at 11:00 AM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
What is the value set for the port in postgresql.conf?

--
Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise Postgres Company



On Wed, Apr 14, 2010 at 10:57 AM, raghavendra t <raagavendra.rao@gmail.com> wrote:
Hi All,
 
Please find the below scenario, and suggest me...
 
Trying to start the server, but not starting.
----------------------------------------------------------
[postgres@dbarhel564 mypg]$ pg_ctl -D /usr/local/pgsql/mypg/ start
server starting
[postgres@dbarhel564 mypg]$ psql -p 5432 -d postgres
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"?
[postgres@dbarhel564 mypg]$
 
Checked in the Data Directory
-------------------------------------------
[postgres@dbarhel564 mypg]$ ls
arch  db.dmp  mypg.dmp     mytablespace  pg_hba.conf    pg_log        pg_stat_tmp  pg_tblspc    PG_VERSION  postgresql.conf
base  global  mypgtar.tar  pg_clog       pg_ident.conf  pg_multixact  pg_subtrans  pg_twophase  pg_xlog     postmaster.opts
[postgres@dbarhel564 mypg]$
I havnt find the postmaster.pid here.
 
Could you please guide me.
 
Regards
Raghavendra
 


Re: Server not Starting

From
raghavendra t
Date:
Hi,
 
Log file
=====

LOG:  database system was interrupted; last known up at 2010-04-12 10:53:12 IST
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  record with zero length at 0/1A0003C8
LOG:  redo is not required
FATAL:  could not access status of transaction 889
DETAIL:  Could not read from file "pg_clog/0000" at offset 0: Success.
LOG:  startup process (PID 303) exited with exit code 1
LOG:  aborting startup due to startup process failure
~
Regards
Raghavendra
On Wed, Apr 14, 2010 at 11:02 AM, raghavendra t <raagavendra.rao@gmail.com> wrote:
Hi Ashesh
 
Postgresql.conf file (port part of conf file)
================
# - Connection Settings -
listen_addresses = 'localhost'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost', '*' = all
                                        # (change requires restart)
port = 5432                             # (change requires restart)
max_connections = 100                   # (change requires restart)

regards
raghavendra
 
 
On Wed, Apr 14, 2010 at 11:00 AM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
What is the value set for the port in postgresql.conf?

--
Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise Postgres Company



On Wed, Apr 14, 2010 at 10:57 AM, raghavendra t <raagavendra.rao@gmail.com> wrote:
Hi All,
 
Please find the below scenario, and suggest me...
 
Trying to start the server, but not starting.
----------------------------------------------------------
[postgres@dbarhel564 mypg]$ pg_ctl -D /usr/local/pgsql/mypg/ start
server starting
[postgres@dbarhel564 mypg]$ psql -p 5432 -d postgres
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"?
[postgres@dbarhel564 mypg]$
 
Checked in the Data Directory
-------------------------------------------
[postgres@dbarhel564 mypg]$ ls
arch  db.dmp  mypg.dmp     mytablespace  pg_hba.conf    pg_log        pg_stat_tmp  pg_tblspc    PG_VERSION  postgresql.conf
base  global  mypgtar.tar  pg_clog       pg_ident.conf  pg_multixact  pg_subtrans  pg_twophase  pg_xlog     postmaster.opts
[postgres@dbarhel564 mypg]$
I havnt find the postmaster.pid here.
 
Could you please guide me.
 
Regards
Raghavendra
 



Re: Server not Starting

From
Shoaib Mir
Date:
On Wed, Apr 14, 2010 at 3:35 PM, raghavendra t <raagavendra.rao@gmail.com> wrote:
Hi,
 
Log file
=====

LOG:  database system was interrupted; last known up at 2010-04-12 10:53:12 IST
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  record with zero length at 0/1A0003C8
LOG:  redo is not required
FATAL:  could not access status of transaction 889
DETAIL:  Could not read from file "pg_clog/0000" at offset 0: Success.
LOG:  startup process (PID 303) exited with exit code 1
LOG:  aborting startup due to startup process failure

Try using pg_resetxlog to reset the control info on the DB cluster. Once you have done that try re-starting and hopefully that should work then, but you will I think lose everything from the last checkpoint by using pg_resetxlog.

--
Shoaib Mir
http://shoaibmir.wordpress.com/

Re: Server not Starting

From
raghavendra t
Date:
Hi Shoaib,
 
Tried with pg_resetxlog
 
 
[postgres@dbarhel564 bin]$ pg_resetxlog /usr/local/pgsql/mypg/
The database server was not shut down cleanly.
Resetting the transaction log might cause data to be lost.
If you want to proceed anyway, use -f to force reset.
[postgres@dbarhel564 bin]$ pg_resetxlog -f /usr/local/pgsql/mypg/
Transaction log reset
[postgres@dbarhel564 bin]$ pg_ctl start
server starting
[postgres@dbarhel564 bin]$ LOG:  database system was shut down at 2010-04-12 12:26:15 IST
FATAL:  could not access status of transaction 889
DETAIL:  Could not read from file "pg_clog/0000" at offset 0: Success.
LOG:  startup process (PID 1335) exited with exit code 1
LOG:  aborting startup due to startup process failure
[postgres@dbarhel564 bin]$

Regards
Raghavendra

 
On Wed, Apr 14, 2010 at 12:14 PM, Shoaib Mir <shoaibmir@gmail.com> wrote:
On Wed, Apr 14, 2010 at 3:35 PM, raghavendra t <raagavendra.rao@gmail.com> wrote:
Hi,
 
Log file
=====

LOG:  database system was interrupted; last known up at 2010-04-12 10:53:12 IST
LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  record with zero length at 0/1A0003C8
LOG:  redo is not required
FATAL:  could not access status of transaction 889
DETAIL:  Could not read from file "pg_clog/0000" at offset 0: Success.
LOG:  startup process (PID 303) exited with exit code 1
LOG:  aborting startup due to startup process failure

Try using pg_resetxlog to reset the control info on the DB cluster. Once you have done that try re-starting and hopefully that should work then, but you will I think lose everything from the last checkpoint by using pg_resetxlog.

--
Shoaib Mir
http://shoaibmir.wordpress.com/

Re: Server not Starting

From
Shoaib Mir
Date:
On Wed, Apr 14, 2010 at 5:00 PM, raghavendra t <raagavendra.rao@gmail.com> wrote:
Hi Shoaib,
 
Tried with pg_resetxlog
 
 
[postgres@dbarhel564 bin]$ pg_resetxlog /usr/local/pgsql/mypg/
The database server was not shut down cleanly.
Resetting the transaction log might cause data to be lost.
If you want to proceed anyway, use -f to force reset.
[postgres@dbarhel564 bin]$ pg_resetxlog -f /usr/local/pgsql/mypg/
Transaction log reset
[postgres@dbarhel564 bin]$ pg_ctl start
server starting
[postgres@dbarhel564 bin]$ LOG:  database system was shut down at 2010-04-12 12:26:15 IST
FATAL:  could not access status of transaction 889
DETAIL:  Could not read from file "pg_clog/0000" at offset 0: Success.
LOG:  startup process (PID 1335) exited with exit code 1
LOG:  aborting startup due to startup process failure


In that case, I would go and see if there is a clog file DB server is complaining for there or not i.e. "pg_clog/0000" and if it is check for permissions with PG user. Do you by any chance deleted stuff from pg_clog folder?

If they are not there then create 256k files for each of them filled with zeros that server complaints for like the we just saw "pg_clog/0000", remember this way you might be able to start the server but you will lose the data from the time after your last checkpoint.

-- 
Shoaib Mir
http://shoaibmir.wordpress.com/

Re: Server not Starting

From
raghavendra t
Date:
Hi Shoaib,
 
I have the file with postgres permission on it, but , surprisingly its 0k .
 
[postgres@dbarhel564 ~]# cd /usr/local/pgsql/mypg/pg_clog/
[postgres@dbarhel564 pg_clog]# ll -lh
total 0
-rw-rw-r-- 1 postgres postgres 0 Apr 12 12:54 0000
[postgres@dbarhel564 pg_clog]#
any step to change this.
 
regards
raghavendra
 

 
On Wed, Apr 14, 2010 at 12:39 PM, Shoaib Mir <shoaibmir@gmail.com> wrote:
On Wed, Apr 14, 2010 at 5:00 PM, raghavendra t <raagavendra.rao@gmail.com> wrote:
Hi Shoaib,
 
Tried with pg_resetxlog
 
 
[postgres@dbarhel564 bin]$ pg_resetxlog /usr/local/pgsql/mypg/
The database server was not shut down cleanly.
Resetting the transaction log might cause data to be lost.
If you want to proceed anyway, use -f to force reset.
[postgres@dbarhel564 bin]$ pg_resetxlog -f /usr/local/pgsql/mypg/
Transaction log reset
[postgres@dbarhel564 bin]$ pg_ctl start
server starting
[postgres@dbarhel564 bin]$ LOG:  database system was shut down at 2010-04-12 12:26:15 IST
FATAL:  could not access status of transaction 889
DETAIL:  Could not read from file "pg_clog/0000" at offset 0: Success.
LOG:  startup process (PID 1335) exited with exit code 1
LOG:  aborting startup due to startup process failure


In that case, I would go and see if there is a clog file DB server is complaining for there or not i.e. "pg_clog/0000" and if it is check for permissions with PG user. Do you by any chance deleted stuff from pg_clog folder?

If they are not there then create 256k files for each of them filled with zeros that server complaints for like the we just saw "pg_clog/0000", remember this way you might be able to start the server but you will lose the data from the time after your last checkpoint.

-- 

Re: Server not Starting

From
Shoaib Mir
Date:
On Wed, Apr 14, 2010 at 6:30 PM, raghavendra t <raagavendra.rao@gmail.com> wrote:
Hi Shoaib,
 
I have the file with postgres permission on it, but , surprisingly its 0k .
 
[postgres@dbarhel564 ~]# cd /usr/local/pgsql/mypg/pg_clog/
[postgres@dbarhel564 pg_clog]# ll -lh
total 0
-rw-rw-r-- 1 postgres postgres 0 Apr 12 12:54 0000
[postgres@dbarhel564 pg_clog]#
any step to change this.

Thats incorrect, you do not have any files in there! "total 0 means no files" the folder is empty. Looks like someone deleted the files from there, to resolve it create the zero filled file as I mentioned in my last email.

--
Shoaib Mir
http://shoaibmir.wordpress.com/

Re: Server not Starting

From
raghavendra t
Date:
Hi Shoaib,
 
Thank you very much, now its working after creating the file with 256k.
I also thank everyone who has supported me in this thread.
 
Regards
Raghavendra

On Wed, Apr 14, 2010 at 3:44 PM, Shoaib Mir <shoaibmir@gmail.com> wrote:
On Wed, Apr 14, 2010 at 6:30 PM, raghavendra t <raagavendra.rao@gmail.com> wrote:
Hi Shoaib,
 
I have the file with postgres permission on it, but , surprisingly its 0k .
 
[postgres@dbarhel564 ~]# cd /usr/local/pgsql/mypg/pg_clog/
[postgres@dbarhel564 pg_clog]# ll -lh
total 0
-rw-rw-r-- 1 postgres postgres 0 Apr 12 12:54 0000
[postgres@dbarhel564 pg_clog]#
any step to change this.

Thats incorrect, you do not have any files in there! "total 0 means no files" the folder is empty. Looks like someone deleted the files from there, to resolve it create the zero filled file as I mentioned in my last email.

--