Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XfZJt-0006rG-5O for pgsql-admin@arkaria.postgresql.org; Sat, 18 Oct 2014 19:05:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XfZJs-0007pg-DN for pgsql-admin@arkaria.postgresql.org; Sat, 18 Oct 2014 19:05:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XfZJq-0007pZ-SY for pgsql-admin@postgresql.org; Sat, 18 Oct 2014 19:05:39 +0000 Received: from mail-qg0-x230.google.com ([2607:f8b0:400d:c04::230]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XfZJm-0004Bs-SN for pgsql-admin@postgresql.org; Sat, 18 Oct 2014 19:05:36 +0000 Received: by mail-qg0-f48.google.com with SMTP id i50so1916221qgf.21 for ; Sat, 18 Oct 2014 12:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=yly/kNAyiyqgB/M0ovp53dusefMn38Ix/GnDXIl78fE=; b=BPgm4KQxqbPporIc0LtSuUeI2ysw6dRCVyreQPlPGkSL1pyg1SfUkeb4CD6bs3tB52 6JmXS/7y4KKb/w/3NUJ8s1DiMkaoZ6gEU3Zbc4r1P4biKZwCft7t6uNaeCmbNz7cdLGf ki9dXamz0Y8lMArxsCm3wM6QAp9xepsbQC+fg3J+qa0TAXdjAx1xS2EVCRLSFl+nsRxW 5MuXkU4YMYhhw4v+CrB93hIhBO9hS2m0mzEzu4SxjZw4dnOPfs4CJvlAAaASVcxHNZ5K H9362MkEG7TTcqAJQkN9Tswv+zucUIEWrnXK2bfJD5Tz5y3BdU66CRlLS54LrE3fdwZX yn1A== X-Received: by 10.140.20.82 with SMTP id 76mr21298255qgi.29.1413659131781; Sat, 18 Oct 2014 12:05:31 -0700 (PDT) Received: from [192.168.254.3] (h77.89.102.166.static.ip.windstream.net. [166.102.89.77]) by mx.google.com with ESMTPSA id 11sm3841763qgp.2.2014.10.18.12.05.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 18 Oct 2014 12:05:31 -0700 (PDT) References: <5441945B.6010000@kapotamar.com> <638CECFF-7F53-4BEC-A58E-8939079192E7@gmail.com> <5442AC22.3050402@kapotamar.com> Mime-Version: 1.0 (1.0) In-Reply-To: <5442AC22.3050402@kapotamar.com> Content-Type: multipart/alternative; boundary=Apple-Mail-2176B22B-25DB-475F-8124-31566592D985 Content-Transfer-Encoding: 7bit Message-Id: <6C164257-D38C-461E-AE0B-108BCC090297@gmail.com> Cc: "pgsql-admin@postgresql.org" X-Mailer: iPad Mail (11D257) From: jayknowsunix@gmail.com Subject: Re: Unable to connect remotely Date: Sat, 18 Oct 2014 15:05:30 -0400 To: Shay Gover X-Pg-Spam-Score: -2.0 (--) 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 --Apple-Mail-2176B22B-25DB-475F-8124-31566592D985 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Sounds maybe like a botched installation. The only pg_hba.conf that should b= e present is the one in $PGDATA. Also, depending on your configuration and h= ow long it's been running, you may not have anything the pg_xlog directory o= ther than a subdirectory. I think, if I'm recalling correctly, that the subd= irectory is named archive. WAL segments get written out here based on the se= tting for wal_keep_segments in the postgresql.conf file. Not really certain when pg_clogs get written out, -- Jay Sent from my iPad > On Oct 18, 2014, at 2:06 PM, Shay Gover wrote: >=20 > Hi everyone, >=20 > First of all it's appears that there was something wrong with my Upstart c= onf file (Ubuntu is using Upstart instead of SysV init. Next year they'll al= so move to Systemd). Jay and Raghu: That solved my connection problem and /v= ar/run problem. > So now pg is up (according to ps -aux |grep post). However pg_ctl status s= ays no server is running. What's wrong?=20 >=20 > About the logs: I have pg_xlog and pg_clog under PFDATA - nothing there. >=20 > Remote connection: When I try to connect to the server I get an error that= my user is not present at pg_hba.conf. However, I see that I have 2 such fi= les: One in PGDATA and one in /etc/postgresql/9.3/main/. What's the differen= ce between them? >=20 > Thanks >=20 >=20 >> On 10/18/2014 03:48 AM, jayknowsunix@gmail.com wrote: >> Hi Shay, >>=20 >> Per your questions: >> 1) from my experience, /var/run is only used to write a PID file, but thi= s file is usually only created by your system's service commands. I don't us= e Ubuntu, only CentOS, so my command is "service postgresql-9.3 [start | sto= p | status| ... ] and the script writes the PID file. The CentOS script also= writes out a /var/subsys/lock file for postgresql. >> 2) your logfiles, unless you've butchered the postgresql.conf file, live i= n the $PGDATA/pg_log directory. Wherever that is on your system. >> 3) i probably can't help much here, but first if you're running selinux, I= 'd probably turn that off first. Next, check if iptables is running and poss= ibly blocking your response. Either turn that off or add a rule to permit th= is port. >>=20 >> Hope this helps, >> Jay >>=20 >> Sent from my iPad >>=20 >> On Oct 17, 2014, at 6:12 PM, Shay Gover wrote: >>=20 >>> Hello everybody, >>>=20 >>> I've just installed PostgreSQL and I'm unable to connect to it remotely f= rom my main desktop (I'm trying to connect with pgAdmin 3). >>>=20 >>> My setup: >>> Ubuntu Server 14.04 x64 (Azure Cloud) >>> PostgreSQL v9.3.5-0ubuntu0.14.04.1 >>> contrib package is also installed. >>> PostgreSQL is started on boot using Upstart. I've modified this script: h= ttps://gist.github.com/haad/6020401 (just version numbers) >>>=20 >>> My Problems: >>> 1) For some reason, when I've installed pg, /var/run/postgresql was miss= ing. I've manually created this folder and gave my pg user write permissions= . Is that a bug? >>> 2) I've tried to change the log config in /etc/postgresql/9.3/main/postg= resql.conf but it won't work. I think that pg is ignoring that file. I also h= ave no idea where is pg log file (I tried /var/log/postgresql - not there). I= tried starting the DB manually with pg_ctl -l but the log does say much: >>> LOG: database system is ready to accept connections >>> LOG: autovacuum launcher started >>> LOG: received SIGHUP, reloading configuration files >>> LOG: received smart shutdown request >>> LOG: autovacuum launcher shutting down >>> LOG: shutting down >>> LOG: database system is shut down >>> LOG: database system was shut down at 2014-10-17 21:22:11 UTC >>> LOG: database system is ready to accept connections >>> LOG: autovacuum launcher started >>> This log contains a single DB run. >>> 3) I'm unable to connect from my main desktop. Server is listening accor= ding to netstat. There is no firewall on the server and I've created an Azur= e endpoint for port 5432. Ideas? >>>=20 >>> Can you help me?=20 >>>=20 >>> Thanks, >>>=20 >>> --=20 >>> Shay Gover >>> IT Consultant >>> Kapot Tamar >=20 > --=20 > Shay Gover > IT Consultant > Kapot Tamar --Apple-Mail-2176B22B-25DB-475F-8124-31566592D985 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
Sounds maybe like a botched installation. The only pg_hba.conf that should be present is the one in $PGDATA. Also, depending on your configuration and how long it's been running, you may not have anything the pg_xlog directory other than a subdirectory. I think, if I'm recalling correctly, that the subdirectory is named archive. WAL segments get written out here based on the setting for wal_keep_segments in the postgresql.conf file.

Not really certain when pg_clogs get written out,
--
Jay

Sent from my iPad

On Oct 18, 2014, at 2:06 PM, Shay Gover <shay@kapotamar.com> wrote:

Hi everyone,

First of all it's appears that there was something wrong with my Upstart conf file (Ubuntu is using Upstart instead of SysV init. Next year they'll also move to Systemd). Jay and Raghu: That solved my connection problem and /var/run problem.
So now pg is up (according to ps -aux |grep post). However pg_ctl status says no server is running. What's wrong?

About the logs: I have pg_xlog and pg_clog under PFDATA - nothing there.

Remote connection: When I try to connect to the server I get an error that my user is not present at pg_hba.conf. However, I see that I have 2 such files: One in PGDATA and one in /etc/postgresql/9.3/main/. What's the difference between them?

Thanks


On 10/18/2014 03:48 AM, jayknowsunix@gmail.com wrote:
Hi Shay,

Per your questions:
1) from my experience, /var/run is only used to write a PID file, but this file is usually only created by your system's service commands. I don't use Ubuntu, only CentOS, so my command is "service postgresql-9.3 [start | stop | status| ... ] and the script writes the PID file. The CentOS script also writes out a /var/subsys/lock file for postgresql.
2) your logfiles, unless you've butchered the postgresql.conf file, live in the $PGDATA/pg_log directory. Wherever that is on your system.
3) i probably can't help much here, but first if you're running selinux, I'd probably turn that off first. Next, check if iptables is running and possibly blocking your response. Either turn that off or add a rule to permit this port.

Hope this helps,
Jay

Sent from my iPad

On Oct 17, 2014, at 6:12 PM, Shay Gover <shay@kapotamar.com> wrote:

Hello everybody,

I've just installed PostgreSQL and I'm unable to connect to it remotely from my main desktop (I'm trying to connect with pgAdmin 3).

My setup:
Ubuntu Server 14.04 x64 (Azure Cloud)
PostgreSQL v9.3.5-0ubuntu0.14.04.1
contrib package is also installed.
PostgreSQL is started on boot using Upstart. I've modified this script: https://gist.github.com/haad/6020401 (just version numbers)

My Problems:
1) For some reason, when I've installed pg, /var/run/postgresql was missing. I've manually created this folder and gave my pg user write permissions. Is that a bug?
2) I've tried to change the log config in /etc/postgresql/9.3/main/postgresql.conf but it won't work. I think that pg is ignoring that file. I also have no idea where is pg log file (I tried /var/log/postgresql - not there). I tried starting the DB manually with pg_ctl -l but the log does say much:
    LOG:  database system is ready to accept connections
    LOG:  autovacuum launcher started
    LOG:  received SIGHUP, reloading configuration files
    LOG:  received smart shutdown request
    LOG:  autovacuum launcher shutting down
    LOG:  shutting down
    LOG:  database system is shut down
    LOG:  database system was shut down at 2014-10-17 21:22:11 UTC
    LOG:  database system is ready to accept connections
    LOG:  autovacuum launcher started
This log contains a single DB run.
3) I'm unable to connect from my main desktop. Server is listening according to netstat. There is no firewall on the server and I've created an Azure endpoint for port 5432. Ideas?

Can you help me?

Thanks,

--

Shay Gover
IT Consultant
Kapot Tamar


--

Shay Gover
IT Consultant
Kapot Tamar

--Apple-Mail-2176B22B-25DB-475F-8124-31566592D985--