Re: Acúmulo de Wal no servidor Master

Fabrízio de Royes Mello <fabrizio-hNsCO/[email protected]> Wed, 4 Apr 2018 10:51:20 -0300
Newsgroups gmane.comp.db.postgresql.brasil
Message-ID <CAPfkCSA4i6PjuP1uz25wLOyVUAAChNA+CX8vFbneXd8rzuWv+A__10111.373946029$1522849764$gmane$org@mail.gmail.com>
--===============0885337350903719531==
Content-Type: multipart/alternative; boundary="089e082ebbf833ed0e0569061e82"

--089e082ebbf833ed0e0569061e82
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Em 4 de abril de 2018 09:37, Cleiton Luiz Domazak <[email protected]=
>
escreveu:
>
>
> 2018-04-04 9:14 GMT-03:00 Felippi Cunegundes Laender <
[email protected]>:
>>
>> Ol=C3=A1 a todos.
>>
>> O Assunto wal me deixa um pouco confuso as vezes. Quando acho que estou
entendendo alguma coisa, vem os problemas e pronto, n=C3=A3o entendi nada d=
o que
estudei.
>>
>> Meu cen=C3=A1rio =C3=A9 o seguinte: Fiz uma replica=C3=A7=C3=A3o com rep=
mgr para testar e
funcionou beleza. Ap=C3=B3s meus testes de tornar master em standby, standb=
y em
master, etc exclu=C3=AD o servidor de standby mantendo as configura=C3=A7=
=C3=B5es de
replica=C3=A7=C3=A3o no master.
>>
>> Sobre o postgresql.conf no per=C3=ADodo de replica=C3=A7=C3=A3o o archiv=
e_mode =3D on e o
archive_command =3D '/bin/true'. wal_keep_segments =3D 100. Ap=C3=B3s ver q=
ue meu
/var estava pr=C3=B3ximo ao estouro, diminu=C3=AD meu wal_keep_segments =3D=
 10, nada
alterou.
>>
>> Gostaria de saber se tem algum modo efetivo, mais elegante de excluir
esses arquivos wal. A =C3=BAnica op=C3=A7=C3=A3o na minha mente =C3=A9 um r=
m -r nos arquivos
mantendo apenas dois =C3=BAltimos dias.
>
>
> Siga esse procedimento, s=C3=B3 tome cuidado para n=C3=A3o inverter os va=
lores :)
>
>
https://erpnani.blogspot.com.br/2016/01/postgresql-how-to-clean-pgxlog.html

Muito cuidado com a recomenda=C3=A7=C3=A3o desse post, pois o pg_resetxlog =
deve ser
utilizado em =C3=BAltimo caso, inclusive a documenta=C3=A7=C3=A3o oficial c=
ita o que segue
no primeiro par=C3=A1grafo:

"pg_resetxlog clears the write-ahead log (WAL) and optionally resets some
other control information stored in the pg_control file. This function is
sometimes needed if these files have become corrupted. It should be used
only as a last resort, when the server will not start due to such
corruption."

Vide: https://www.postgresql.org/docs/9.4/static/app-pgresetxlog.html

Att,
--
   Fabr=C3=ADzio de Royes Mello         Timbira - http://www.timbira.com.br=
/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

--089e082ebbf833ed0e0569061e82
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br>Em 4 de abril de 2018 09:37, Cleiton Luiz Domazak &lt;=
<a href=3D"mailto:[email protected]">[email protected]</a>&gt=
; escreveu:<br>&gt;<br>&gt;<br>&gt; 2018-04-04 9:14 GMT-03:00 Felippi Cuneg=
undes Laender &lt;<a href=3D"mailto:[email protected]">felippilaende=
[email protected]</a>&gt;:<br>&gt;&gt;<br>&gt;&gt; Ol=C3=A1 a todos.<br>&gt;&gt;<=
br>&gt;&gt; O Assunto wal me deixa um pouco confuso as vezes. Quando acho q=
ue estou entendendo alguma coisa, vem os problemas e pronto, n=C3=A3o enten=
di nada do que estudei.<br>&gt;&gt;<br>&gt;&gt; Meu cen=C3=A1rio =C3=A9 o s=
eguinte: Fiz uma replica=C3=A7=C3=A3o com repmgr para testar e funcionou be=
leza. Ap=C3=B3s meus testes de tornar master em standby, standby em master,=
 etc exclu=C3=AD o servidor de standby mantendo as configura=C3=A7=C3=B5es =
de replica=C3=A7=C3=A3o no master.<br>&gt;&gt;<br>&gt;&gt; Sobre o postgres=
ql.conf no per=C3=ADodo de replica=C3=A7=C3=A3o o archive_mode =3D on e o a=
rchive_command =3D &#39;/bin/true&#39;. wal_keep_segments =3D 100. Ap=C3=B3=
s ver que meu /var estava pr=C3=B3ximo ao estouro, diminu=C3=AD meu wal_kee=
p_segments =3D 10, nada alterou.<br>&gt;&gt;<br>&gt;&gt; Gostaria de saber =
se tem algum modo efetivo, mais elegante de excluir esses arquivos wal. A =
=C3=BAnica op=C3=A7=C3=A3o na minha mente =C3=A9 um rm -r nos arquivos mant=
endo apenas dois =C3=BAltimos dias.<br>&gt;<br>&gt;<br>&gt; Siga esse proce=
dimento, s=C3=B3 tome cuidado para n=C3=A3o inverter os valores :)<br>&gt;<=
br>&gt; <a href=3D"https://erpnani.blogspot.com.br/2016/01/postgresql-how-t=
o-clean-pgxlog.html">https://erpnani.blogspot.com.br/2016/01/postgresql-how=
-to-clean-pgxlog.html</a> <br><div><br>Muito cuidado com a recomenda=C3=A7=
=C3=A3o desse post, pois o pg_resetxlog deve ser utilizado em =C3=BAltimo c=
aso, inclusive a documenta=C3=A7=C3=A3o oficial cita o que segue no primeir=
o par=C3=A1grafo:<br><br>&quot;pg_resetxlog clears the write-ahead log (WAL=
) and optionally resets some other control information stored in the pg_con=
trol file. This function is sometimes needed if these files have become cor=
rupted. It should be used only as a last resort, when the server will not s=
tart due to such corruption.&quot;<br><br>Vide: <a href=3D"https://www.post=
gresql.org/docs/9.4/static/app-pgresetxlog.html">https://www.postgresql.org=
/docs/9.4/static/app-pgresetxlog.html</a><br><br>Att,<br>--<br>=C2=A0 =C2=
=A0Fabr=C3=ADzio de Royes Mello =C2=A0 =C2=A0 =C2=A0 =C2=A0 Timbira - <a hr=
ef=3D"http://www.timbira.com.br/">http://www.timbira.com.br/</a><br>=C2=A0 =
=C2=A0PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento<=
/div></div>

--089e082ebbf833ed0e0569061e82--

--===============0885337350903719531==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KcGdici1nZXJh
bCBtYWlsaW5nIGxpc3QKcGdici1nZXJhbEBsaXN0YXMucG9zdGdyZXNxbC5vcmcuYnIKaHR0cHM6
Ly9saXN0YXMucG9zdGdyZXNxbC5vcmcuYnIvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL3BnYnIt
Z2VyYWw=

--===============0885337350903719531==--