Power & Source of Big Ideas

Postgresql NanoPIM4V2 FriendlyDesktop 18.04 for RK3399

Moderators: chensy, FATechsupport

Hi!
Can anyone help me run Postgresql database server?
I tried to reinstall it several times, but it doesn't work.

Code: Select all

pi@NanoPi-M4v2:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic

pi@NanoPi-M4v2:~$ psql -V
psql (PostgreSQL) 10.14 (Ubuntu 10.14-0ubuntu0.18.04.1)

pi@NanoPi-M4v2:~$ sudo dpkg -l | egrep postgre
ii  postgresql-10                          10.14-0ubuntu0.18.04.1                arm64        object-relational SQL database, version 10 server
ii  postgresql-client-10                   10.14-0ubuntu0.18.04.1                arm64        front-end programs for PostgreSQL 10
ii  postgresql-client-common               190ubuntu0.1                          all          manager for multiple PostgreSQL client versions
ii  postgresql-common                      190ubuntu0.1                          all          PostgreSQL database-cluster manager

pi@NanoPi-M4v2:~$ ps -ef | grep postgres
pi       23090 22839  0 22:34 pts/0    00:00:00 grep --color=auto postgres

pi@NanoPi-M4v2:~$ /etc/init.d/postgresql restart
[....] Restarting postgresql (via systemctl): postgresql.service==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Чтобы перезапустить «postgresql.service», необходимо пройти аутентификацию.
Authenticating as: pi
Password:
==== AUTHENTICATION COMPLETE ===
. ok

pi@NanoPi-M4v2:~$ /etc/init.d/postgresql status
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since Sat 2020-09-19 22:36:46 MSK; 4min 49s ago
  Process: 24082 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 24082 (code=exited, status=0/SUCCESS)

pi@NanoPi-M4v2:~$ sudo systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor prese
   Active: active (exited) since Sat 2020-09-19 22:36:46 MSK; 14min ago
  Process: 24082 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 24082 (code=exited, status=0/SUCCESS)

Sep 19 22:36:46 NanoPi-M4v2 systemd[1]: Stopping PostgreSQL RDBMS...
Sep 19 22:36:46 NanoPi-M4v2 systemd[1]: Starting PostgreSQL RDBMS...
Sep 19 22:36:46 NanoPi-M4v2 systemd[1]: Started PostgreSQL RDBMS.

pi@NanoPi-M4v2:/etc/init.d$ sudo -i -u postgres
postgres@NanoPi-M4v2:~$ psql
psql: could not connect to server: Нет такого файла или каталога
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?


/var/run/postgresql - Empty Directory
/var/lib/postgresql - Empty Directory

How to start it properly?
A few things to check:

1 - Did postgres install initialize the db cluster?
2 - You may be missing some dependencies?
3 - Check the logfile for any clue
4 - Do you have enough free space?

1 - I usually build and run PostgreSQL 9.x from source but I think this is valid for newer versions.
Find where the db cluster has been initialized and if really was

sudo find / -name pg_hba.conf

Check user and file permissions in this directory.

2 - If for any reason you broke dependencies, the postmaster will not run.

sudo find / -name pg_ctl
sudo ldd path_to_your_postgresql_version/pg_ctl

3 - Postgresql writes the file 'logfile' , if you could run it, obviously.

sudo find / -name logfile

4 - Enough space?

try to run:

pg_ctl -D $PGDATA start

and check the messages

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 4 guests