Re: 'replication checkpoint has wrong magic' on the newly cloned replicas

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: 'replication checkpoint has wrong magic' on the newly cloned replicas
Дата
Msg-id CAOuzzgq+pq=JfXSEhxkVRdGtw6PRqqEPnRptOic0kcfx5pL+Yg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: 'replication checkpoint has wrong magic' on the newly cloned replicas  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-admin
Greetings, On Wed, Nov 29, 2017 at 12:52 Stephen Frost wrote: > Greetings, > > On Wed, Nov 29, 2017 at 12:41 Oleksii Kliukin > wrote: > >> Hi Stephen, >> >> > On 29. Nov 2017, at 15:54, Stephen Frost wrote: >> > >> > Greetings, >> > >> > * Alex Kliukin (alexk@hintbits.com) wrote: >> >> The cloning itself is done by copying a compressed image via ssh, >> >> running the >> >> following command from the replica: >> >> >> >> """ssh {master} 'cd {master_datadir} && tar -lcp --exclude "*.conf" \ >> >> --exclude "recovery.done" \ >> >> --exclude "pacemaker_instanz" \ >> >> --exclude "dont_start" \ >> >> --exclude "pg_log" \ >> >> --exclude "pg_xlog" \ >> >> --exclude "postmaster.pid" \ >> >> --exclude "recovery.done" \ >> >> * | pigz -1 -p 4' | pigz -d -p 4 | tar -xpmUv -C >> >> {slave_datadir}"" >> >> >> >> The WAL archiving starts before the copy starts, as the script that >> >> clones the >> >> replica checks that the WALs archiving is running before the cloning. >> > >> > Maybe you've doing it and haven't mentioned it, but you have to use >> > pg_start/stop_backup >> >> Sorry for not mentioning it, as it seemed obvious, but we are calling >> pg_start_backup and pg_stop_backup at the right time. > > > Ah, not something I can assume, heh. > > Then it depends on which version of PG and if you’re able to run > start/stop on the replica or not. If you can’t run it on the replica and > have to run it on the primary (prior to 9.6) then you need to make sure to > wait for things to happen on the primary and for that to be replicated > before you can start. > > If you’re on 9.6 and using non-exclusive backup, you need to be sure to > capture the contents of the stop backup and write it into backup_label > before you start the system back up. > > This is off the top of my head, so be sure to go double check the docs, of > course. > Oh, and you also need to make sure to copy pg_control last when you’re doing a non-exclusive backup on a replica, which should also be covered in the docs. Even so though, really, I’d recommend you consider using one of the existing tools that knows about how to do all of this correctly.. Thanks! Stephen >

В списке pgsql-admin по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: 'replication checkpoint has wrong magic' on the newly cloned replicas
Следующее
От: Alex Kliukin
Дата:
Сообщение: Re: 'replication checkpoint has wrong magic' on the newly clonedreplicas