PostgreSQL을 시작할 수 없습니다

PostgreSQL을 시작할 수 없습니다

시작하려고 할 때마다 postgresql실패합니다. 저는 칼리 넷헌터(Kali NetHunter)를 실행하고 있습니다.

이것은 내 터미널 출력입니다

root@kali:~# service postgresql start
[....] Starting PostgreSQL 10 database server: main[....] Error: /usr/lib/postgresql/10/bin/pg_ctl /usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main -l /var/log/postgresql/postgresql-10-main.log -s -o -c config_file="/etc/postgresql/10/main/postgresql.conf" exited with status 1: 2018-02-07 09:29:59.653 UTC 0 LOG: listening on IPv6 address "::1", port 5432 2018-02-07 09:29:59.653 UTC 0 LOG: listening on IPv4 address "127.0.0.1", port 5432 2018-02-07 09:29:59.654 UTC 0 LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2018-02-07 09:29:59.656 UTC 0 FATAL: could not create shared memory segment: Function not implemented 2018-02-07 09:29:59.656 UTC 0 DETAIL: Failed system call was shmget(key=5432001, size=40, 03600). 2018-02-07 09:29:59.656 UTC 0 LOG: database system is shut down pg_ctl: could not start [FAILr Examine the log output. ... failed!
 failed!

이것은 로그 파일입니다

2018-02-06 16:31:36.775 UTC [6358] LOG:  listening on IPv6 address "::1", port 5432
2018-02-06 16:31:36.775 UTC [6358] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-06 16:31:36.783 UTC [6358] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-06 16:31:36.785 UTC [6358] FATAL:  could not create shared memory segment: Function not implemented
2018-02-06 16:31:36.785 UTC [6358] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-06 16:31:36.785 UTC [6358] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-06 16:57:52.984 UTC [8837] LOG:  listening on IPv6 address "::1", port 5432
2018-02-06 16:57:52.984 UTC [8837] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-06 16:57:52.985 UTC [8837] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-06 16:57:52.988 UTC [8837] FATAL:  could not create shared memory segment: Function not implemented
2018-02-06 16:57:52.988 UTC [8837] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-06 16:57:52.988 UTC [8837] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-06 16:57:53.693 UTC [8875] LOG:  listening on IPv6 address "::1", port 5432
2018-02-06 16:57:53.693 UTC [8875] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-06 16:57:53.694 UTC [8875] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-06 16:57:53.695 UTC [8875] FATAL:  could not create shared memory segment: Function not implemented
2018-02-06 16:57:53.695 UTC [8875] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-06 16:57:53.696 UTC [8875] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-07 02:57:25.787 UTC [15672] LOG:  listening on IPv6 address "::1", port 5432
2018-02-07 02:57:25.788 UTC [15672] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-07 02:57:25.788 UTC [15672] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-07 02:57:25.790 UTC [15672] FATAL:  could not create shared memory segment: Function not implemented
2018-02-07 02:57:25.790 UTC [15672] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-07 02:57:25.791 UTC [15672] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-07 03:13:39.986 UTC [17336] LOG:  listening on IPv6 address "::1", port 5432
2018-02-07 03:13:39.987 UTC [17336] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-07 03:13:39.988 UTC [17336] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-07 03:13:39.989 UTC [17336] FATAL:  could not create shared memory segment: Function not implemented
2018-02-07 03:13:39.989 UTC [17336] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-07 03:13:39.989 UTC [17336] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-07 06:26:52.218 UTC [32350] LOG:  listening on IPv6 address "::1", port 5432
2018-02-07 06:26:52.219 UTC [32350] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-07 06:26:52.219 UTC [32350] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-07 06:26:52.221 UTC [32350] FATAL:  could not create shared memory segment: Function not implemented
2018-02-07 06:26:52.221 UTC [32350] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-07 06:26:52.222 UTC [32350] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.
2018-02-07 09:29:59.653 UTC [10136] LOG:  listening on IPv6 address "::1", port 5432
2018-02-07 09:29:59.653 UTC [10136] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2018-02-07 09:29:59.654 UTC [10136] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-02-07 09:29:59.656 UTC [10136] FATAL:  could not create shared memory segment: Function not implemented
2018-02-07 09:29:59.656 UTC [10136] DETAIL:  Failed system call was shmget(key=5432001, size=40, 03600).
2018-02-07 09:29:59.656 UTC [10136] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.

답변1

postgresql오류 상태와 같이 충분히 큰 공유 메모리 세그먼트를 생성할 수 없기 때문에 시작되지 않습니다.

could not create shared memory segment: Function not implemented
Failed system call was shmget

이 문제를 해결하려면 다음을 수행하십시오.

sudo sysctl -w kernel.shmmax=134217728

재부팅 후 영구적으로 설정하려면 /etc/sysctl.conf다음을 편집하고 추가하십시오 kernel.shmmax = 134217728.

sudo vi /etc/sysctl.conf
kernel.shmmax = 134217728

업데이트된 답변:

OP 도움말로 디버깅:

sudo sysctl -w kernel.shmmax=134217728 sysctl: cannot stat /proc/sys/kernel/shmmax: No such file or directory

Kali NetHunter가 Android 기기에서 사용 가능한 점을 고려하면 가장 정확하고 명확한 대답은 shmem이 커널 버전에서는 지원이 컴파일되지 않는다는 것입니다.

이는 또한 shmem.Apache

아쉽게도 Android와 유사한 장치에서 postgresql 데이터베이스를 실행하는 것도 그다지 의미가 없을 것입니다.

그럼에도 불구하고 한 가지 가능성은 shmem을 지원하는 다른 커널 패키지(존재하는 경우)를 찾거나 극단적인 경우 커널을 크로스 컴파일하는 것입니다. 물론 장치의 디스크 및/또는 메모리가 매우 부족한 경우 이 경로를 고려해서는 안 됩니다.

관련 정보