Monday, December 27, 2021

FATAL: could not read pid file

  Error:- I faced this issue when I first time installed the edb-pgpool42.  Installed the PGPOOL4.2 and started the pgpool service successfully. But after reboot the pgpool server, it not came up. Error reported in PGPOOL log file  was  "FATAL:  could not read pid file".


Issue:-

Error report in edb-pgpool42.log log file

root@ip:/var/run/runfile# cd /var/log/edb/pgpool4.2/

root@ip:/var/log/edb/pgpool4.2# ls -lrth

total 4.0K

-rw-r--r-- 1 enterprisedb enterprisedb 202 Dec 25 12:39 edb-pgpool42.log

root@ip:/var/log/edb/pgpool4.2# cat edb-pgpool42.log

2021-12-25 12:39:25: pid 8228: WARNING:  "pool_conn_dbname" is depreciated, use "health_check_database" to configure health check database

2021-12-25 12:39:25: pid 8228: FATAL:  could not read pid file

root@ip:/var/log/edb/pgpool4.2#

Solution:-

1. Checked the /etc/edb/edb-pgpool42/pgpool.conf file. Check the location of pid_file_name.

pid_file_name = '/var/run/edb/pgpool4.2/edb-pgpool-4.2.pid'

2. Change the directory of pid_file_name in pgpool.conf file and take the restart/start.

ex: pid_file_name = '/var/run/any_directory/pgpool.pid'

pid_file_name = '/var/run/anylocation/edb-pgpool-4.2.pid'

3. Give full permission to enterprisedb or postgres

root@ip:/var/run# pwd

/var/run

drwxr-xr-x  2 enterprisedb enterprisedb   80 Dec 25 15:25 anylocation
root@ip:/var/run# cd anylocation
root@ip:/var/run# ls
-rw------- 1 enterprisedb enterprisedb 6 Dec 25 15:20 edb-pgpool-4.2.pid

4. Check all the directory mentioned in pgpool.conf file exists or not and having proper permission. In my case directory /var/run/edb-as/ was missing.  

enterprisedb@ip:~$ /usr/edb/pgpool4.2/bin/pgpool -n -d
pid 28631: WARNING:  "pool_conn_dbname" is depreciated, use "health_check_database" to configure health check database
pid 28631: DEBUG:  initializing pool configuration
pid 28631: DETAIL:  num_backends: 1 total_weight: 1.000000
pid 28631: DEBUG:  initializing pool configuration
pid 28631: DETAIL:  backend 0 weight: 2147483647.000000 flag: 0000
pid 28631: DEBUG:  pool_coninfo_size: num_init_children (32) * max_pool (4) * MAX_NUM_BACKENDS (128) * sizeof(ConnectionInfo) (136) = 2228224 bytes requested for shared memory
pid 28631: LOG:  health_check_stats_shared_memory_size: requested size: 12288
pid 28631: LOG:  memory cache initialized
pid 28631: DETAIL:  memcache blocks :64
pid 28631: LOG:  allocating (136571712) bytes of shared memory segment
pid 28631: LOG:  allocating shared memory segment of size: 136571712
pid 28631: DEBUG:  pool_coninfo_size: num_init_children (32) * max_pool (4) * MAX_NUM_BACKENDS (128) * sizeof(ConnectionInfo) (136) = 2228224 bytes requested for shared memory
pid 28631: LOG:  health_check_stats_shared_memory_size: requested size: 12288
pid 28631: LOG:  health_check_stats_shared_memory_size: requested size: 12288
pid 28631: LOG:  memory cache initialized
pid 28631: DETAIL:  memcache blocks :64
pid 28631: DEBUG:  memory cache request size : 67108864
pid 28631: LOG:  pool_discard_oid_maps: discarded memqcache oid maps
pid 28631: FATAL:  failed to bind a socket: "/var/run/edb-as/.s.PGSQL.9999"
pid 28631: DETAIL:  bind socket failed with error: "No such file or directory"
pid 28631: LOG:  shutting down


4. Created the missed directory and verify the other directories too.

enterprisedb@ip:~$ cd /var/run/edb-as/
-bash: cd: /var/run/edb-as/: No such file or directory
root@ip:/tmp# mkdir -p /var/run/edb-as/
root@ip:/tmp# chown enterprisedb:enterprisedb /var/run/edb-as/
root@ip:/tmp# su - enterprisedb

5. Started the service successfully.

root@ip:/tmp# systemctl start edb-pgpool42.service
root@ip:/tmp# systemctl status edb-pgpool42.service
● edb-pgpool42.service - pgpool-II service script for EDB Postgres Advanced Server
     Loaded: loaded (/lib/systemd/system/edb-pgpool42.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2021-12-25 15:20:33 UTC; 2s ago
    Process: 29671 ExecStart=/bin/bash -c /usr/edb/pgpool4.2/bin/edb-pgpool42.sh (code=exited, status=0/SUCCESS)
   Main PID: 29672 (pgpool)
      Tasks: 33 (limit: 1147)
     Memory: 143.5M
     CGroup: /system.slice/edb-pgpool42.service
             ├─29672 /usr/edb/pgpool4.2/bin/pgpool -D -f /etc/edb/edb-pgpool42/pgpool.conf -n -F /etc/edb/edb-pgpool42/pcp.conf>
             ├─29676 pgpool: wait for connection request
             ├─29677 pgpool: wait for connection request
             ├─29678 pgpool: wait for connection request
             ├─29679 pgpool: wait for connection request
             ├─29680 pgpool: wait for connection request
             ├─29681 pgpool: wait for connection request
             ├─29682 pgpool: wait for connection request
             ├─29683 pgpool: wait for connection request
             ├─29684 pgpool: wait for connection request
             ├─29685 pgpool: wait for connection request
             ├─29686 pgpool: wait for connection request
             ├─29687 pgpool: wait for connection request
             ├─29688 pgpool: wait for connection request
             ├─29689 pgpool: wait for connection request





No comments:

Post a Comment

EFM Switchover Command

1. Check the Current Status using EFM command root@ip-192.162.1.1:~# root@ip-192.162.1.1:~# /usr/edb/efm-4.2/bin/efm cluster-status efm Clus...