为什么使用 gs_probackup 执行全量备份时,提示无法连接到数据库?
背景介绍:
在使用 gs_probackup 执行全量备份时,提示无法连接到数据库。
报错内容:
[ommdoc@hostname]$ gs_probackup backup -B /opt/mogdb/backup_dir --instance cluster_doc -b FULL
INFO: Backup start, gs_probackup version: 2.4.2, instance: cluster_doc, backup ID: RGOU8R, backup mode: FULL, wal mode: STREAM, remote: false, compress-algorithm: none, compress-level: 1
LOG: Backup destination is initialized
ERROR: could not connect to database ommdoc: connect to server failed: No such file or directory
WARNING: Backup RGOU8R is running, setting its status to ERROR
报错原因:
参数--instance 意思是需要用户自定义一个实例名称。在执行 ptk ls 时发现系统中存在如下实例,因此错误的将--instance 指定为 cluster_doc.
[root@hostname]# ptk ls
cluster_name | instances | user | data_dir | db_version
---------------+--------------------+---------+--------------------+--------------
mogdb1 | ...:27000 | ommdoc1 | /opt/mogdbpoc/data | MogDB-3.0.1
cluster_doc | ...:28000 | ommdoc | /opt/mogdb/data | MogDB-3.0.0
未指定数据库连接信息。(如果数据库端口不是默认端口,需要设置数据库连接信息)
解决办法:
指定一个数据库实例名。例如 instance1.
[ommdoc@hostname]$ gs_probackup backup -B /opt/mogdb/backup_dir --instance instance1 -b FULL
设置数据库连接信息,例如数据库为 postgres,数据库端口为 28000
[ommdoc@hostname]$ gs_probackup set-config --instance=instance1 -B /opt/mogdb/backup_dir -d postgres -p 28000
标签:opt,gs,数据库,instance,全量,probackup,backup From: https://www.cnblogs.com/helloopenGauss/p/18096293