Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTtJD-00067I-4I for pgsql-general@arkaria.postgresql.org; Tue, 26 Dec 2017 17:46:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTtJC-0000J8-Ic for pgsql-general@arkaria.postgresql.org; Tue, 26 Dec 2017 17:46:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eTtJC-0000Io-8J for pgsql-general@lists.postgresql.org; Tue, 26 Dec 2017 17:46:34 +0000 Received: from server5.simfrete.com ([177.52.183.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eTtJ8-0002SP-El for pgsql-general@lists.postgresql.org; Tue, 26 Dec 2017 17:46:32 +0000 Received: from [192.168.10.30] (unknown [177.52.183.17]) by server5.simfrete.com (Postfix) with ESMTPSA id CA5D624AB4A for ; Tue, 26 Dec 2017 15:49:34 -0200 (-02) Subject: Re: Does PostgreSQL check database integrity at startup? To: pgsql-general@lists.postgresql.org References: <20171226171327.437beyi2dnndslwl@alvherre.pgsql> From: Edson Carlos Ericksson Richter Message-ID: <7a6d1d6d-3627-c68c-1ce1-b681a7062930@simkorp.com.br> Date: Tue, 26 Dec 2017 15:46:26 -0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171226171327.437beyi2dnndslwl@alvherre.pgsql> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: pt-BR List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Em 26/12/2017 15:13, Alvaro Herrera escreveu: > Edson Carlos Ericksson Richter wrote: > >> I'm rebuilding the standby server for two days already, with 23% of >> completion status... > So how do you build your standbys, exactly? Maybe there's a bug in your > procedure, rather than a bug in the software. > Usually, or by "pg_basebackup" or by "rsync" as described in PostgreSQL Wiki. Right now, I'm doing via pg_basebackup. Nothing extraordinary. When using rsync: rsync -e "ssh -2 -C -p slave_ssh_port" --progress --partial -az /pgsql/9.6/master_data_folder/* superuser_name@$slave_host:/home/pgsql/9.6/slave_data_folder/ --exclude postmaster.pid --exclude postgresql.conf --exclude pg_log When using pg_basebackup: /usr/pgsql-9.6/bin/pg_basebackup -h master_host -p master_port -D /home/pgsql/9.6/master_data_folder -R -S slot_name -X stream -P -d " user=superuser_name password=superuser_pass sslmode=require " Of course, this is inside a bash script with variables at right places to make script generic as needed to make it works with dozens of databases... Regards, Edson