Search Postgresql Archives

Re: Please help -- Postgres stopped responding ....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Raymond,

FYI, attach is "ERROR REPORTING AND LOGGING" section from postgres.conf.

Following information is from /var/log

-bash-3.2$ cd /var/log

-bash-3.2$ ls -l mess*
-rw------- 1 root root 242 Feb 25 23:14 messages
-rw------- 1 root root 110 Feb 16 22:11 messages.1
-rw------- 1 root root 344 Feb 11 12:14 messages.2
-rw------- 1 root root 110 Jan 31 19:36 messages.3
-rw------- 1 root root 110 Jan 25 19:50 messages.4

[root@erp log]# cat messages.4
Jan 23 04:02:35 erp syslogd 1.4.1: restart.
Jan 25 19:50:38 erp auditd[2660]: Audit daemon rotating log files

[root@erp log]# cat messages
Feb 20 04:02:39 erp syslogd 1.4.1: restart.
Feb 21 01:54:24 erp auditd[2660]: Audit daemon rotating log files
Feb 22 10:00:01 erp auditd[2660]: Audit daemon rotating log files
Feb 25 23:14:29 erp auditd[2660]: Audit daemon rotating log files

Following is postgres log information,

-bash-3.2$ pwd
/var/lib/pgsql/data/pg_log

-bash-3.2$ ls -ltr
total 354000
-rw------- 1 postgres postgres 53001301 Feb 20 23:59 postgresql-Sun.log
-rw------- 1 postgres postgres 47584965 Feb 21 23:59 postgresql-Mon.log
-rw------- 1 postgres postgres 39886690 Feb 22 23:59 postgresql-Tue.log
-rw------- 1 postgres postgres 45764569 Feb 23 23:59 postgresql-Wed.log
-rw------- 1 postgres postgres 47464819 Feb 24 23:59 postgresql-Thu.log
-rw------- 1 postgres postgres 39972476 Feb 25 23:59 postgresql-Fri.log
-rw------- 1 postgres postgres 88413622 Feb 26 21:20 postgresql-Sat.log

-bash-3.2$ cat postgresql-Sat.log

LOG:  duration: 0.074 ms
LOG:  duration: 0.518 ms
LOG:  duration: 0.041 ms
LOG:  duration: 0.321 ms
LOG:  duration: 0.022 ms

As you can see, there is not much information available for debuging purpose.

Please let me know how to configure "ERROR REPORTING AND LOGGING" section of postgres.conf to get all necessary postgres information in logfile for debuging/administration purpose.

Thanks for your help.

Savio

--- On Sat, 2/26/11, Raymond O'Donnell <rod@xxxxxx> wrote:

> From: Raymond O'Donnell <rod@xxxxxx>
> Subject: Re:  Please help  -- Postgres stopped responding ....
> To: "savio rodriges" <sj_savio@xxxxxxxxx>
> Cc: pgsql-general@xxxxxxxxxxxxxx
> Date: Saturday, February 26, 2011, 7:21 AM
> On 26/02/2011 15:04, savio rodriges
> wrote:
> > Hello Team,
> >
> > I am new to Postgresql. Postgresql suddenly stoped
> responding. Below
> > is what I checked.
> >
> > [root@server]$/etc/init.d/postgres status dead but pid
> file exists
> >
> > [root@server]$ uptime 20:33:26 up 63 days,
> 22:57,  4 users,  load
> > average: 1.73, 2.26, 2.43
> >
> > My questions are,
> >
> > 1. Which postgresql database logfile needs to checked
> for information
> > on why postgres stoped responding?
> 
> The latest one. :-)
> 
> Seriously, check in postgresql.conf where the logs are set
> to go, and 
> look there for the most recent file.
> 
> > 2. What else besides logfile can be checked ?
> 
> What happens when you try to restart it? - Again, check the
> logs.
> 
> Maybe look in syslog to see if anything else happened at
> that time?
> 
> Ray.
> 
> -- 
> Raymond O'Donnell :: Galway :: Ireland
> rod@xxxxxx
>


      
#------------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------

# - Where to Log -

log_destination = 'stderr'              # Valid values are combinations of
                                        # stderr, csvlog, syslog and eventlog,
                                        # depending on platform.  csvlog
                                        # requires logging_collector to be on.

# This is used when logging to stderr:
logging_collector = on                  # Enable capturing of stderr and csvlog
                                        # into log files. Required to be on for
                                        # csvlogs.
                                        # (change requires restart)

# These are only used if logging_collector is on:
log_directory = 'pg_log'                # directory where log files are written,
                                        # can be absolute or relative to PGDATA
log_filename = 'postgresql-%a.log'      # log file name pattern,
                                        # can include strftime() escapes
log_truncate_on_rotation = on           # If on, an existing log file of the
                                        # same name as the new log file will be
                                        # truncated rather than appended to.
                                        # But such truncation only occurs on
                                        # time-driven rotation, not on restarts
                                        # or size-driven rotation.  Default is
                                        # off, meaning append to existing files
                                        # in all cases.
log_rotation_age = 1d                   # Automatic rotation of logfiles will
                                        # happen after that time.  0 disables.
log_rotation_size = 0                   # Automatic rotation of logfiles will
                                        # happen after that much log output.
                                        # 0 disables.

# These are relevant when logging to syslog:
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'

#silent_mode = off                      # Run server silently.
                                        # DO NOT USE without syslog or
                                        # logging_collector
                                        # (change requires restart)


# - When to Log -

#client_min_messages = notice           # values in order of decreasing detail:
                                        #   debug5
                                        #   debug4
                                        #   debug3
                                        #   debug2
                                        #   debug1
                                        #   log
                                        #   notice
                                        #   warning
                                        #   error

#log_min_messages = warning             # values in order of decreasing detail:
                                        #   debug5
                                        #   debug4
                                        #   debug3
                                        #   debug2
                                        #   debug1
                                        #   info
                                        #   notice
                                        #   warning
                                        #   error
                                        #   log
                                        #   fatal
                                        #   panic

#log_error_verbosity = default          # terse, default, or verbose messages

#log_min_error_statement = error        # values in order of decreasing detail:
                                        #   debug5
                                        #   debug4
                                        #   debug3
                                        #   debug2
                                        #   debug1
                                        #   info
                                        #   notice
                                        #   warning
                                        #   error
                                        #   log
                                        #   fatal
                                        #   panic (effectively off)

#log_min_duration_statement = -1        # -1 is disabled, 0 logs all statements
                                        # and their durations, > 0 logs only
                                        # statements running at least this number
                                        # of milliseconds


# - What to Log -

#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
log_connections = off
log_disconnections = off
log_duration = off
#log_hostname = off
#log_line_prefix = ''                   # special values:
                                        #   %u = user name
                                        #   %d = database name
                                        #   %r = remote host and port
                                        #   %h = remote host
                                        #   %p = process ID
                                        #   %t = timestamp without milliseconds
                                        #   %m = timestamp with milliseconds
                                        #   %i = command tag
                                        #   %c = session ID
                                        #   %l = session line number
                                        #   %s = session start timestamp
                                        #   %v = virtual transaction ID
                                        #   %x = transaction ID (0 if none)
                                        #   %q = stop here in non-session
                                        #        processes
                                        #   %% = '%'
                                        # e.g. '<%u%%%d> '
#log_lock_waits = off                   # log lock waits >= deadlock_timeout
log_statement = 'none'                  # none, ddl, mod, all
#log_temp_files = -1                    # log temporary files equal or larger
                                        # than the specified size in kilobytes;
                                        # -1 disables, 0 logs all temp files
#log_timezone = unknown                 # actually, defaults to TZ environment
                                        # setting


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux