Failed to start postgresql database server linux

Ошибка запуска postgress 12

Добрый день. Ночью отключали питания. После этого перестал стартовать постгресс. При запуске задумывается минуты на 2. После чего ошибка запуска

Выхлоп с journalctl -xe

А в самом логе постгреса есть что-то?

Для начала сделайте бекапы данных если еще не сделали, я так понимаю, что за файловая система у вас на сервере, насколько хорошо она была восстановлена после сбоя? Я так понимаю вы не снимаете ежедневные бекапы с базы? Еще можете посмотреть эту статью она по вашей теме. Также я посоветовал бы если есть возможность клонировать данный инстанс если это виртуальный сервер, то так и поступить перед тем как практиковаться на кошках. Исходя из статьи данные восстановить можно, но с частичной потерей.

Бэкапы есть только тех баз что нужны. Остальные тестовые. Не так важны.
Эту статью я читал но проблема в том что из этого релиза разработчики почему то исключили pg_xlogdump

Проверил диск, битых секторов нет. [br] Тут вся проблема в том что нет контрольной точки[br] ПАНИКА: не удалось считать правильную запись контрольной точки[br]

Источник

postgres запускается, но не запускается

Знаю, что уже замылили эту тему, но все, что я нашел не помогло или не соответствует моей ситуации, так что прошу помощи знатоков.

на что получаю сообщение, что все ok

при запуске ошибок не выдает но и не запускается.. как так? при этом

Active: active (exited) since Wed 2017-11-08 10:32:43 MSK; 26min ago

а чуть подробнее??

could not connect to server: Connection refused

А ты роли добавил?

Что тебе нужно подробнее? здесь и так все ясно написано

ну, видимо, мне не ясно, раз я спрашиваю. Логично же.

я не понимаю, что ему нужно от меня?

postgresql.service — запускает все настроенные инстансы постгреса в убунте, для того чтобы запустить нужный нужно стартовать postgresql- .service.

createuser —interactive сделай, добавь пользователя дай ему нужную роль, зайди от него.

В соединении отказано, всё работает, просто у тебя нет доступа

ну, видимо, мне не ясно, раз я спрашиваю. Логично же.

Ну, кроме вчитаться в текст я тебе больше ничего предложить не могу

В соединении отказано, всё работает, просто у тебя нет доступа

Это не значит, что нет доступа, это значит, что там попросту некому это соединение принимать.

вот жесть-то, и советчики такие же.

Я и говорю что ролей нет

Ну так насоветуй )

Ты бы внимательно прочитал на что отвечаешь.

Там не то, что ролей, там и самого процесса постгресса нет

Что в pgstartup.log?

мне не добавить роль

Тьфу блин, ай нуу, пойду кофе пить и просыпаться 😀

у меня такого нет

Значит есть /var/lib/postgresql/версия/pg_log/*.log

Покажи systemctl list-units|grep postgres

Там должен быть сервис вида postgresql@9.5-main.service. Вот его и запускаешь, systemctl start postgresql@9.5-main.service.

Если нет, то смотришь в /var/lib/postgres, есть ли там что-нибудь. Если там пусто, значит у тебя нет базы, и ее нужно создать.

Точно нет? Показывай /etc/init.d/postgresql — посмотрим, что там в убунтушном инит-скрипте накручено.

Читайте также:  User administrator in linux

Какой инит-скрипт, у него systemd.

У убунты логи постгреса в /var/log/postgresql. Смотри почему он фейлится. Ну и можешь journalctl -e -u postgresql@9.5-main.service глянуть.

смотри во время запуска/перезапуска сервиса
tail -F /var/log/syslog

ОтЭтот пунктец: Step # 2: Allow communication over TCP/IP

)) А анон в теме, да. Или шарит по английски 😉

я не понимаю, что ему нужно от меня?

Он должен (psql) через чёта общаться. SocketЫ там, порты всякие.

See «systemctl status postgresql@9.5-main.service» and «journalctl -xe» for details.

Эти команды что пишут?

в логе ппусто, а в журнале:

В конфиге что-нибудь менял?

Попробуй запустить так

ничего не менял. Все работало раньше, а потом в один момент упало. никто даже не подключался к серверу, только если через http

И после этого в логах ничего нет?

Место-то на сервер есть? df -h что показывает?

серьезно нет места.

это не нормально.

да действительно проблема была в свободном месте.

Спасибо всем за помощь!

Такая же проблема, но со свободным местом проблем нет. При этом: — вся эта ситуация происходит только после перезапуска самой ОС (Ubuntu Server 16.04 32bit); — netstat -tulpn(-pant) | grep postgres ничего не выводит — пусто; — psql -U postgres -h ip-сервера postgres psql: не удалось подключиться к серверу: Connection refused Он действительно работает по адресу «ip-сервера» и принимает TCP-соединения (порт 5432)? — где «ip-сервера» — адрес сервера с БД;

— если после старта ОС немного подождать и просто перезапустить демон postgresql (service postgresql stop/start), то проблема уходит. Правда, не всегда после первого рестарта. Иногда нужно несколько раз перезапустить демон.

Никогда раньше такого не видел. Куда копать ума не приложу. Перерыл интернет, — наткнулся сюда. Хэлп.

Источник

17.3. Starting the Database Server

Before anyone can access the database, you must start the database server. The database server program is called postgres. The postgres program must know where to find the data it is supposed to use. This is done with the -D option. Thus, the simplest way to start the server is:

which will leave the server running in the foreground. This must be done while logged into the PostgreSQL user account. Without -D, the server will try to use the data directory named by the environment variable PGDATA. If that variable is not provided either, it will fail.

Normally it is better to start postgres in the background. For this, use the usual Unix shell syntax:

It is important to store the server’s stdout and stderr output somewhere, as shown above. It will help for auditing purposes and to diagnose problems. (See Section 23.3 for a more thorough discussion of log file handling.)

The postgres program also takes a number of other command-line options. For more information, see the postgres reference page and Chapter 18 below.

This shell syntax can get tedious quickly. Therefore the wrapper program pg_ctl is provided to simplify some tasks. For example:

will start the server in the background and put the output into the named log file. The -D option has the same meaning here as for postgres. pg_ctl is also capable of stopping the server.

Читайте также:  Linux which windows manager

Normally, you will want to start the database server when the computer boots. Autostart scripts are operating-system-specific. There are a few distributed with PostgreSQL in the contrib/start-scripts directory. Installing one will require root privileges.

Different systems have different conventions for starting up daemons at boot time. Many systems have a file /etc/rc.local or /etc/rc.d/rc.local. Others use init.d or rc.d directories. Whatever you do, the server must be run by the PostgreSQL user account and not by root or any other user. Therefore you probably should form your commands using su postgres -c ‘. ‘. For example:

Here are a few more operating-system-specific suggestions. (In each case be sure to use the proper installation directory and user name where we show generic values.)

For FreeBSD , look at the file contrib/start-scripts/freebsd in the PostgreSQL source distribution.

On OpenBSD , add the following lines to the file /etc/rc.local:

On Linux systems either add

to /etc/rc.d/rc.local or /etc/rc.local or look at the file contrib/start-scripts/linux in the PostgreSQL source distribution.

On NetBSD , use either the FreeBSD or Linux start scripts, depending on preference.

On Solaris , create a file called /etc/init.d/postgresql that contains the following line:

Then, create a symbolic link to it in /etc/rc3.d as S99postgresql.

17.3.1. Server Start-up Failures

There are several common reasons the server might fail to start. Check the server’s log file, or start it by hand (without redirecting standard output or standard error) and see what error messages appear. Below we explain some of the most common error messages in more detail.

This usually means just what it suggests: you tried to start another server on the same port where one is already running. However, if the kernel error message is not Address already in use or some variant of that, there might be a different problem. For example, trying to start a server on a reserved port number might draw something like:

probably means your kernel’s limit on the size of shared memory is smaller than the work area PostgreSQL is trying to create (4011376640 bytes in this example). Or it could mean that you do not have System-V-style shared memory support configured into your kernel at all. As a temporary workaround, you can try starting the server with a smaller-than-normal number of buffers (shared_buffers). You will eventually want to reconfigure your kernel to increase the allowed shared memory size. You might also see this message when trying to start multiple servers on the same machine, if their total space requested exceeds the kernel limit.

does not mean you’ve run out of disk space. It means your kernel’s limit on the number of System V semaphores is smaller than the number PostgreSQL wants to create. As above, you might be able to work around the problem by starting the server with a reduced number of allowed connections (max_connections), but you’ll eventually want to increase the kernel limit.

If you get an «illegal system call» error, it is likely that shared memory or semaphores are not supported in your kernel at all. In that case your only option is to reconfigure the kernel to enable these features.

Читайте также:  Person looking in windows

17.3.2. Client Connection Problems

Although the error conditions possible on the client side are quite varied and application-dependent, a few of them might be directly related to how the server was started. Conditions other than those shown below should be documented with the respective client application.

This is the generic «I couldn’t find a server to talk to» failure. It looks like the above when TCP/IP communication is attempted. A common mistake is to forget to configure the server to allow TCP/IP connections.

Alternatively, you’ll get this when attempting Unix-domain socket communication to a local server:

The last line is useful in verifying that the client is trying to connect to the right place. If there is in fact no server running there, the kernel error message will typically be either Connection refused or No such file or directory , as illustrated. (It is important to realize that Connection refused in this context does not mean that the server got your connection request and rejected it. That case will produce a different message, as shown in Section 19.4.) Other error messages such as Connection timed out might indicate more fundamental problems, like lack of network connectivity.

Источник

Postgresql: Error starting the service postgresql-10.service #111

Comments

KewtonV commented Oct 27, 2018

Hi guys.
I installed the «dnf install postgresql10 postgresql10-server» in my Fedora 28 using these instructions:
https://www.if-not-true-then-false.com/2012/install-postgresql-on-fedora-centos-red-hat-rhel/
I also installed postgresql-devel and postgresql-contrib
But when I was «started» with the command «systemctl start postgresql-10.service» the following error occurred:

[root@localhost Kewton]# systemctl start postgresql-10.service

Job for postgresql-10.service failed because the control process exited with error code.
See «systemctl status postgresql-10.service» and «journalctl -xe» for details.

[root@localhost Kewton]# systemctl status postgresql-10.service

postgresql-10.service — PostgreSQL 10 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-10.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2018-10-27 06:03:55 -03; 1min 9s ago
Docs: https://www.postgresql.org/docs/10/static/
Process: 5783 ExecStart=/usr/pgsql-10/bin/postmaster -D $ (code=exited, status=1/FAILURE)
Process: 5778 ExecStartPre=/usr/pgsql-10/bin/postgresql-10-check-db-dir $ (code=exited, status=0/SUCCESS)
Main PID: 5783 (code=exited, status=1/FAILURE)

out 27 06:03:55 localhost.localdomain postmaster[5783]: 2018-10-27 06:03:55.140 -03 [5783] LOG: listening on IPv4 address «0.0.0.0», port 5432
out 27 06:03:55 localhost.localdomain postmaster[5783]: 2018-10-27 06:03:55.140 -03 [5783] LOG: listening on IPv6 address «::», port 5432
out 27 06:03:55 localhost.localdomain postmaster[5783]: 2018-10-27 06:03:55.152 -03 [5783] LOG: listening on Unix socket «/var/run/postgresql/.s.PGSQL.5432»
out 27 06:03:55 localhost.localdomain postmaster[5783]: 2018-10-27 06:03:55.167 -03 [5783] LOG: listening on Unix socket «/tmp/.s.PGSQL.5432»
out 27 06:03:55 localhost.localdomain postmaster[5783]: 2018-10-27 06:03:55.193 -03 [5783] LOG: redirecting log output to logging collector process
out 27 06:03:55 localhost.localdomain postmaster[5783]: 2018-10-27 06:03:55.193 -03 [5783] HINT: Future log output will appear in directory «log».
out 27 06:03:55 localhost.localdomain systemd[1]: postgresql-10.service: Main process exited, code=exited, status=1/FAILURE
out 27 06:03:55 localhost.localdomain systemd[1]: postgresql-10.service: Killing process 5785 (postmaster) with signal SIGKILL.
out 27 06:03:55 localhost.localdomain systemd[1]: postgresql-10.service: Failed with result ‘exit-code’.
out 27 06:03:55 localhost.localdomain systemd[1]: Failed to start PostgreSQL 10 database server.

Can you help me?

The text was updated successfully, but these errors were encountered:

Источник

Оцените статью