Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YVlYW-00057K-Po for pgsql-admin@arkaria.postgresql.org; Wed, 11 Mar 2015 18:40:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YVlYW-0001aj-83 for pgsql-admin@arkaria.postgresql.org; Wed, 11 Mar 2015 18:40:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YVlYV-0001ad-GE for pgsql-admin@postgresql.org; Wed, 11 Mar 2015 18:40:31 +0000 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YVlYR-000071-IK for pgsql-admin@postgresql.org; Wed, 11 Mar 2015 18:40:30 +0000 Received: by widem10 with SMTP id em10so14232681wid.2 for ; Wed, 11 Mar 2015 11:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:reply-to:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; bh=SrAqmpf43QO6O3Gxnc0JLHvgWttIuXQftKprfK7C5Io=; b=N6j6aM14xv9Effxi/aQp40Xalg2QGw0ADzHAjiNeyYO+2SBBbr+es3IWA46ENwnaCr GwlbFPCe5MgczFtHEoz8r8sQWdg4iD8jk51jaSQLiDORF6K0usFf64gl0U7VjDZ8rLwT gQIrbIUwL1TgDZERmk8tGriDOQuaQt0uBmzM9r0YTMcJBTLZpZk8wQVsZKqnJIPklPmH Gv4a9cifiBsZbBCXGLDxlctqXoDEh5Obd8ff4n2b4UlI2Gw8u5mROQoyTaUi1AqmxMLs GAwVm3m//U1f3gQtDKjI51X2bJGuiCL0Z/HDma8EfRx8PuLINjklI3gj3a7HWNoXVbDT wnyA== X-Received: by 10.194.175.202 with SMTP id cc10mr80386454wjc.27.1426099225653; Wed, 11 Mar 2015 11:40:25 -0700 (PDT) Received: from enterprisedb01 (84.125.177.156.dyn.user.ono.com. [84.125.177.156]) by mx.google.com with ESMTPSA id pa4sm6582536wjb.11.2015.03.11.11.40.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 11:40:24 -0700 (PDT) Message-ID: <1426099223.6353.19.camel@gmail.com> Subject: Re: Relocated Postgres From: jaime soler Reply-To: jaime.soler@gmail.com To: "Rossi, Maria" Cc: "'pgsql-admin@postgresql.org'" Date: Wed, 11 Mar 2015 19:40:23 +0100 In-Reply-To: <33A4D5087BF0D44DA69C5EEF666BC1D74250E927@usprmbp01c> References: <33A4D5087BF0D44DA69C5EEF666BC1D742507AD2@usprmbp01c> <1426091712.6353.4.camel@gmail.com> <33A4D5087BF0D44DA69C5EEF666BC1D74250E927@usprmbp01c> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org El mié, 11-03-2015 a las 17:33 +0000, Rossi, Maria escribió: > Jaime, > > Yes, I stopped the instance before the copy. Here's the archive at the postgressql.conf: > > archive_mode = on # allows archiving to be done > archive_command = 'cp -i "%p" /dba/psg/gs07/pg_tranlog/pg_archlog/"%f"' I recommend you to avoid using modifier -i of cp command, because it will ask you if you want to overwrite a file (interactive mode inside a script ?) and although the file isn't overwriten cp returns with 0 exit code, and it means than archiver process has properly archived 00000001000000000000004C and that is false. why are you using double quotes on %p and %f? > > > Also, Here’s how I relocated. > 1) Shutdown postgres > 2) Copied pg_data to another directory > 3) Copied pg_xlog to yet another directory (we wanted to put the pg_data and tranlog in separate directories) > 4) At the new pg_data directory, create symbolic link > ln -s /dba/pgsql /gs07/pg_tranlog/pg_xlog pg_xlog (this is where my problem started, I had it pointing to the old location) I don't understand why are you using this command with threes arguments, I have never used before. But It seems that symbolic links weren't created correctly. The wal file: 00000001000000000000004C already exists in pg_xlog and maybe you're pointing pg_archlog to pg_xlog directory and this is why archive_command throwed errors. > 5) Updated postgressql.conf for the new location (unaware that my symbolic link was pointing to the old location) > 6) Start postgres > > So any logs went to the old location. > > Thanks/ Regards, Jaime > > Maria A Rossi > Database Administration > PGDS (US) > email: maria.rossi@us.pgds.com > cell phone: 517.256.4392 > work phone: 517.367.3099 > work phone extension: 23099 > > -----Original Message----- > From: jaime soler [mailto:jaime.soler@gmail.com] > Sent: Wednesday, March 11, 2015 12:35 PM > To: Rossi, Maria > Cc: 'pgsql-admin@postgresql.org' > Subject: Re: [ADMIN] Relocated Postgres > > El mié, 11-03-2015 a las 01:02 +0000, Rossi, Maria escribió: > > HI, > > > > Hi, > > > > > > I relocated an postgres instance. The pg_data, pg_tranlog, > > pg_hba.conf, etc were copied to new directories. > > did you stop the instance, before start the copy ? > > Then, I updated the postgresql.conf accordingly. Postgres started > > ok, and I can connect. However when I stopped it, the following msg > > appeared at the errorlog: > > > > > > > > cp: overwrite > > `/dba/psg/gs07/pg_tranlog/pg_archlog/00000001000000000000004C'? < > > 2015-03-10 20:50:38 EDT >LOG: database system is shut down > > > Could you share with us archive_command and archive_mode of postgresql.conf ? > It seems than you are using "cp -i" in your archive_command, doesn't it ? > > > > > > > Postgres proceeded to shutdown. > > > > > > > > ‘ls’ showed that the file still have the old timestamp, which is the > > timestamp when I copied it over: > > > > > > > > ls -ltr /dba/psg/gs07/pg_tranlog/pg_archlog/00000001000000000000004B > > > > -rw------- 1 gs07 dbagroup 16777216 Mar 10 > > 12:07 /dba/psg/gs07/pg_tranlog/pg_archlog/0000000100 > > > > > > > > I did not have any transctions, though between the start-up and > > shutdown. I would have expected the timestamp of the logfile to have > > been changed. > > > > Looks like it was waiting for a response to ‘cp’. > > > > > > > > I am concerned that if there were any transactions, I would have lost > > it. > > > > Pls advice. > > > > > > > > Thanks. > > > > > > > > Maria > > > > > > > > > > -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin