Автор Тема: kW10: postgres 9.6 [решено]  (Прочитано 2093 раз)

Оффлайн Vasiliy_ZV

  • Участник
  • *
  • Сообщений: 385
  • +++
kW10: postgres 9.6 [решено]
« : 04.03.2023 22:02:08 »
Установил через Synaptic нужную мне версию postgres 9.6. Перезагрузился, проверяю статус в systemctl - пишет не найден!?
[user1@boyishjeans ~]$ systemctl status postgresql
Unit postgresql.service could not be found.
[user1@boyishjeans ~]$
[root@boyishjeans user1]# systemctl start postgresql
Failed to start postgresql.service: Unit postgresql.service not found.
[root@boyishjeans user1]# systemctl enable postgresql
Failed to enable unit: Unit file postgresql.service does not exist.
[root@boyishjeans user1]#
Что-то я не учел, недоустановил? Нет службы!
Посмотрел в результатах выдачи на форуме по запросу
Цитировать
postgresql.service could not be found
- подобной ситуации нет!
« Последнее редактирование: 05.03.2023 18:15:23 от Skull »

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 20 168
    • Домашняя страница
Re: kW10: postgres 9.6
« Ответ #1 : 05.03.2023 07:30:27 »
Ставить нужно пакет с суффиксом -server.
Андрей Черепанов (cas@)

Оффлайн Vasiliy_ZV

  • Участник
  • *
  • Сообщений: 385
  • +++
Re: kW10: postgres 9.6
« Ответ #2 : 05.03.2023 15:59:11 »
Да, установил, служба появилась, но запуск завершается с ошибкой!
[user1@boyishjeans ~]$ sudo systemctl status postgresql
[sudo] password for user1:
○ postgresql.service - PostgreSQL database server
     Loaded: loaded (/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)
     Active: inactive (dead)
[user1@boyishjeans ~]$ su -
Password:
[root@boyishjeans ~]# service postgresql start
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xeu postgresql.service" for details.
[root@boyishjeans ~]# systemctl status postgresql.service
× postgresql.service - PostgreSQL database server
     Loaded: loaded (/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sun 2023-03-05 15:55:21 MSK; 34s ago
    Process: 4211 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)
        CPU: 18ms

мар 05 15:55:21 boyishjeans systemd[1]: Starting PostgreSQL database server...
мар 05 15:55:21 boyishjeans postgresql-check-db-dir[4211]: "/var/lib/pgsql/data" is missing or empty.
мар 05 15:55:21 boyishjeans postgresql-check-db-dir[4211]: Use "/etc/init.d/postgresql initdb" to initialize the database cluster.
мар 05 15:55:21 boyishjeans postgresql-check-db-dir[4211]: See /usr/share/doc/postgresql-9.6.24/README.rpm-dist for more information.
мар 05 15:55:21 boyishjeans systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
мар 05 15:55:21 boyishjeans systemd[1]: postgresql.service: Failed with result 'exit-code'.
мар 05 15:55:21 boyishjeans systemd[1]: Failed to start PostgreSQL database server.
[root@boyishjeans ~]#
[user1@boyishjeans ~]$ journalctl -xeu postgresql.service
░░
░░ Начат процесс запуска юнита postgresql.service.
мар 05 15:55:21 boyishjeans postgresql-check-db-dir[4211]: "/var/lib/pgsql/data" is missing or empty.
мар 05 15:55:21 boyishjeans postgresql-check-db-dir[4211]: Use "/etc/init.d/postgresql initdb" to initialize the database cluster.
мар 05 15:55:21 boyishjeans postgresql-check-db-dir[4211]: See /usr/share/doc/postgresql-9.6.24/README.rpm-dist for more information.
мар 05 15:55:21 boyishjeans systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStartPre= process belonging to unit postgresql.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
мар 05 15:55:21 boyishjeans systemd[1]: postgresql.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit postgresql.service has entered the 'failed' state with result 'exit-code'.
мар 05 15:55:21 boyishjeans systemd[1]: Failed to start PostgreSQL database server.
░░ Subject: Ошибка юнита postgresql.service
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ Произошел сбой юнита postgresql.service.
░░
░░ Результат: failed.
мар 05 16:05:50 boyishjeans systemd[1]: Starting PostgreSQL database server...
░░ Subject: Начинается запуск юнита postgresql.service
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ Начат процесс запуска юнита postgresql.service.
мар 05 16:05:50 boyishjeans postgresql-check-db-dir[4946]: "/var/lib/pgsql/data" is missing or empty.
мар 05 16:05:50 boyishjeans postgresql-check-db-dir[4946]: Use "/etc/init.d/postgresql initdb" to initialize the database cluster.
мар 05 16:05:50 boyishjeans postgresql-check-db-dir[4946]: See /usr/share/doc/postgresql-9.6.24/README.rpm-dist for more information.
мар 05 16:05:50 boyishjeans systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStartPre= process belonging to unit postgresql.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
мар 05 16:05:50 boyishjeans systemd[1]: postgresql.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit postgresql.service has entered the 'failed' state with result 'exit-code'.
мар 05 16:05:50 boyishjeans systemd[1]: Failed to start PostgreSQL database server.
░░ Subject: Ошибка юнита postgresql.service
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ Произошел сбой юнита postgresql.service.
░░
░░ Результат: failed.
lines 37-94/94 (END)
« Последнее редактирование: 05.03.2023 16:11:14 от Vasiliy_ZV »

Оффлайн NickM

  • Участник
  • *
  • Сообщений: 963
Re: kW10: postgres 9.6
« Ответ #3 : 05.03.2023 16:23:17 »
мар 05 15:55:21 boyishjeans postgresql-check-db-dir[4211]: "/var/lib/pgsql/data" is missing or empty.
мар 05 15:55:21 boyishjeans postgresql-check-db-dir[4211]: Use "/etc/init.d/postgresql initdb" to initialize the database cluster.
мар 05 15:55:21 boyishjeans postgresql-check-db-dir[4211]: See /usr/share/doc/postgresql-9.6.24/README.rpm-dist for more information.

мар 05 15:55:21 boyishjeans postgresql-check-db-dir[4211]: Use "/etc/init.d/postgresql initdb" to initialize the database cluster.

# /etc/init.d/postgresql initdb

Оффлайн Vasiliy_ZV

  • Участник
  • *
  • Сообщений: 385
  • +++
Re: kW10: postgres 9.6
« Ответ #4 : 05.03.2023 17:16:46 »
[user1@boyishjeans ~]$ sudo /etc/init.d/postgresql initdb
[sudo] password for user1:
Creating default database:
Файлы, относящиеся к этой СУБД, будут принадлежать пользователю "postgres".
От его имени также будет запускаться процесс сервера.

Кластер баз данных будет инициализирован с локалью "ru_RU.UTF-8".
Кодировка БД по умолчанию, выбранная в соответствии с настройками: "UTF8".
Выбрана конфигурация текстового поиска по умолчанию "russian".

Контроль целостности страниц данных отключён.

исправление прав для существующего каталога /var/lib/pgsql/data... ок
создание подкаталогов... ок
выбирается значение max_connections по умолчанию... 100
выбирается значение shared_buffers по умолчанию... 128MB
выбирается часовой пояс по умолчанию... Europe/Moscow
выбирается реализация динамической разделяемой памяти... posix
создание конфигурационных файлов... ок
выполняется подготовительный скрипт... ок
выполняется заключительная инициализация... ок
сохранение данных на диске... ок

ПРЕДУПРЕЖДЕНИЕ: используется проверка подлинности "trust" для локальных подключений.
Другой метод можно выбрать, отредактировав pg_hba.conf или используя ключи -A,
--auth-local или --auth-host при следующем выполнении initdb.

Success. You can now start the database server using:

    service postgresql start
or
    pg_ctl -D /var/lib/pgsql/data -l logfile start

[user1@boyishjeans ~]$ systemctl status postgresql.service
× postgresql.service - PostgreSQL database server
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sun 2023-03-05 16:05:50 MSK; 1h 8min ago
    Process: 4946 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)
        CPU: 18ms

мар 05 16:05:50 boyishjeans systemd[1]: Starting PostgreSQL database server...
мар 05 16:05:50 boyishjeans postgresql-check-db-dir[4946]: "/var/lib/pgsql/data" is missing or empty.
мар 05 16:05:50 boyishjeans postgresql-check-db-dir[4946]: Use "/etc/init.d/postgresql initdb" to initialize the database cluster.
мар 05 16:05:50 boyishjeans postgresql-check-db-dir[4946]: See /usr/share/doc/postgresql-9.6.24/README.rpm-dist for more information.
мар 05 16:05:50 boyishjeans systemd[1]: postgresql.service: Control process exited, code=exited, status=1/FAILURE
мар 05 16:05:50 boyishjeans systemd[1]: postgresql.service: Failed with result 'exit-code'.
мар 05 16:05:50 boyishjeans systemd[1]: Failed to start PostgreSQL database server.
[user1@boyishjeans ~]$ systemctl start postgresql.service
[user1@boyishjeans ~]$ systemctl status postgresql.service
● postgresql.service - PostgreSQL database server
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
     Active: active (running) since Sun 2023-03-05 17:15:03 MSK; 5s ago
    Process: 6289 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
    Process: 6294 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=0/SUCCESS)
   Main PID: 6298 (postgres)
      Tasks: 6 (limit: 19095)
     Memory: 15.1M
        CPU: 109ms
     CGroup: /system.slice/postgresql.service
             ├─ 6298 /usr/bin/postgres -D /var/lib/pgsql/data -p 5432
             ├─ 6300 "postgres: checkpointer process   " "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
             ├─ 6301 "postgres: writer process   " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
             ├─ 6302 "postgres: wal writer process   " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""
             ├─ 6303 "postgres: autovacuum launcher process   " "" "" "" "" "" "" "" ""
             └─ 6304 "postgres: stats collector process   " "" "" "" "" "" "" "" "" "" "" "" ""

мар 05 17:15:02 boyishjeans systemd[1]: Starting PostgreSQL database server...
мар 05 17:15:02 boyishjeans pg_ctl[6299]: СООБЩЕНИЕ:  система БД была выключена: 2023-03-05 17:13:06 MSK
мар 05 17:15:02 boyishjeans pg_ctl[6299]: СООБЩЕНИЕ:  Защита от зацикливания мультитранзакций сейчас включена
мар 05 17:15:02 boyishjeans pg_ctl[6298]: СООБЩЕНИЕ:  система БД готова принимать подключения
мар 05 17:15:02 boyishjeans pg_ctl[6303]: СООБЩЕНИЕ:  процесс запуска автоочистки создан
мар 05 17:15:03 boyishjeans systemd[1]: Started PostgreSQL database server.
[user1@boyishjeans ~]$
спасибо!

Оффлайн Skull

  • Глобальный модератор
  • *****
  • Сообщений: 20 168
    • Домашняя страница
Андрей Черепанов (cas@)