Hi.
Now the error is other. "pg_ctl: cannot be run as root"
You have to run postgres services with postgres user.
Regards
______________________
Saludos
Ing. Ricardo Martín Gomez
DBA - SysAdmin
De: Pepe TD Vo <pepevo@xxxxxxxxx>
Enviado: jueves, 10 de enero de 2019 13:04 Para: Shreeyansh Dba Cc: Kris Deugau; pgsql-admin@xxxxxxxxxxxxxxxxxxxx Asunto: Re: install Postgres on RHED 7 sorry I was out yesterday.
I stop the services and kill -9 all the postgresql process and run ps aux|grep postgres. Nothing is running and start the service as 'service posgresql
start" I still get eh error
'Job for postgresql.service failed because the control process existed with error code. See "systemctl status posgresql.service" and "journalctl
-xe" for details
As the systemctl status posgresql.service I get
Loaded:loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2019-091-10 09:18:24 EST; 34s ago
Active:
failed (Result: exit-code) since Thu 2019-091-10 09:18:24 EST; 34s ago
Process:
20639 ExecStart=//usr/bin/pg_ctl start –D ${PGDATA} –s –o –p ${PGPORT} –w –t 300 (code=existed, status=1/FAILURE)
Jan 10 09:18:23 hostname systemd[1]: Starting PosgreSQL database server…
Jan 10 09:18:23 hostname [pg_ctl[20639]: FATAL:
could not remove old lock file “/t…ed
Jan 10 09:18:23 hostname [pg_ctl[20639]: HINT: the file seems accidentally lef ov …n.
Jan 10 09:18:24 hostname [pg_ctl[20639]: pg_ctl: could not start server
Jan 10 09:18:24 hostname systemd[1]:postgresql.service: control process existed, c…=1
Jan 10 09:18:24 hostname systemd[1]:Failed to start PostgreSQL database server.
Jan 10 09:18:24 hostname systemd[1]:Unit postgresql.service entered failed state.
Jan 10 09:18:24 hostname systemd[1]:postgresql.service failed
Hint: some lines were ellipsized, use –l to show in full.
From journal-xe, I see:
--Unit session -10325.scope has finished starting up.
--The start-up result is done
Jan 10 09:20:01 hostname systemd[1]: Starting session 10325 of user root
--Unit session-10325.scope has begun starting up
Jan 10 09:20:01 hostname systemd[1]: Removed slice User Slice of root
--Unit user-0.slice has finished shutting down.
Jan 10 09:20:01 hostname systemd[1]: Stopping User Slice of root
--Unit user-0.slice has begun shutting down.
When I grep postgres from systemctl, it loaded failed failed
#systemctl list-units|grep posgresql
a postgresql-11.service loaded failed failed
PostgreSQL 11 database server
#pg_ctl start
pg_ctl: cannot be run as root
Please log in (using, e.g., “su) as the (unprivileged) user that will own the server
process.
# su postgres
[postgres@hostname]$ pg_ctl start
Pg_ctl: no database directory specified and environment variable PGDATA unset
Try “pg_ctl –help” for more information.
I am new to Postgresql and any information provide will be appreciated.
thank you.
v/r,
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, January 9, 2019 2:16 AM, Shreeyansh Dba <shreeyansh2014@xxxxxxxxx> wrote:
Try to specify the exact name for the PostgreSQL service, which you can find under the list of services, using systemctl.
systemctl list-units|grep postgresql
Then you can use the service or systemctl command.
Or
Better to use pg_ctl to start/stop PostgreSQL server.
On Wed, Jan 9, 2019 at 12:03 AM Pepe TD Vo <pepevo@xxxxxxxxx> wrote:
|