标签:
[postgres@sdserver40_210 run]$ pg_rman backup --backup-mode=full --progress ERROR: could not connect to database postgres: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
根据提示错误去找ll -alrt /var/run | grep "5432" 是不存在socket "/var/run/postgresql/.s.PGSQL.5432"?; 肯定是不存在的;存在的话就不会出现上面异常错误;
[postgres@sdserver40_210 pgdata]$ ll -alrt /var/run | grep "5432" [postgres@sdserver40_210 pgdata]$
既然不存在;然道是数据库没启动;端口并不是5432;重启下数据库 ;查下端口也是5432;但是/tmp/.s.PGSQL.5432;并不是/var/run/postgresql/.s.PGSQL.5432。
[postgres@sdserver40_210 pgdata]$ netstat -nlp | grep 5432 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 12788/postgres unix 2 [ ACC ] STREAM LISTENING 9137990 12788/postgres /tmp/.s.PGSQL.5432
【解决方案】
[root@sdserver40_210 run]# ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432 [root@sdserver40_210 run]# [postgres@sdserver40_210 ~]$ pg_rman backup --backup-mode=full --progress INFO: copying database files Processed 1153 of 1153 files, skipped 0 NOTICE: pg_stop_backup complete, all required WAL segments have been archived INFO: copying archived WAL files Processed 26 of 26 files, skipped 0 INFO: backup complete HINT: Please execute ‘pg_rman validate‘ to verify the files are correctly copied.
标签:
原文地址:http://www.cnblogs.com/lottu/p/5546799.html