码迷,mamicode.com
首页 > 其他好文 > 详细

PG_RMAN备份遇到 domain socket

时间:2016-05-31 19:03:55      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:

在用pg_rman做数据全备时;出现异常错误!
[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.

 

PG_RMAN备份遇到 domain socket

标签:

原文地址:http://www.cnblogs.com/lottu/p/5546799.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!