Thread: First time installing

First time installing

From
"Ron Watkins"
Date:

Trying to follow documentation. I  installed RPM’s but unable to connect to server…

CentOS Linux release 7.4.1708 (Core)

 

Package postgresql10-10.2-1PGDG.rhel7.x86_64 already installed and latest version

Package postgresql10-server-10.2-1PGDG.rhel7.x86_64 already installed and latest version

 

# su - postgres

-bash-4.2$ psql

psql: could not connect to server: No such file or directory

        Is the server running locally and accepting

        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

 

There are no files under /var/run/post*

 

What am I missing here?

Re: First time installing

From
"Frederick ."
Date:
Make sure the service is running.

As root:   systemctl start postgresql

As a user:
https://www.postgresql.org/docs/10/static/server-start.html

On Wed, Feb 21, 2018 at 3:20 PM, Ron Watkins <rwatki@gmail.com> wrote:
> Trying to follow documentation. I  installed RPM’s but unable to connect to
> server…
>
> CentOS Linux release 7.4.1708 (Core)
>
>
>
> Package postgresql10-10.2-1PGDG.rhel7.x86_64 already installed and latest
> version
>
> Package postgresql10-server-10.2-1PGDG.rhel7.x86_64 already installed and
> latest version
>
>
>
> # su - postgres
>
> -bash-4.2$ psql
>
> psql: could not connect to server: No such file or directory
>
>         Is the server running locally and accepting
>
>         connections on Unix domain socket
> "/var/run/postgresql/.s.PGSQL.5432"?
>
>
>
> There are no files under /var/run/post*
>
>
>
> What am I missing here?


RE: First time installing

From
"Ron Watkins"
Date:
# systemctl start postgresql
Failed to start postgresql.service: Unit not found.

Am I missing a step?

-----Original Message-----
From: Frederick . [mailto:nagemnna@gmail.com]
Sent: Wednesday, February 21, 2018 1:39 PM
To: Ron Watkins
Cc: pgsql-novice@lists.postgresql.org
Subject: Re: First time installing

Make sure the service is running.

As root:   systemctl start postgresql

As a user:
https://www.postgresql.org/docs/10/static/server-start.html

On Wed, Feb 21, 2018 at 3:20 PM, Ron Watkins <rwatki@gmail.com> wrote:
> Trying to follow documentation. I  installed RPM’s but unable to
> connect to server…
>
> CentOS Linux release 7.4.1708 (Core)
>
>
>
> Package postgresql10-10.2-1PGDG.rhel7.x86_64 already installed and
> latest version
>
> Package postgresql10-server-10.2-1PGDG.rhel7.x86_64 already installed
> and latest version
>
>
>
> # su - postgres
>
> -bash-4.2$ psql
>
> psql: could not connect to server: No such file or directory
>
>         Is the server running locally and accepting
>
>         connections on Unix domain socket
> "/var/run/postgresql/.s.PGSQL.5432"?
>
>
>
> There are no files under /var/run/post*
>
>
>
> What am I missing here?



Re: First time installing

From
Hrvoje Zokovic
Date:
Typically installing postgres to your OS creates an "initial DB" and starts the
postgres server daemon running. If not then you'll need to run initdb
https://www.postgresql.org/docs/9.6/static/app-initdb.html
HTH
Hrvoje

On 21.02.18. 21:20, Ron Watkins wrote:

Trying to follow documentation. I  installed RPM’s but unable to connect to server…

CentOS Linux release 7.4.1708 (Core)

 

Package postgresql10-10.2-1PGDG.rhel7.x86_64 already installed and latest version

Package postgresql10-server-10.2-1PGDG.rhel7.x86_64 already installed and latest version

 

# su - postgres

-bash-4.2$ psql

psql: could not connect to server: No such file or directory

        Is the server running locally and accepting

        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

 

There are no files under /var/run/post*

 

What am I missing here?


Re: First time installing

From
"Frederick ."
Date:
maybe it is not enabled?

systemctl enable postgresql

if the service isn't installed maybe a package is missing.  Try to
start it using https://www.postgresql.org/docs/10/static/server-start.html
as the postgres user, to make sure postgres is OK and setup, then
worry about the systemctl service.

as postgres:
postgres -D /usr/local/pgsql/data



On Wed, Feb 21, 2018 at 3:40 PM, Ron Watkins <rwatki@gmail.com> wrote:
> # systemctl start postgresql
> Failed to start postgresql.service: Unit not found.
>
> Am I missing a step?
>
> -----Original Message-----
> From: Frederick . [mailto:nagemnna@gmail.com]
> Sent: Wednesday, February 21, 2018 1:39 PM
> To: Ron Watkins
> Cc: pgsql-novice@lists.postgresql.org
> Subject: Re: First time installing
>
> Make sure the service is running.
>
> As root:   systemctl start postgresql
>
> As a user:
> https://www.postgresql.org/docs/10/static/server-start.html
>
> On Wed, Feb 21, 2018 at 3:20 PM, Ron Watkins <rwatki@gmail.com> wrote:
>> Trying to follow documentation. I  installed RPM’s but unable to
>> connect to server…
>>
>> CentOS Linux release 7.4.1708 (Core)
>>
>>
>>
>> Package postgresql10-10.2-1PGDG.rhel7.x86_64 already installed and
>> latest version
>>
>> Package postgresql10-server-10.2-1PGDG.rhel7.x86_64 already installed
>> and latest version
>>
>>
>>
>> # su - postgres
>>
>> -bash-4.2$ psql
>>
>> psql: could not connect to server: No such file or directory
>>
>>         Is the server running locally and accepting
>>
>>         connections on Unix domain socket
>> "/var/run/postgresql/.s.PGSQL.5432"?
>>
>>
>>
>> There are no files under /var/run/post*
>>
>>
>>
>> What am I missing here?
>


Re: First time installing

From
Keith
Date:


On Wed, Feb 21, 2018 at 3:40 PM, Ron Watkins <rwatki@gmail.com> wrote:
# systemctl start postgresql
Failed to start postgresql.service: Unit not found.

Am I missing a step?

-----Original Message-----
From: Frederick . [mailto:nagemnna@gmail.com]
Sent: Wednesday, February 21, 2018 1:39 PM
To: Ron Watkins
Cc: pgsql-novice@lists.postgresql.org
Subject: Re: First time installing

Make sure the service is running.

As root:   systemctl start postgresql

As a user:
https://www.postgresql.org/docs/10/static/server-start.html

On Wed, Feb 21, 2018 at 3:20 PM, Ron Watkins <rwatki@gmail.com> wrote:
> Trying to follow documentation. I  installed RPM’s but unable to
> connect to server…
>
> CentOS Linux release 7.4.1708 (Core)
>
>
>
> Package postgresql10-10.2-1PGDG.rhel7.x86_64 already installed and
> latest version
>
> Package postgresql10-server-10.2-1PGDG.rhel7.x86_64 already installed
> and latest version
>
>
>
> # su - postgres
>
> -bash-4.2$ psql
>
> psql: could not connect to server: No such file or directory
>
>         Is the server running locally and accepting
>
>         connections on Unix domain socket
> "/var/run/postgresql/.s.PGSQL.5432"?
>
>
>
> There are no files under /var/run/post*
>
>
>
> What am I missing here?




RHEL/CentOS does not enable the service nor create a cluster by default after package installation. Plug in your versions to this form and it will give you all the commands to run to get the package managed cluster installed

https://www.postgresql.org/download/linux/redhat/

RE: First time installing

From
"Ron Watkins"
Date:
I created a filesystem to put the postgres database into:

drwxr-xr-x. 3 postgres postgres 4096 Feb 15 11:02 /pgsql/

I tried the command shown below, but it's not working.

-bash-4.2$ postgres -D /usr/local/pgsql/data
-bash: postgres: command not found


-----Original Message-----
From: Frederick . [mailto:nagemnna@gmail.com]
Sent: Wednesday, February 21, 2018 1:47 PM
To: Ron Watkins
Cc: pgsql-novice@lists.postgresql.org
Subject: Re: First time installing

maybe it is not enabled?

systemctl enable postgresql

if the service isn't installed maybe a package is missing.  Try to start it using
https://www.postgresql.org/docs/10/static/server-start.html
as the postgres user, to make sure postgres is OK and setup, then worry about the systemctl service.

as postgres:
postgres -D /usr/local/pgsql/data



On Wed, Feb 21, 2018 at 3:40 PM, Ron Watkins <rwatki@gmail.com> wrote:
> # systemctl start postgresql
> Failed to start postgresql.service: Unit not found.
>
> Am I missing a step?
>
> -----Original Message-----
> From: Frederick . [mailto:nagemnna@gmail.com]
> Sent: Wednesday, February 21, 2018 1:39 PM
> To: Ron Watkins
> Cc: pgsql-novice@lists.postgresql.org
> Subject: Re: First time installing
>
> Make sure the service is running.
>
> As root:   systemctl start postgresql
>
> As a user:
> https://www.postgresql.org/docs/10/static/server-start.html
>
> On Wed, Feb 21, 2018 at 3:20 PM, Ron Watkins <rwatki@gmail.com> wrote:
>> Trying to follow documentation. I  installed RPM’s but unable to
>> connect to server…
>>
>> CentOS Linux release 7.4.1708 (Core)
>>
>>
>>
>> Package postgresql10-10.2-1PGDG.rhel7.x86_64 already installed and
>> latest version
>>
>> Package postgresql10-server-10.2-1PGDG.rhel7.x86_64 already installed
>> and latest version
>>
>>
>>
>> # su - postgres
>>
>> -bash-4.2$ psql
>>
>> psql: could not connect to server: No such file or directory
>>
>>         Is the server running locally and accepting
>>
>>         connections on Unix domain socket
>> "/var/run/postgresql/.s.PGSQL.5432"?
>>
>>
>>
>> There are no files under /var/run/post*
>>
>>
>>
>> What am I missing here?
>



RE: First time installing

From
"Ron Watkins"
Date:
# systemctl enable postgresql
Failed to execute operation: No such file or directory

-----Original Message-----
From: Frederick . [mailto:nagemnna@gmail.com]
Sent: Wednesday, February 21, 2018 1:47 PM
To: Ron Watkins
Cc: pgsql-novice@lists.postgresql.org
Subject: Re: First time installing

maybe it is not enabled?

systemctl enable postgresql

if the service isn't installed maybe a package is missing.  Try to start it using
https://www.postgresql.org/docs/10/static/server-start.html
as the postgres user, to make sure postgres is OK and setup, then worry about the systemctl service.

as postgres:
postgres -D /usr/local/pgsql/data



On Wed, Feb 21, 2018 at 3:40 PM, Ron Watkins <rwatki@gmail.com> wrote:
> # systemctl start postgresql
> Failed to start postgresql.service: Unit not found.
>
> Am I missing a step?
>
> -----Original Message-----
> From: Frederick . [mailto:nagemnna@gmail.com]
> Sent: Wednesday, February 21, 2018 1:39 PM
> To: Ron Watkins
> Cc: pgsql-novice@lists.postgresql.org
> Subject: Re: First time installing
>
> Make sure the service is running.
>
> As root:   systemctl start postgresql
>
> As a user:
> https://www.postgresql.org/docs/10/static/server-start.html
>
> On Wed, Feb 21, 2018 at 3:20 PM, Ron Watkins <rwatki@gmail.com> wrote:
>> Trying to follow documentation. I  installed RPM’s but unable to
>> connect to server…
>>
>> CentOS Linux release 7.4.1708 (Core)
>>
>>
>>
>> Package postgresql10-10.2-1PGDG.rhel7.x86_64 already installed and
>> latest version
>>
>> Package postgresql10-server-10.2-1PGDG.rhel7.x86_64 already installed
>> and latest version
>>
>>
>>
>> # su - postgres
>>
>> -bash-4.2$ psql
>>
>> psql: could not connect to server: No such file or directory
>>
>>         Is the server running locally and accepting
>>
>>         connections on Unix domain socket
>> "/var/run/postgresql/.s.PGSQL.5432"?
>>
>>
>>
>> There are no files under /var/run/post*
>>
>>
>>
>> What am I missing here?
>



RE: First time installing

From
"Ron Watkins"
Date:
The "EXACT" steps I used to install postgres. Is anything missing here?

yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7.4-x86_64/pgdg-centos10-10-2.noarch.rpm
yum install -y postgresql10
yum install -y postgresql10-server



Re: First time installing

From
Keith
Date:


On Wed, Feb 21, 2018 at 3:52 PM, Ron Watkins <rwatki@gmail.com> wrote:
The "EXACT" steps I used to install postgres. Is anything missing here?

yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7.4-x86_64/pgdg-centos10-10-2.noarch.rpm
yum install -y postgresql10
yum install -y postgresql10-server



Yes, you are missing the cluster initialization and service enable steps. As I said in the earlier email, enter your OS/PG versions into this form and it will give you the commands to run

https://www.postgresql.org/download/linux/redhat/

Re: First time installing

From
Devrim Gündüz
Date:
hi,

On Wed, 2018-02-21 at 13:40 -0700, Ron Watkins wrote:
> # systemctl start postgresql
> Failed to start postgresql.service: Unit not found.
>
> Am I missing a step?

You are missing two steps:

1) /usr/pgsql-10/bin/postgresql-10-setup initdb

That will initialize the cluster for you. Please run it as root.

2) systemctl enable postgresql-10
   systemctl staart postgresql-10

Please check the version number appended to postgresql -- multiple version RPMs
can be installed in parallel.

-HTH

Regards,

--
Devrim Gündüz
EnterpriseDB: https://www.enterprisedb.com
PostgreSQL Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR
Attachment