V
V
vlarkanov2018-06-15 10:30:17
PostgreSQL
vlarkanov, 2018-06-15 10:30:17

Why won't postgres 9.6 start?

Hello! There is a postgres server. I configure its slave. The master server is configured according to https://romantelychko.com/blog/1583/
After I merged the streaming backup to the slave and set the rights to the folder, I try to start it. Here is what he writes:


2018-06-15 10:26:08.026 MSK [ 725] MESSAGE: REDO entry starts at offset 4A4/EA48450 : incomplete starter pack
2018-06-15 10:26:08.068 MSK [725] MESSAGE: Consistent recovery state reached at offset 4A4/ED9EAB8
2018-06-15 10:26:08.069 MSK [725] MESSAGE: invalid magic number 0000 in log segment 00000002000004A40000000E, offset 14417920
2018-06-15 10:26:08.123 MSK [729] MESSAGE: Beginning of log transfer from master, at position 4A4/E000000 on timeline 2
2018-06-15 10:26:08.550 MSK [ 732] [email protected] IMPORTANT: database system is starting
2018-06-15 10:26:09.060 MSK [735] [email protected] IMPORTANT: database system is starting
2018-06-15 10:26:09.572 MSK [738] [email protected] IMPORTANT: database system starts
2018-06-15 10:26:10.086 MSK [741] [email protected] IMPORTANT: database system starts
2018-06- 15 10:26:10.598 MSK [744] [email protected] IMPORTANT: database system starts
2018-06-15 10:26:11.108 MSK [747] [email protected] IMPORTANT: database system starts
2018-06-15 10:26 :11.622 MSK [750] [email protected] IMPORTANT: database system starts
2018-06-15 10:26:12.135 MSK [753] [email protected] IMPORTANT: database system starts
2018-06-15 10:26:12.647 MSK [ 756] [email protected] IMPORTANT: database system is starting
2018-06-15 10:26:13.161 MSK [761] [email protected] IMPORTANT: database system is starting
2018-06-15 10:26:13.674 MSK [764] [email protected] IMPORTANT: database system starting
2018-06-15 10:26:13.678 MSK [724] MESSAGE: Polite shutdown request received
2018-06- 15 10:26:13.678 MSK [729] IMPORTANT: End of log reading process by admin
command 2018-06-15 10:26:13.682 MSK [726] MESSAGE: Shutdown
2018-06-15 10:26:16.706 MSK [724] MESSAGE: DB system shut down

How to understand what Postgres doesn't like?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ka7a8, 2018-09-07
@vlarkanov

It happens that after a power outage on Linux servers with 1C, nothing starts at all. The postgres database is broken and the 1C cache too. Here are the steps to get everything up and running again.
1. Run postgres in a single mode from the postgres user so that systemd does not kill him by timeout

[email protected]:~# su postgres
[email protected]:~$ /usr/lib/postgresql/9.6/bin/postgres --single -c config_file=/etc/postgresql/9.6/main/postgresql.conf -D /var/lib/postgresql/9.6/main -P -d 1
2018-09-07 09:23:27.289 MSK [3421] DEBUG:  запись о контрольной точке по смещению 23/36889418
2018-09-07 09:23:27.294 MSK [3421] DEBUG:  redo record is at 23/3674B6A8; shutdown FALSE
2018-09-07 09:23:27.294 MSK [3421] DEBUG:  next transaction ID: 0:18537840; next OID: 13492030
2018-09-07 09:23:27.294 MSK [3421] DEBUG:  next MultiXactId: 1; next MultiXactOffset: 0
2018-09-07 09:23:27.294 MSK [3421] DEBUG:  oldest unfrozen transaction ID: 545, in database 1
2018-09-07 09:23:27.294 MSK [3421] DEBUG:  oldest MultiXactId: 1, in database 1
2018-09-07 09:23:27.294 MSK [3421] DEBUG:  commit timestamp Xid oldest/newest: 0/0
2018-09-07 09:23:27.294 MSK [3421] DEBUG:  предел наложения ID транзакций равен 2147484192, источник ограничения - база данных с OID 1
2018-09-07 09:23:27.294 MSK [3421] DEBUG:  предел наложения MultiXactId равен 2147483648, источник ограничения - база данных с OID 1
2018-09-07 09:23:27.294 MSK [3421] DEBUG:  starting up replication slots
2018-09-07 09:23:27.294 MSK [3421] LOG:  система БД была остановлена нештатно; производится автоматическое восстановление
2018-09-07 09:23:27.298 MSK [3421] DEBUG:  resetting unlogged relations: cleanup 1 init 0
2018-09-07 09:23:27.507 MSK [3421] LOG:  запись REDO начинается со смещения 23/3674B6A8
2018-09-07 09:23:27.515 MSK [3421] LOG:  invalid record length at 23/368B5C50: wanted 24, got 0
2018-09-07 09:23:27.515 MSK [3421] LOG:  записи REDO обработаны до смещения 23/368B5C28
2018-09-07 09:23:27.515 MSK [3421] LOG:  последняя завершённая транзакция была выполнена в 2018-09-06 20:47:59.49413+03
2018-09-07 09:23:27.515 MSK [3421] DEBUG:  resetting unlogged relations: cleanup 0 init 1
2018-09-07 09:23:27.941 MSK [3421] DEBUG:  performing replication slot checkpoint
2018-09-07 09:23:27.985 MSK [3421] DEBUG:  предел наложения MultiXactId равен 2147483648, источник ограничения - база данных с OID 1
2018-09-07 09:23:27.985 MSK [3421] DEBUG:  Граница членов мультитранзакции сейчас: 4294914944 (при старейшей мультитранзакции 1)

PostgreSQL stand-alone backend 9.6.8
backend>

After that, you can stop postgres with a normal exit code and start it in normal mode
[email protected]:/home/usr1cv8# kill -15 #ваш_пид_процесса
[email protected]:/home/usr1cv8# /etc/init.d/postgresql start
[ ok ] Starting postgresql (via systemctl): postgresql.service.

2. We stop the unusable 1C and clean its cache and configuration files and start again
[email protected]:~# /etc/init.d/srv1cv83 stop
[email protected]:~# rm -rf /home/usr1cv8/.1cv8
[email protected]:~# /etc/init.d/srv1cv83 start

3. We start RAS and add the databases that we had on the 1C server
[email protected]:~# /opt/1C/v8.3/x86_64/ras --daemon cluster
[email protected]:~# /opt/1C/v8.3/x86_64/rac cluster list
cluster                       : 583eba18-b263-11e8-ed9e-309c239dab48
host                          : 1cserver
port                          : 1541
name                          : "Локальный кластер"
expiration-timeout            : 0
lifetime-limit                : 0
max-memory-size               : 0
max-memory-time-limit         : 0
security-level                : 0
session-fault-tolerance-level : 0
load-balancing-mode           : performance
errors-count-threshold        : 0
kill-problem-processes        : 0
[email protected]:~# /opt/1C/v8.3/x86_64/rac infobase create --cluster=583eba18-b263-11e8-ed9e-309c239dab48 --name=our_1c_db --dbms=PostgreSQL --db-server=1cserver --db-name=our_1c_db --locale=ru --db-user=postgres --db-pwd=our_postgres_db_password

и так далее для каждой базы 1С что были на сервере

Enjoy life :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question