Я запускаю Postgres v10.3 через Docker (в частности, docker-compose).Это не включается снова.Когда я пытаюсь включить его, я получаю следующее сообщение об ошибке:
postgres | pg_ctl: another server might be running; trying to start server anyway
postgres | waiting for server to start....2018-05-15 12:37:07.552 UTC [22] LOG: listening on IPv4 address "127.0.0.1", port 5432
postgres | 2018-05-15 12:37:07.552 UTC [22] LOG: could not bind IPv6 address "::1": Address not available
postgres | 2018-05-15 12:37:07.552 UTC [22] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
postgres | 2018-05-15 12:37:07.558 UTC [22] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres | 2018-05-15 12:37:07.804 UTC [23] LOG: database system was interrupted while in recovery at 2018-05-15 12:35:58 UTC
postgres | 2018-05-15 12:37:07.804 UTC [23] HINT: This probably means that some data is corrupted and you will have to use the last backup for recovery.
postgres | .........2018-05-15 12:37:17.735 UTC [23] LOG: database system was not properly shut down; automatic recovery in progress
postgres | .2018-05-15 12:37:17.935 UTC [23] LOG: redo starts at 1/5E964BA8
postgres | pg_ctl: server did not start in time
postgres | ................................................. stopped waiting
Возможно, во время записи в базу данных я мог закрыть базу данных, и это единственное, о чем я мог подумать.этот.У меня нет резервной копии, поэтому я хотел бы восстановить то, что я уже сделал (за исключением таблицы, в которую я писал при закрытии).
Вещи, которые я пробовал:
При запуске в single_user_mode
с дополнительным ведением журнала я получаю
/ $ postgres --single -D /var/lib/postgresql/data/pgdata -P -d 5
2018-05-15 15:16:09.978 UTC [12] DEBUG: invoking IpcMemoryCreate(size=148537344)
2018-05-15 15:16:09.978 UTC [12] DEBUG: mmap(148897792) with MAP_HUGETLB failed, huge pages disabled: Out of memory
2018-05-15 15:16:09.999 UTC [12] DEBUG: SlruScanDirectory invoking callback on pg_notify/0000
2018-05-15 15:16:09.999 UTC [12] DEBUG: removing file "pg_notify/0000"
2018-05-15 15:16:10.005 UTC [12] DEBUG: dynamic shared memory system will support 288 segments
2018-05-15 15:16:10.005 UTC [12] DEBUG: created dynamic shared memory control segment 262836907 (6928 bytes)
2018-05-15 15:16:10.005 UTC [12] DEBUG: InitPostgres
2018-05-15 15:16:10.005 UTC [12] DEBUG: my backend ID is 1
2018-05-15 15:16:10.010 UTC [12] LOG: database system was shut down in recovery at 2018-05-15 15:16:04 UTC
2018-05-15 15:16:10.014 UTC [12] DEBUG: checkpoint record is at 1/64CA6F18
2018-05-15 15:16:10.025 UTC [12] DEBUG: redo record is at 1/5E964BA8; shutdown FALSE
2018-05-15 15:16:10.025 UTC [12] DEBUG: next transaction ID: 0:681710; next OID: 311511
2018-05-15 15:16:10.025 UTC [12] DEBUG: next MultiXactId: 155; next MultiXactOffset: 312
2018-05-15 15:16:10.025 UTC [12] DEBUG: oldest unfrozen transaction ID: 547, in database 1
2018-05-15 15:16:10.025 UTC [12] DEBUG: oldest MultiXactId: 1, in database 1
2018-05-15 15:16:10.025 UTC [12] DEBUG: commit timestamp Xid oldest/newest: 0/0
2018-05-15 15:16:10.025 UTC [12] DEBUG: transaction ID wrap limit is 2147484194, limited by database with OID 1
2018-05-15 15:16:10.025 UTC [12] DEBUG: MultiXactId wrap limit is 2147483648, limited by database with OID 1
2018-05-15 15:16:10.025 UTC [12] DEBUG: starting up replication slots
2018-05-15 15:16:10.028 UTC [12] DEBUG: starting up replication origin progress state
2018-05-15 15:16:10.031 UTC [12] LOG: database system was not properly shut down; automatic recovery in progress
2018-05-15 15:16:10.037 UTC [12] DEBUG: resetting unlogged relations: cleanup 1 init 0
2018-05-15 15:16:10.334 UTC [12] LOG: redo starts at 1/5E964BA8
Мой dockerfile расширяет этот файл: https://github.com/docker-library/postgres/blob/fe8c9a4a309a889dc057d53bf3769c25c1522c65/10/alpine/Dockerfile
И точка входа изменяется наэто: https://github.com/docker-library/postgres/blob/fe8c9a4a309a889dc057d53bf3769c25c1522c65/10/alpine/docker-entrypoint.sh
А вот ifconfig
:
MacBook-Pro:backend zebrainatree$ docker-compose demo run postgres ifconfig -a
eth0 Link encap:Ethernet HWaddr 02:42:AC:12:00:03
inet addr:172.18.0.3 Bcast:172.18.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:90 (90.0 B) TX bytes:0 (0.0 B)
ip6tnl0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:1452 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
tunl0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-10-8B-00-00-00-00-00-00-00-00
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)