pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
postgres service can't restart/start
7+ messages / 4 participants
[nested] [flat]

* postgres service can't restart/start
@ 2019-12-04 17:55  Pepe TD Vo <pepevo@yahoo.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Pepe TD Vo @ 2019-12-04 17:55 UTC (permalink / raw)
  To: pgsql-admin; PgAdmin Support List <pgadmin-support@lists.postgresql.org>

Hi experts,
I am trying to install Postgresql 11.1 replication master-slave.  The configure, make and make install went well.  Initdb to the shared drive and psql are up and running. After configured pg_hba.conf and postgresql.conf, I can't restart the service and/or reload.  Error is:ATHENTICATING for org.freedesktop.systemd1.manage-units ---Athentication is required to manage system services or units.authenticating as :user1Password:-- ATHENTICATION COMPLETE --Failed to start psotgres-11.service: unit no found.
I worked around and add the postgres on pg_hba.conf and using pg_ctl to reload the service.  Postgres server stopped but can't start, it complained about checkpoint_segments which I have set its to 8.
Working with SA to reconfigure the authenticating and the server reaching out and getting authenticaion from org.freedesktop.systemd1.nanage-units.  How can I by pass this issue and bring the postgres up?

Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: postgres service can't restart/start
@ 2019-12-04 19:36  Isaías Sánchez <isaias.sanchez.l@gmail.com>
  parent: Pepe TD Vo <pepevo@yahoo.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Isaías Sánchez @ 2019-12-04 19:36 UTC (permalink / raw)
  To: Pepe TD Vo <pepevo@yahoo.com>; pgsql-admin; PgAdmin Support List <pgadmin-support@lists.postgresql.org>

Verify file permission is right, sometimes if you edit a conf file it 
changes owner and access permission

En 4 de diciembre de 2019 18:55:38 Pepe TD Vo <pepevo@yahoo.com> escribió:
> Hi experts,
>
> I am trying to install Postgresql 11.1 replication master-slave.  The 
> configure, make and make install went well.  Initdb to the shared drive and 
> psql are up and running. After configured pg_hba.conf and postgresql.conf, 
> I can't restart the service and/or reload.  Error is:
> ATHENTICATING for org.freedesktop.systemd1.manage-units ---
> Athentication is required to manage system services or units.
> authenticating as :user1
> Password:
> -- ATHENTICATION COMPLETE --
> Failed to start psotgres-11.service: unit no found.
>
> I worked around and add the postgres on pg_hba.conf and using pg_ctl to 
> reload the service.  Postgres server stopped but can't start, it complained 
> about checkpoint_segments which I have set its to 8.
>
> Working with SA to reconfigure the authenticating and the server reaching 
> out and getting authenticaion from org.freedesktop.systemd1.nanage-units.  
> How can I by pass this issue and bring the postgres up?
>
>
> Bach-Nga
>
> No one in this world is pure and perfect.  If you avoid people for their 
> mistakes you will be alone. So judge less, love and forgive more.
> To call him a dog hardly seems to do him justice though in as much as he 
> had four legs, a tail, and barked, I admit he was, to all outward 
> appearances. But to those who knew him well, he was a perfect gentleman 
> (Hermione Gingold)
>
> **Live simply **Love generously **Care deeply **Speak kindly.
> *** Genuinely rich *** Faithful talent *** Sharing success

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: postgres service can't restart/start
@ 2019-12-04 20:38  Pepe TD Vo <pepevo@yahoo.com>
  parent: Isaías Sánchez <isaias.sanchez.l@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Pepe TD Vo @ 2019-12-04 20:38 UTC (permalink / raw)
  To: pgsql-admin; PgAdmin Support List <pgadmin-support@lists.postgresql.org>; Isaías Sánchez <isaias.sanchez.l@gmail.com>

the permission and owner are right.  to add the authentication into the pg_hba.conf but when I try to start up the postgres, it prompts me for password logged in, even I logged in directly from postgres os user not su from root and/or another os user.==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: user1Password:==== AUTHENTICATION COMPLETE ====Failed to start postgres-11.service: unit not foundSA worked around with me and still can't start the postgresql service.Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success 

    On Wednesday, December 4, 2019, 02:36:21 PM EST, Isaías Sánchez <isaias.sanchez.l@gmail.com> wrote:  
 
 Verify file permission is right, sometimes if you edit a conf file it changes owner and access permission

En 4 de diciembre de 2019 18:55:38 Pepe TD Vo <pepevo@yahoo.com> escribió:

Hi experts,
I am trying to install Postgresql 11.1 replication master-slave.  The configure, make and make install went well.  Initdb to the shared drive and psql are up and running. After configured pg_hba.conf and postgresql.conf, I can't restart the service and/or reload.  Error is:ATHENTICATING for org.freedesktop.systemd1.manage-units ---Athentication is required to manage system services or units.authenticating as :user1Password:-- ATHENTICATION COMPLETE --Failed to start psotgres-11.service: unit no found.
I worked around and add the postgres on pg_hba.conf and using pg_ctl to reload the service.  Postgres server stopped but can't start, it complained about checkpoint_segments which I have set its to 8.
Working with SA to reconfigure the authenticating and the server reaching out and getting authenticaion from org.freedesktop.systemd1.nanage-units.  How can I by pass this issue and bring the postgres up?

Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success

  

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: postgres service can't restart/start
@ 2019-12-04 23:01  Matthew Tice <mjtice@gmail.com>
  parent: Pepe TD Vo <pepevo@yahoo.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Matthew Tice @ 2019-12-04 23:01 UTC (permalink / raw)
  To: Pepe TD Vo <pepevo@yahoo.com>; +Cc: pgsql-admin; PgAdmin Support List <pgadmin-support@lists.postgresql.org>; Isaías Sánchez <isaias.sanchez.l@gmail.com>

Do you have a systemd service file named `postgres-11`?  If so, what are
the contents of it and the location of the file on the file system?

On Wed, Dec 4, 2019 at 1:39 PM Pepe TD Vo <pepevo@yahoo.com> wrote:

> the permission and owner are right.  to add the authentication into the
> pg_hba.conf but when I try to start up the postgres, it prompts me for
> password logged in, even I logged in directly from postgres os user not su
> from root and/or another os user.
>
> ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
> Authentication is required to manage system services or units.
> Authenticating as: user1
>
> Password:
>
> ==== AUTHENTICATION COMPLETE ====
>
> Failed to start postgres-11.service: unit not found
>
> SA worked around with me and still can't start the postgresql service.
>
>
>
> *Bach-Nga*No one in this world is pure and perfect.  If you avoid people
> for their mistakes you will be alone. So judge less, love and forgive more.
> To call him a dog hardly seems to do him justice though in as much as he
> had four legs, a tail, and barked, I admit he was, to all outward
> appearances. But to those who knew him well, he was a perfect gentleman
> (Hermione Gingold)
>
> **Live simply **Love generously **Care deeply **Speak kindly.
> *** Genuinely rich *** Faithful talent *** Sharing success
>
>
> On Wednesday, December 4, 2019, 02:36:21 PM EST, Isaías Sánchez <
> isaias.sanchez.l@gmail.com> wrote:
>
>
> Verify file permission is right, sometimes if you edit a conf file it
> changes owner and access permission
>
> En 4 de diciembre de 2019 18:55:38 Pepe TD Vo <pepevo@yahoo.com> escribió:
>
> Hi experts,
>
> I am trying to install Postgresql 11.1 replication master-slave.  The
> configure, make and make install went well.  Initdb to the shared drive and
> psql are up and running. After configured pg_hba.conf and postgresql.conf,
> I can't restart the service and/or reload.  Error is:
> ATHENTICATING for org.freedesktop.systemd1.manage-units ---
> Athentication is required to manage system services or units.
> authenticating as :user1
> Password:
> -- ATHENTICATION COMPLETE --
> Failed to start psotgres-11.service: unit no found.
>
> I worked around and add the postgres on pg_hba.conf and using pg_ctl to
> reload the service.  Postgres server stopped but can't start, it complained
> about checkpoint_segments which I have set its to 8.
>
> Working with SA to reconfigure the authenticating and the server reaching
> out and getting authenticaion from org.freedesktop.systemd1.nanage-units.
> How can I by pass this issue and bring the postgres up?
>
>
> *Bach-Nga*
>
> No one in this world is pure and perfect.  If you avoid people for their
> mistakes you will be alone. So judge less, love and forgive more.
> To call him a dog hardly seems to do him justice though in as much as he
> had four legs, a tail, and barked, I admit he was, to all outward
> appearances. But to those who knew him well, he was a perfect gentleman
> (Hermione Gingold)
>
> **Live simply **Love generously **Care deeply **Speak kindly.
> *** Genuinely rich *** Faithful talent *** Sharing success
>
>
>

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: postgres service can't restart/start
@ 2019-12-05 15:31  Pepe TD Vo <pepevo@yahoo.com>
  parent: Matthew Tice <mjtice@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Pepe TD Vo @ 2019-12-05 15:31 UTC (permalink / raw)
  To: Matthew Tice <mjtice@gmail.com>; +Cc: pgsql-admin; PgAdmin Support List <pgadmin-support@lists.postgresql.org>; Isaías Sánchez <isaias.sanchez.l@gmail.com>

yes I do have a righ systemd service file named 'postgresql-11' and its located /usr/lib/systemd/system/


Here what I did so far aftermake install.

 

mkdir /usr/local/pgsql/log

Run 

./usr/local/pgsql/bin/pg_ctl –D/postgres_data/pgsql/data –l /usr/local/pgsql/log/logfile start

psql

in the psql shell

psql# create user replicareplication login encrypted password ‘replicauser@’;

psql# alter user postgrespassword ‘password@’;

 

configure postgresql.conf:

port = 5432

unix_socket_directorys = ’tmp’

max_files_per_process = 1000

listen_addresses = ‘localhost,192.168.2.122 ‘  à (master-server-ip)

wal_level = replica

max_replication_slots = 10

archive_mode = on

archive_command = ‘cp –I %p/u02/postgres/main/archive/%f’

max_wal_senders = 10

wal_keep_segments = 64

 

for pg_hba.conf, I added:

local      all              postgres                                 md5               à authenticate postgres

host      replication  replica  192.##.##.##/32      md5               à master-server

host      replication  replica  192.##.##.##/32      md5               à slave-server

 

$ mkdir –p/u02/postgres/main/archive 

$ systemctl restart postgresql

=== AUTHENTICATING FORorg.freedesktop.systemd1.manage-units ===

Autehtication is required tomanage system services or units.

Authenticating as: sysmaint

Password:

=== AUTHENTICATION COMPLETE ===

Job for postgresql-11.servicefailed because the control process existed with error code. See “systemctlstatus postgresql-11.service” and “journalctl –xe” for details.

For the status, it complained about/usr/lib/systemd/system/postgresql-11.service; disabled; vendor preset: disabled_

Active: failed (Result:exit-code) since date: time

Process:10188ExecStartPre=/usr/pgsql-11/bin/postgresql-11-check-db-dir ${PGDATA}(code=existed, status=1/FAILURE)

 

I un-commented data_directory andcorrect the path to postgresql.conf per SA suggested and still get the sameerror above
data_directory =‘/postgres_data/pgsql/data/’   --> data folder is on shared drive.
hba_file =‘/postgres_data/pgsql/pg_hba.conf’

 

still prompt for the user’spassword even I am logging as postgres os user.
the binary (postgres_home) =/usr/local/pgsql/  should owned by root:root, right?  
The problem I think but not sureI am right, I found there’s another source on /usr/pgql-11/bin existed on theserver.  When the SA installed the OS Patch, the server hadpostgres-9.6.  I can run any date for Postgresql 11.  He applied OSPatches updated, removed 9.6 and yum the postgresql11-11.1-1PGDG.rhel7.x86_64.rpmsuccessful, configure, make and make install and start the postgresql service without error until the configuration of pg_hba.conf and postgresql.conf.  The restart service failed.
Wonder if I can remove /usr/pgql-11 or not but not sure whichone is the corrected binaries.  Comparing with the single node postgresserver I did last year, the /usr/local/pgsql sounds convinced right binariesone but /usr/pgsql-11 have more functions.

Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success 

    On Wednesday, December 4, 2019, 05:59:20 PM EST, Matthew Tice <mjtice@gmail.com> wrote:  
 
 Do you have a systemd service file named `postgres-11`?  If so, what are the contents of it and the location of the file on the file system?
On Wed, Dec 4, 2019 at 1:39 PM Pepe TD Vo <pepevo@yahoo.com> wrote:

the permission and owner are right.  to add the authentication into the pg_hba.conf but when I try to start up the postgres, it prompts me for password logged in, even I logged in directly from postgres os user not su from root and/or another os user.==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: user1Password:==== AUTHENTICATION COMPLETE ====Failed to start postgres-11.service: unit not foundSA worked around with me and still can't start the postgresql service.Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success 

    On Wednesday, December 4, 2019, 02:36:21 PM EST, Isaías Sánchez <isaias.sanchez.l@gmail.com> wrote:  
 
 Verify file permission is right, sometimes if you edit a conf file it changes owner and access permission

En 4 de diciembre de 2019 18:55:38 Pepe TD Vo <pepevo@yahoo.com> escribió:

Hi experts,
I am trying to install Postgresql 11.1 replication master-slave.  The configure, make and make install went well.  Initdb to the shared drive and psql are up and running. After configured pg_hba.conf and postgresql.conf, I can't restart the service and/or reload.  Error is:ATHENTICATING for org.freedesktop.systemd1.manage-units ---Athentication is required to manage system services or units.authenticating as :user1Password:-- ATHENTICATION COMPLETE --Failed to start psotgres-11.service: unit no found.
I worked around and add the postgres on pg_hba.conf and using pg_ctl to reload the service.  Postgres server stopped but can't start, it complained about checkpoint_segments which I have set its to 8.
Working with SA to reconfigure the authenticating and the server reaching out and getting authenticaion from org.freedesktop.systemd1.nanage-units.  How can I by pass this issue and bring the postgres up?

Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success

  
  

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: postgres service can't restart/start
@ 2019-12-05 15:41  John Scalia <jayknowsunix@gmail.com>
  parent: Pepe TD Vo <pepevo@yahoo.com>
  0 siblings, 1 reply; 7+ messages in thread

From: John Scalia @ 2019-12-05 15:41 UTC (permalink / raw)
  To: Pepe TD Vo <pepevo@yahoo.com>; +Cc: Matthew Tice <mjtice@gmail.com>; pgsql-admin; PgAdmin Support List <pgadmin-support@lists.postgresql.org>; Isaías Sánchez <isaias.sanchez.l@gmail.com>

You rapidly confuse the systemd process if you manually start/stop/restart PostgreSQL by hand. Always use the service or systemctl command for doing anything.

—
Jay

Sent from my iPad

> On Dec 5, 2019, at 10:31 AM, Pepe TD Vo <pepevo@yahoo.com> wrote:
> 
> 
> yes I do have a righ systemd service file named 'postgresql-11' and its located /usr/lib/systemd/system/
> 
> Here what I did so far after make install.
> 
>  
> 
> mkdir /usr/local/pgsql/log
> 
> Run
> 
> ./usr/local/pgsql/bin/pg_ctl –D /postgres_data/pgsql/data –l /usr/local/pgsql/log/logfile start
> 
> psql
> 
> in the psql shell
> 
> psql# create user replica replication login encrypted password ‘replicauser@’;
> 
> psql# alter user postgres password ‘password@’;
> 
>  
> 
> configure postgresql.conf:
> 
> port = 5432
> 
> unix_socket_directorys = ’tmp’
> 
> max_files_per_process = 1000
> 
> listen_addresses = ‘localhost, 192.168.2.122 ‘  à (master-server-ip)
> 
> wal_level = replica
> 
> max_replication_slots = 10
> 
> archive_mode = on
> 
> archive_command = ‘cp –I %p /u02/postgres/main/archive/%f’
> 
> max_wal_senders = 10
> 
> wal_keep_segments = 64
> 
>  
> 
> for pg_hba.conf, I added:
> 
> local       all              postgres                                 md5               à authenticate postgres
> 
> host       replication  replica   192.##.##.##/32      md5               à master-server
> 
> host       replication  replica   192.##.##.##/32      md5               à slave-server
> 
>  
> 
> $ mkdir –p /u02/postgres/main/archive
> 
> $ systemctl restart postgresql
> 
> === AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
> 
> Autehtication is required to manage system services or units.
> 
> Authenticating as: sysmaint
> 
> Password:
> 
> === AUTHENTICATION COMPLETE ===
> 
> Job for postgresql-11.service failed because the control process existed with error code. See “systemctl status postgresql-11.service” and “journalctl –xe” for details.
> 
> For the status, it complained about /usr/lib/systemd/system/postgresql-11.service; disabled; vendor preset: disabled_
> 
> Active: failed (Result: exit-code) since date: time
> 
> Process:10188 ExecStartPre=/usr/pgsql-11/bin/postgresql-11-check-db-dir ${PGDATA} (code=existed, status=1/FAILURE)
> 
>  
> 
> I un-commented data_directory and correct the path to postgresql.conf per SA suggested and still get the same error above
> 
> data_directory = ‘/postgres_data/pgsql/data/’   --> data folder is on shared drive.
> hba_file = ‘/postgres_data/pgsql/pg_hba.conf’
> 
>  
> 
> still prompt for the user’s password even I am logging as postgres os user.
> 
> the binary (postgres_home) = /usr/local/pgsql/  should owned by root:root, right? 
> 
> The problem I think but not sure I am right, I found there’s another source on /usr/pgql-11/bin existed on the server.  When the SA installed the OS Patch, the server had postgres-9.6.  I can run any date for Postgresql 11.  He applied OS Patches updated, removed 9.6 and yum the postgresql11-11.1-1PGDG.rhel7.x86_64.rpm successful, configure, make and make install and start the postgresql service without error until the configuration of pg_hba.conf and postgresql.conf.  The restart service failed.
> 
> Wonder if I can remove /usr/pgql-11 or not but not sure which one is the corrected binaries.  Comparing with the single node postgres server I did last year, the /usr/local/pgsql sounds convinced right binaries one but /usr/pgsql-11 have more functions.
> 
> 
> Bach-Nga
> 
> No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.
> To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
> 
> **Live simply **Love generously **Care deeply **Speak kindly.
> *** Genuinely rich *** Faithful talent *** Sharing success
> 
> 
> On Wednesday, December 4, 2019, 05:59:20 PM EST, Matthew Tice <mjtice@gmail.com> wrote:
> 
> 
> Do you have a systemd service file named `postgres-11`?  If so, what are the contents of it and the location of the file on the file system?
> 
> On Wed, Dec 4, 2019 at 1:39 PM Pepe TD Vo <pepevo@yahoo.com> wrote:
> the permission and owner are right.  to add the authentication into the pg_hba.conf but when I try to start up the postgres, it prompts me for password logged in, even I logged in directly from postgres os user not su from root and/or another os user.
> ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
> Authentication is required to manage system services or units.
> Authenticating as: user1
> Password:
> ==== AUTHENTICATION COMPLETE ====
> Failed to start postgres-11.service: unit not found
> SA worked around with me and still can't start the postgresql service.
> Bach-Nga
> 
> No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.
> To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
> 
> **Live simply **Love generously **Care deeply **Speak kindly.
> *** Genuinely rich *** Faithful talent *** Sharing success
> 
> 
>> On Wednesday, December 4, 2019, 02:36:21 PM EST, Isaías Sánchez <isaias.sanchez.l@gmail.com> wrote:
>> 
>> 
>> Verify file permission is right, sometimes if you edit a conf file it changes owner and access permission
>> 
>> En 4 de diciembre de 2019 18:55:38 Pepe TD Vo <pepevo@yahoo.com> escribió:
>> 
>> Hi experts,
>> 
>> I am trying to install Postgresql 11.1 replication master-slave.  The configure, make and make install went well.  Initdb to the shared drive and psql are up and running. After configured pg_hba.conf and postgresql.conf, I can't restart the service and/or reload.  Error is:
>> ATHENTICATING for org.freedesktop.systemd1.manage-units ---
>> Athentication is required to manage system services or units.
>> authenticating as :user1
>> Password:
>> -- ATHENTICATION COMPLETE --
>> Failed to start psotgres-11.service: unit no found.
>> 
>> I worked around and add the postgres on pg_hba.conf and using pg_ctl to reload the service.  Postgres server stopped but can't start, it complained about checkpoint_segments which I have set its to 8.
>> 
>> Working with SA to reconfigure the authenticating and the server reaching out and getting authenticaion from org.freedesktop.systemd1.nanage-units.  How can I by pass this issue and bring the postgres up?
>> 
>> 
>> Bach-Nga
>> 
>> No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.
>> To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
>> 
>> **Live simply **Love generously **Care deeply **Speak kindly.
>> *** Genuinely rich *** Faithful talent *** Sharing success
> 
> 

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: postgres service can't restart/start
@ 2019-12-05 15:49  Pepe TD Vo <pepevo@yahoo.com>
  parent: John Scalia <jayknowsunix@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Pepe TD Vo @ 2019-12-05 15:49 UTC (permalink / raw)
  To: John Scalia <jayknowsunix@gmail.com>; +Cc: Matthew Tice <mjtice@gmail.com>; pgsql-admin; PgAdmin Support List <pgadmin-support@lists.postgresql.org>; Isaías Sánchez <isaias.sanchez.l@gmail.com>

the restart doesn't work.  I worked around and using pg_ctl to reload. Service stopped and can't start up the service (pg_ctl: could not start server).  Even start with postgresql-11 with and/out .service.systemctl restart postgresql-11
systemctl restart postgresql-11.service


Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success 

    On Thursday, December 5, 2019, 10:41:57 AM EST, John Scalia <jayknowsunix@gmail.com> wrote:  
 
 You rapidly confuse the systemd process if you manually start/stop/restart PostgreSQL by hand. Always use the service or systemctl command for doing anything.
—Jay

Sent from my iPad

On Dec 5, 2019, at 10:31 AM, Pepe TD Vo <pepevo@yahoo.com> wrote:



yes I do have a righ systemd service file named 'postgresql-11' and its located /usr/lib/systemd/system/


Here what I did so far aftermake install.

 

mkdir /usr/local/pgsql/log

Run 

./usr/local/pgsql/bin/pg_ctl –D/postgres_data/pgsql/data –l /usr/local/pgsql/log/logfile start

psql

in the psql shell

psql# create user replicareplication login encrypted password ‘replicauser@’;

psql# alter user postgrespassword ‘password@’;

 

configure postgresql.conf:

port = 5432

unix_socket_directorys = ’tmp’

max_files_per_process = 1000

listen_addresses = ‘localhost,192.168.2.122 ‘  à (master-server-ip)

wal_level = replica

max_replication_slots = 10

archive_mode = on

archive_command = ‘cp –I %p/u02/postgres/main/archive/%f’

max_wal_senders = 10

wal_keep_segments = 64

 

for pg_hba.conf, I added:

local      all              postgres                                 md5               à authenticate postgres

host      replication  replica  192.##.##.##/32      md5               à master-server

host      replication  replica  192.##.##.##/32      md5               à slave-server

 

$ mkdir –p/u02/postgres/main/archive 

$ systemctl restart postgresql

=== AUTHENTICATING FORorg.freedesktop.systemd1.manage-units ===

Autehtication is required tomanage system services or units.

Authenticating as: sysmaint

Password:

=== AUTHENTICATION COMPLETE ===

Job for postgresql-11.servicefailed because the control process existed with error code. See “systemctlstatus postgresql-11.service” and “journalctl –xe” for details.

For the status, it complained about/usr/lib/systemd/system/postgresql-11.service; disabled; vendor preset: disabled_

Active: failed (Result:exit-code) since date: time

Process:10188ExecStartPre=/usr/pgsql-11/bin/postgresql-11-check-db-dir ${PGDATA}(code=existed, status=1/FAILURE)

 

I un-commented data_directory andcorrect the path to postgresql.conf per SA suggested and still get the sameerror above
data_directory =‘/postgres_data/pgsql/data/’   --> data folder is on shared drive.
hba_file =‘/postgres_data/pgsql/pg_hba.conf’

 

still prompt for the user’spassword even I am logging as postgres os user.
the binary (postgres_home) =/usr/local/pgsql/  should owned by root:root, right?  
The problem I think but not sureI am right, I found there’s another source on /usr/pgql-11/bin existed on theserver.  When the SA installed the OS Patch, the server hadpostgres-9.6.  I can run any date for Postgresql 11.  He applied OSPatches updated, removed 9.6 and yum the postgresql11-11.1-1PGDG.rhel7.x86_64.rpmsuccessful, configure, make and make install and start the postgresql service without error until the configuration of pg_hba.conf and postgresql.conf.  The restart service failed.
Wonder if I can remove /usr/pgql-11 or not but not sure whichone is the corrected binaries.  Comparing with the single node postgresserver I did last year, the /usr/local/pgsql sounds convinced right binariesone but /usr/pgsql-11 have more functions.

Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success 

    On Wednesday, December 4, 2019, 05:59:20 PM EST, Matthew Tice <mjtice@gmail.com> wrote:  
 
 Do you have a systemd service file named `postgres-11`?  If so, what are the contents of it and the location of the file on the file system?
On Wed, Dec 4, 2019 at 1:39 PM Pepe TD Vo <pepevo@yahoo.com> wrote:

the permission and owner are right.  to add the authentication into the pg_hba.conf but when I try to start up the postgres, it prompts me for password logged in, even I logged in directly from postgres os user not su from root and/or another os user.==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: user1Password:==== AUTHENTICATION COMPLETE ====Failed to start postgres-11.service: unit not foundSA worked around with me and still can't start the postgresql service.Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success 

    On Wednesday, December 4, 2019, 02:36:21 PM EST, Isaías Sánchez <isaias.sanchez.l@gmail.com> wrote:  
 
 Verify file permission is right, sometimes if you edit a conf file it changes owner and access permission

En 4 de diciembre de 2019 18:55:38 Pepe TD Vo <pepevo@yahoo.com> escribió:

Hi experts,
I am trying to install Postgresql 11.1 replication master-slave.  The configure, make and make install went well.  Initdb to the shared drive and psql are up and running. After configured pg_hba.conf and postgresql.conf, I can't restart the service and/or reload.  Error is:ATHENTICATING for org.freedesktop.systemd1.manage-units ---Athentication is required to manage system services or units.authenticating as :user1Password:-- ATHENTICATION COMPLETE --Failed to start psotgres-11.service: unit no found.
I worked around and add the postgres on pg_hba.conf and using pg_ctl to reload the service.  Postgres server stopped but can't start, it complained about checkpoint_segments which I have set its to 8.
Working with SA to reconfigure the authenticating and the server reaching out and getting authenticaion from org.freedesktop.systemd1.nanage-units.  How can I by pass this issue and bring the postgres up?

Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success

  
  
  

^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2019-12-05 15:49 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04 17:55 postgres service can't restart/start Pepe TD Vo <pepevo@yahoo.com>
2019-12-04 19:36 ` Isaías Sánchez <isaias.sanchez.l@gmail.com>
2019-12-04 20:38   ` Pepe TD Vo <pepevo@yahoo.com>
2019-12-04 23:01     ` Matthew Tice <mjtice@gmail.com>
2019-12-05 15:31       ` Pepe TD Vo <pepevo@yahoo.com>
2019-12-05 15:41         ` John Scalia <jayknowsunix@gmail.com>
2019-12-05 15:49           ` Pepe TD Vo <pepevo@yahoo.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox