Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

If you killed postmaster what will happened in postgres server?

Check the postmaster process id before killing it the process id is 9590  
[root@p1 data]# ps -ef |grep post
postgres  9590     1  0 10:54 pts/1    00:00:00 /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
postgres  9593  9590  0 10:54 ?        00:00:00 postgres: checkpointer process                              
postgres  9594  9590  0 10:54 ?        00:00:00 postgres: writer process                                    
postgres  9595  9590  0 10:54 ?        00:00:00 postgres: wal writer process                                
postgres  9596  9590  0 10:54 ?        00:00:00 postgres: autovacuum launcher process                       
postgres  9597  9590  0 10:54 ?        00:00:00 postgres: archiver process                                  
postgres  9598  9590  0 10:54 ?        00:00:00 postgres: stats collector process                           
root      9668 25224  0 May07 pts/1    00:00:00 su postgres
postgres  9669  9668  0 May07 pts/1    00:00:00 bash
postgres 10275  9590  0 11:14 ?        00:00:00 postgres: logger process  
--kill the postmaster process 
[root@p1 data]# kill -9 9590
--check the process whether its running or not
[root@p1 data]# ps -ef |grep post
root     10582  9215  0 11:29 pts/4    00:00:00 grep post
root     15754 15727  0 May08 pts/2    00:00:00 su postgres
postgres 15755 15754  0 May08 pts/2    00:00:00 bash
--create any table its for checking 
postgres=# create table t11(id int);
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat your command.
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!> 
--when you kill the postmaster process it will not restarted automatically  so postgres server will be going to down you need to start the server manually after started the postgres server postmaster process id will be variied from 9590 to 10734  
bash-3.2$ ./pg_ctl start  -D /opt/PostgreSQL/9.3/data 
pg_ctl: another server might be running; trying to start server anyway
server starting
bash-3.2$ 2017-05-10 11:35:59 EDT LOG:  redirecting log output to logging collector process
2017-05-10 11:35:59 EDT HINT:  Future log output will appear in directory "pg_log".
--check the postmaster server process id this  will be varried from 9590  to  10734  
-bash-3.2# ps -ef |grep post
root     10702 10672  0 11:34 pts/4    00:00:00 su postgres
postgres 10703 10702  0 11:34 pts/4    00:00:00 bash
postgres 10734     1  0 11:35 pts/4    00:00:00 /opt/PostgreSQL/9.3/bin/postgres -D /opt/PostgreSQL/9.3/data
postgres 10735 10734  0 11:35 ?        00:00:00 postgres: logger process                                    
postgres 10737 10734  0 11:36 ?        00:00:00 postgres: checkpointer process                               
postgres 10738 10734  0 11:36 ?        00:00:00 postgres: writer process                                    
postgres 10739 10734  0 11:36 ?        00:00:00 postgres: wal writer process                                
postgres 10740 10734  0 11:36 ?        00:00:00 postgres: autovacuum launcher process                       
postgres 10741 10734  0 11:36 ?        00:00:00 postgres: archiver process                                  
postgres 10742 10734  0 11:36 ?        00:00:00 postgres: stats collector process                           
root     11744 15782  0 12:34 pts/2    00:00:00 grep post
root     15754 15727  0 May08 pts/2    00:00:00 su postgres
postgres 15755 15754  0 May08 pts/2    00:00:00 bash
--check the postmaster.pid file postmaster process id will be varried
-bash-3.2# cat postmaster.pid 
10734
/opt/PostgreSQL/9.3/data
1494430559
5432
/tmp
*
  5432001   3866625

Comments

Popular posts from this blog

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

PostgreSQL Pgbadger Installation On Linux

PostgreSQL pgBadger

How to configure Replication Manager (repmgr) ?

Migrating From Oracle to PostgreSQL using ora2pg open source tools