Skip to content

Где или как указать socket postgres для pg_probackup-16 #626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
EuLeEr opened this issue Jul 18, 2024 · 2 comments
Closed

Comments

@EuLeEr
Copy link

EuLeEr commented Jul 18, 2024

Команда pg_probackup-16 backup -B ~/backup -b FULL --instance=1cnode --compress-algorithm=zlib -d ERP2Demo возвращает
ERROR: could not connect to database ERP2Demo: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: Нет такого файла или каталога
Is the server running locally and accepting connections on that socket?

На самом деле socket по умолчанию находится /tmp
ls -la /tmp/
итого 40
drwxrwxrwt 10 root root 4096 июл 18 18:50 .
drwxr-xr-x 19 root root 4096 июл 17 09:25 ..
srwxrwxrwx 1 postgres postgres 0 июл 18 18:50 .s.PGSQL.5432
-rw------- 1 postgres postgres 54 июл 18 18:50 .s.PGSQL.5432.lock

uname -a
Linux DESKTOP-1F7O6M0 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
pg_probackup-16 --version
pg_probackup-16 2.5.15 (PostgreSQL 16.2)

@fukanchik
Copy link

Краткое обсуждение причины этого в сообществе: https://www.postgresql.org/message-id/[email protected]

Настройка параметров соединения описана в документации: https://postgrespro.com/docs/enterprise/9.6/app-pgprobackup#pbk-connection-opts

пробэкап принимает обычные опции и переменные среды libpq описанные здесь https://postgrespro.com/docs/enterprise/9.6/libpq-envars.html

Т.е. в вашем случае нужно указать

 pg_probackup-16 backup -B ~/backup -b FULL --instance=1cnode --compress-algorithm=zlib -d ERP2Demo --pghost=/tmp

В качестве альтернативы вы можете изменить LD_LIBRARY_PATH так, чтобы он указывал в директорию, в которой находится libpq от той инсталляции postgres, которую вы бэкапите.

@EuLeEr
Copy link
Author

EuLeEr commented Jul 18, 2024

Спасибо !

@EuLeEr EuLeEr closed this as completed Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants