繼上次 EDB 企業版鎖住 Superuser 登入不了之後,再一個怎麼辦系列第二彈~
這次輪到 Greenplum。
如下手工做了這個動作~用 vi 把 IPv6 localhost ::1 登入規則給註解掉(這邊用 sed 示意),然後又重新載入資料庫設定。。。
[gpadmin@gpdb6x ~]$ sed -e 's/\(.*::1.*\)/#\1/g' -i /data/master/gpseg-1/pg_hba.conf [gpadmin@gpdb6x ~]$ grep '\(.*::1.*\)' /data/master/gpseg-1/pg_hba.conf #host all gpadmin ::1/128 trust [gpadmin@gpdb6x ~]$ [gpadmin@gpdb6x ~]$ gpstop -u 20200822:15:12:45:003894 gpstop:gpdb5x:gpadmin-[INFO]:-Starting gpstop with args: -u 20200822:15:12:45:003894 gpstop:gpdb5x:gpadmin-[INFO]:-Gathering information and validating the environment... 20200822:15:12:45:003894 gpstop:gpdb5x:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information 20200822:15:12:45:003894 gpstop:gpdb5x:gpadmin-[INFO]:-Obtaining Segment details from master... 20200822:15:12:45:003894 gpstop:gpdb5x:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.10.0 build commit:cced3a78d1a0650ba21205438955d2df06644bc8' 20200822:15:12:45:003894 gpstop:gpdb5x:gpadmin-[INFO]:-Signalling all postmaster processes to reload . [gpadmin@gpdb6x ~]$
再來就會發現。。。沒辦法重新載入或關閉整組 Greenplum 叢集惹。。。
就算把 pg_hba.conf 改回來也沒辦法~
[gpadmin@gpdb6x ~]$ sed -e 's/#\(.*::1.*\)/\1/g' -i /data/master/gpseg-1/pg_hba.conf
[gpadmin@gpdb6x ~]$ grep '\(.*::1.*\)' /data/master/gpseg-1/pg_hba.conf
host all gpadmin ::1/128 trust
[gpadmin@gpdb6x ~]$
[gpadmin@gpdb6x ~]$ gpstop -u
20200822:15:14:05:003913 gpstop:gpdb5x:gpadmin-[INFO]:-Starting gpstop with args: -u
20200822:15:14:05:003913 gpstop:gpdb5x:gpadmin-[INFO]:-Gathering information and validating the environment...
20200822:15:14:05:003913 gpstop:gpdb5x:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20200822:15:14:05:003913 gpstop:gpdb5x:gpadmin-[INFO]:-Obtaining Segment details from master...
20200822:15:14:05:003913 gpstop:gpdb5x:gpadmin-[CRITICAL]:-gpstop failed. (Reason='FATAL: no pg_hba.conf entry for host "::1", user "gpadmin", database "template1", SSL off') exiting...
[gpadmin@gpdb5x ~]$
由於 Greenplum 並不像 PostgreSQL 資料庫一樣只有一個資料庫,而是有一群節點。因此。。感覺現在處於關不掉資料庫惹。。。難道只能手動執行很傷的 kill 指令了ㄇ。。?
其實~還是有辦法的~~~只要想到 Greenplum 的骨幹還是 PostgreSQL 資料庫,就會發現在資料庫裡面還是能 reload~透過 pg_reload_conf() 函數!
因此,只要把 pg_hba.conf 參數檔改回來(像上面一樣),再登入資料庫 reload 就可以了~
[gpadmin@gpdb6x ~]$ psql psql (9.4.24) Type "help" for help. postgres=# select pg_reload_conf(); pg_reload_conf ---------------- t (1 row) postgres=# \q [gpadmin@gpdb6x ~]$ gpstop -u 20200822:15:14:40:003928 gpstop:gpdb5x:gpadmin-[INFO]:-Starting gpstop with args: -u 20200822:15:14:40:003928 gpstop:gpdb5x:gpadmin-[INFO]:-Gathering information and validating the environment... 20200822:15:14:40:003928 gpstop:gpdb5x:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information 20200822:15:14:40:003928 gpstop:gpdb5x:gpadmin-[INFO]:-Obtaining Segment details from master... 20200822:15:14:40:003928 gpstop:gpdb5x:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.10.0 build commit:cced3a78d1a0650ba21205438955d2df06644bc8' 20200822:15:14:40:003928 gpstop:gpdb5x:gpadmin-[INFO]:-Signalling all postmaster processes to reload . [gpadmin@gpdb6x ~]$
自手殘中復活成功~
沒有留言:
張貼留言