Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghgvN-00065h-Ge for pgsql-admin@arkaria.postgresql.org; Thu, 10 Jan 2019 20:27:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ghgvM-0007Jb-61 for pgsql-admin@arkaria.postgresql.org; Thu, 10 Jan 2019 20:27:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghgvL-0007JU-8U for pgsql-admin@lists.postgresql.org; Thu, 10 Jan 2019 20:27:31 +0000 Received: from sonic304-12.consmr.mail.bf2.yahoo.com ([74.6.128.35]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghgvH-0000BG-7v for pgsql-admin@lists.postgresql.org; Thu, 10 Jan 2019 20:27:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1547152045; bh=PmtKFnnW+OdP390lGxjv9YfpQOt8Z1K5UtFXbMLyTc4=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=NeSwzzZbYZtJDo+V+acEDYrnBJ3pbg5iW9Vv/gMH2upRt5t0xr0XCqDYK09nz80HGJayjqpxu7iCbp6C5t+SDy2YSUMnGODdTzxUQ1SxTkrY1MuWY9RMtXZC55Vh0uhvgxCwtRsMXV7q9UawoHOxtUgRxPcVoODgK2KLi7SVSVr7ONId0QLHx8KWwjI2S2atwAF3X2FK/buFMe8Wtlr+PVJ/useQDziHpmSOtrc1YHk7qei1+UuyMIyya3WJ4kPgwpC426GvnasAD50I/xdEcUZrPWAPQ6DypSKu/2X44wMprK2Rz28ylc8+WekFeQvDPQ/CnPDFf46trrQd58SY8w== X-YMail-OSG: y4QaoDEVM1mH8ylJxevm_lSQMvUmw7ec64XgZGH4FCsXAG5GD2b3dEEyen4iSev LvXWAoQvd_xrbzpt6C9sjb2SuGUb5PbRlMZcneWzrwMyVW2q00Nyh0SttJirtl2JmFd.C2G72R_f 10eblRPWF5syUkFD6Mu3W_SgHGPTCplndiio.XimgpXl..7s9ApvTY1Ouhz.hHrMW3.VbxxiRhTH T9m1PBAwuCSO8qmghSzXmtdZ.4yhFmXbrAEhbIQTTSrDr6RsICyXG_IkF9.V7bNY2uIuE_.1xClv KTvTbu0LZmDzfFHjlik964GAHjee0BzMYWtZyXw.YvZ3rqr6L3_mqJ5STPWCoqU8CAEDPOI_5ydD zYAmqH2zgyjpQ_f75JfPl5XdsbkI9f1i_qoO1UEufD2ojMBay1cuiSpWAyMZDAVaG0CvFv5IIVwt FntEig9FVmrty5w37j8GLT2TZoa3GrDJ60OioYsXUKa5LpEJf9cSuNaP_sXMSR82Du7ACC4S9xUo HwA6sAOeXNtzLYae8asjOrk9snowL2szGzv695XT2N.jom7Z3g6UwV02FvaXXqD_O3syccJVSP__ PtPd7j36Kx0SiL0Wm7OPqc5AiYir.v8TciNaaxnAjCplSn0zixCitbd8Ecy9Bn4BNCeYbeYkSlx_ HHVra5AxrM1Uw9tUmdFPntyt_iooYPLfXBWRYkFfZvsbL8dxglZSP6LQ5KLi5fDZ.eo2perg7leO 8iCNvaLhK1ZOGX5pHLnCPvrsjLDjJiavRcZQv1072ehviGCLmrhJHl2cSX_TGa6zuyCfTnLxRzI7 I1pzyGGhReNYijgPoYlUgSdoQlHVuR8BJM8SoOKNeY6Q_ECQf210WRBxuj9_YOqAPwu1RfXcunvi IJ2k8piimh4lVuSQ6cPX4pn5CDcHls.P4tYa6HjkxWHH.5nZ9emMPQog7QJTo2yfCLkO6r2rwA1C 8KEmjaP0SoN8j0jIa2Jg5L9u2LHuiFGSj46ScITu7APl_SCvK66LF6Va5kNckkftadXuTDYRa3Z6 j7aZI8D23QG_9iqxLdOQ5GuiGNu2xHNsBOrPk7y_340MsMFfN18gGQAWyxgx.C9I8KRk.WU4dVnc h71u40A-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.bf2.yahoo.com with HTTP; Thu, 10 Jan 2019 20:27:25 +0000 Date: Thu, 10 Jan 2019 20:27:22 +0000 (UTC) From: Pepe TD Vo Reply-To: Pepe TD Vo To: Ricardo Martin Gomez , Shreeyansh Dba Cc: Kris Deugau , "pgsql-admin@lists.postgresql.org" Message-ID: <1474064958.11900702.1547152042133@mail.yahoo.com> In-Reply-To: References: <1631501735.1420767.1545138861194.ref@mail.yahoo.com> <1631501735.1420767.1545138861194@mail.yahoo.com> <413070647.1500395.1545146432141@mail.yahoo.com> <655950091.6682015.1545227950414@mail.yahoo.com> <1647331387.6706670.1545231013241@mail.yahoo.com> <1026281491.6868813.1545244876819@mail.yahoo.com> <16116df4-3ae8-688b-5794-440e47d61ba1@vianet.ca> <404624400.7401294.1545328383827@mail.yahoo.com> <1417769599.15062732.1546970845229@mail.yahoo.com> <663674680.15076651.1546972379997@mail.yahoo.com> <1776910635.16316271.1547136271945@mail.yahoo.com> Subject: Re: install Postgres on RHED 7 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11900701_295648402.1547152042120" X-Mailer: WebService/1.1.12857 YahooMailNeo Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 Content-Length: 66470 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_11900701_295648402.1547152042120 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I tried both and none of them work.=C2=A0=C2=A0 Finally, I made it work.1.=C2=A0 commented all of the module and none being= used /etc/pam.d/postgres2. added extra 32 after address of pg_hba.conf3. I= stop and start postgres as root fine without error. thank you for all your helps. Now I need to learn/play how to create a new postgres DB have a wonderful days. v/r,=C2=A0Bach-Nga No one in this world is pure and perfect.=C2=A0 If you avoid people for the= ir 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 t= o 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=20 On Thursday, January 10, 2019 3:06 PM, Ricardo Martin Gomez wrote: =20 #yiv8547712471 P {margin-top:0;margin-bottom:0;}Hi.=C2=A0Now the error is = other. "pg_ctl: cannot be run as root"You have to run postgres services wit= h postgres user. Regards______________________Saludos=C2=A0Ing. Ricardo Mart=C3=ADn GomezDBA= - SysAdminDe: Pepe TD Vo Enviado: jueves, 10 de enero de 2019 13:04 Para: Shreeyansh Dba Cc: Kris Deugau; pgsql-admin@lists.postgresql.org Asunto: Re: install Postgres on RHED 7=C2=A0sorry I was out yesterday. I stop the services and kill -9 all the postgresql process and run ps aux|g= rep postgres.=C2=A0 Nothing is running and start the service as 'service po= sgresql start" I still get eh error=C2=A0'Job for postgresql.service failed= because the control process existed with error code.=C2=A0 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 = agoProcess: 20639 ExecStart=3D//usr/bin/pg_ctl start =E2=80=93D ${PGDATA} = =E2=80=93s =E2=80=93o =E2=80=93p ${PGPORT} =E2=80=93w =E2=80=93t 300 (code= =3Dexisted, status=3D1/FAILURE)Jan 10 09:18:23 hostname systemd[1]: Startin= g PosgreSQL database server=E2=80=A6Jan 10 09:18:23 hostname [pg_ctl[20639]= : FATAL:could not remove old lock file =E2=80=9C/t=E2=80=A6edJan 10 09:18:2= 3 hostname [pg_ctl[20639]: HINT: the file seems accidentally lef ov =E2=80= =A6n.Jan 10 09:18:24 hostname [pg_ctl[20639]: pg_ctl: could not start serve= rJan 10 09:18:24 hostname systemd[1]:postgresql.service: control process ex= isted, c=E2=80=A6=3D1Jan 10 09:18:24 hostname systemd[1]:Failed to start Po= stgreSQL database server.Jan 10 09:18:24 hostname systemd[1]:Unit postgresq= l.service entered failed state.Jan 10 09:18:24 hostname systemd[1]:postgres= ql.service failedHint: some lines were ellipsized, use =E2=80=93l to show i= n full.=C2=A0From journal-xe, I see:--Unit session -10325.scope has finishe= d starting up.--The start-up result is doneJan 10 09:20:01 hostname systemd= [1]: Starting session 10325 of user root--Unit session-10325.scope has begu= n starting upJan 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 hostn= ame systemd[1]: Stopping User Slice of root--Unit user-0.slice has begun sh= utting down.=C2=A0When I grep postgres from systemctl, it loaded failed fai= led#systemctl list-units|grep posgresqla postgresql-11.service loaded faile= d failedPostgreSQL 11 database server#pg_ctl startpg_ctl: cannot be run as = rootPlease log in (using, e.g., =E2=80=9Csu) as the (unprivileged) user tha= t will own the server process.# su postgres[postgres@hostname]$ pg_ctl star= tPg_ctl: no database directory specified and environment variable PGDATA un= setTry =E2=80=9Cpg_ctl =E2=80=93help=E2=80=9D for more information. I am new to Postgresql and any information provide will be appreciated. thank you. v/r, =C2=A0Bach-Nga No one in this world is pure and perfect.=C2=A0 If you avoid people for the= ir 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 t= o 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 wrote: Try to specify the exact name for the PostgreSQL service, which you can fin= d under the list of services, using systemctl. systemctl list-units|grep postgresql Then you can use the service or systemctl command.OrBetter to use pg_ctl to= start/stop PostgreSQL server. Thanks & Regards, Shreeyansh DBA Team www.shreeyansh.com On Wed, Jan 9, 2019 at 12:03 AM Pepe TD Vo wrote: sorry, my fingers split before I can finish all typing: finally the SA installed the OS libraries and I installed the server packag= es successful but not postgres11-contrib.#yum install postgresql11-server p= ostgresql11-contrib=C2=A0 --> I see no package postgresql11-contrib availab= eDependencies resolvedTransaction test succeededrunning transaction=C2=A0in= stalling: libicu-50.1.2.17.el7.x86_64=C2=A0 =C2=A01/2Installing: postgresql= 11-11.1-1PGDG.rhel7.x86_64=C2=A0 =C2=A02/3failed to link /usr/bin/psql -> /= etc/alternative/pgsql-psql: /usr/bin/pgql exists and it's not a a symlinkfa= iled to link /usr/bin/clusterdb -> /etc/alternatives/pgsql-clusterdb: /usr/= bin/clusterdb exist and itis not a symlink failed to link /usr/bin/createdb -> /etc/alternatives/pgsql-createdb: /usr/= bin/createdb=C2=A0exist and it is not a symlinkfailed to link /usr/bin/crea= teuser -> /etc/alternatives/pgsql-createuser: /usr/bin/createuse=C2=A0exist= and it is not a symlink failed to link /usr/bin/dropdb -> /etc/alternatives/pgsql-dropdb: /usr/bin/= dropdb exist and it is not a symlinkfailed to link /usr/bin/dropuser -> /et= c/alternatives/pgsql-dropuser: /usr/bin/dropuser exist and it is not a syml= inkfailed to link /usr/bin/pg_basebackup -> /etc/alternatives/pgsql-pg_base= backup: /usr/bin/pg_basebackup exist and itis not a symlinkfailed to link /= usr/bin/pg_dump -> /etc/alternatives/pgsql-pg_dump: /usr/bin/pg_dump exist = and it is not a symlinkfailed to link /usr/bin/pg_dumpall -> /etc/alternati= ves/pgsql-pg_dumpall: /usr/bin/pg_dumpall exist and it is not a symlinkfail= ed to link /usr/bin/pg_restore -> /etc/alternatives/pgsql-pg_restore: /usr/= bin/pg_restore exist and it is not a symlink failed to link /usr/bin/reindexdbl -> /etc/alternatives/pgsq-reindexdb: /us= r/bin/reindexdb exist and it is not a symlink failed to link /usr/bin/vacuumdb -> /etc/alternatives/pgsql-vacuumdb: /usr/= bin/vacuumdbexist and it is not a symlink installing:=C2=A0=C2=A0postgresql11-server-11.1-1PGDB.rhel7.x86_64=C2=A0=C2= =A0 1/3 Verifying:=C2=A0 postgresql11-11.1-1PGDB.rhel7.x86_64=C2=A0 =C2=A01/3Verify= ing: libicu-50.1.2-17.el7.x86_64=C2=A0 =C2=A02/3Verirying:=C2=A0 postgresql= 11-server-11.1-1PGDB.rhel7.x86_64=C2=A0 =C2=A03/3 Installed:postgresql11-server.x86_64 0:11.1-1PGDG.rhel7Dependency Installed= :libicu.x86_64 0:50.1.2-17.el7=C2=A0 =C2=A0postgres11.x86_64 0:11.1-1PGDG.r= hel 7 Completed! After the server successful install, I initialize the database an # /usr/pgsql-11/bin/postgresql-11-setup initdbInitializing database .....OK # systemctl enable postgres-11created symlink from /etc/systemd/system/mult= i-user.target.wants/postgresql-11.service to /usr/lib/systemd/system/postge= resql-11.service. # systemctl start postgresql-11# systemctl status postgresql-11postgresql-1= 1.service - PostgreSQL 11 database serverLoaded:loaded (/usr/lib/systemd/sy= stem/postgresql-11.service; enabled; vendor preset: disabled)Active: active= (running) since Tues 2019-01-08 12:02:05 EST; 12s agoand so on .... # service postgresql initdbhint: the perferred way to do this is now "postg= resql-set initdb"Initializing database ... OK but when I tried to correct the postgres.conf with the listen_addresses =3D= '*' and port=3D5432.=C2=A0 Restart the postgresql server I get an error. redirecting to /bin/systemctl start postgresql.service job for postgresql.service failed because the control proces exited with er= ror code.=C2=A0 See "systemctl status postgresql.service" and "jouralctl -x= e" for details. I run:=C2=A0#systemctl status postgresql.service -lpostgresql.service - Pos= tgreSQL database serverLoaded:loaded (/usr/lib/systemd/system/postgresql.se= rvice; diabled; vendor preset: disabled)Active: failed (result: exit-code) = since Tues 2019-01-08 12:34:43 EST; 2min 22s agoProcess: 6896 ExecStart=3D/= usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=3Dexis= ted, status=3D1/FAILUREProcess: 688 ExecStartPre=3D/usr/bin/postgresql-chec= k-db-dir ${PGDATA} (code=3Dexisted, status=3D0/SUCCESS)=C2=A0=C2=A0Jan 08 1= 2:34:42 hostname pg_ctl[6896]:HINT: Is another postmaster alreadying runnin= ...yJan 08 12:34:42 hostname pg_ctl[6896]:LOG: could not bing IPV6 socket:= Addressa ...seJan 08 12:34:42 hostname pg_ctl[6896]:HINT: Is another postm= aster alreadying runnin ...yJan 08 12:34:42 hostname pg_ctl[6896]:WARNING: = could not create any TCP/IP socketsJan 08 12:34:43 hostname pg_ctl[6896]:pg= _ctl: could nto start serverJan 08 12:34:43 hostname pg_ctl[1]: postgresql.= service: control process existed, c...=3D1 Jan 08 12:34:43 hostname pg_ctl[1]: Failed to start PostgreSQL database ser= ver. Jan 08 12:34:43 hostname pg_ctl[1]: Unit postgresql.service entered failed = state. Jan 08 12:34:43 hostname pg_ctl[1]: postgresql.service failed Hint: Some lines were ellipsized, use -l to show in full what I did wrong here?=C2=A0 Do I need to add listen_addresses =3D '*' and = port =3D 5432 on both /var/lib/pgsql/data/postgres.conf and /var/lib/pgsql/= 11/data/postgres.conf ? thank you for all your help. v/r, Bach-Nga No one in this world is pure and perfect.=C2=A0 If you avoid people for the= ir 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 t= o 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 20, 2018 4:17 PM, Kris Deugau wro= te: Pepe TD Vo wrote: > May you suggest me exactly repositories packages needed for install=20 > PostgreSQL?=C2=A0 Seem to me this link,=20 > https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/=20 > all rpm files needed another dependencies.=C2=A0 Total more than 300 file= s=20 > and only a few allow me to install the rest of them needed another=20 > dependencies and didn't give me exactly what they are. Some of them will be from the stock Red Hat repositories, and some will=20 be from the PGDG repository.=C2=A0 I haven't used that repository, and I=20 haven't done much on an RPM-based system for a while so I can't give you=20 any more specific information. It's possible - but very tedious and difficult - to install a package=20 with a large dependency tree entirely by hand.=C2=A0 I *have* done this=20 myself in the past, and I recall a few cases where it literally took two=20 or three hours to get everything installed to support the specific=20 package I started out trying to install.=C2=A0 This is why tools like yum= =20 were developed;=C2=A0 they do the work of checking through the list to see= =20 what's required, and where it can be installed from. This isn't specific to Postgres;=C2=A0 it's how the underlying OS package= =20 system works.=C2=A0 You may want to see if someone in your office has more= =20 experience installing packages on RHEL with yum and ask them to give you=20 a hand.=C2=A0 You've got several issues around yum's basic operation that y= ou=20 need to fix, and local network/systems admins should know enough about=20 your setup to help a lot faster. -kgd =20 ------=_Part_11900701_295648402.1547152042120 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I trie= d both and none of them work.  

F= inally, I made it work.
1.  commented all of the= module and none being used /etc/pam.d/postgres
2. added extra 32 after address of = pg_hba.conf
3. I stop and start postgres as root fine without error.

thank you for all your h= elps.
Now I= need to learn/play how to create a new postgres DB

have a wonderful days.

v/r,
 
Bach-Nga

= No one in this world is pure and perfect.  If you avoid people for the= ir 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 ki= ndly.
*** Genuinely rich *** Faithful talent *** Sharing suc= cess


<= div class=3D"yahoo_quoted" style=3D"display: block;">
On Thursday, January 10, 2019 3:06 PM, Ricardo Martin Gomez <rimarti= ngomez@hotmail.com> wrote:


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=C3=ADn Gomez
DBA - SysAdmin

De: Pepe TD Vo &l= t;pepevo@yahoo.com>
Enviado: jueves, 10 de enero de 2019 13:04
Para: Shreeyansh Dba
Cc: Kris Deugau; pgsql-admin@lists.postgresql.org
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 pos= tgres.  Nothing is running and start the service as 'service posgresql start" I still get eh error 
'Job fo= r 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=3D//usr/bin/pg_ctl start =E2=80=93D ${PGDATA} =E2=80=93s = =E2=80=93o =E2=80=93p ${PGPORT} =E2=80=93w =E2=80=93t 300 (code=3Dexisted, = status=3D1/FAILURE)
Jan 10 09:18:23 hostname s= ystemd[1]: Starting PosgreSQL database server=E2=80=A6
Jan 10 09:18:23 hostname [= pg_ctl[20639]: FATAL: could not re= move old lock file =E2=80=9C/t=E2=80=A6ed
Jan 10 09:18:23 hostname [= pg_ctl[20639]: HINT: the file seems accidentally lef ov =E2=80=A6n.<= /div>
Jan 10 09:18:24 hostname [= pg_ctl[20639]: pg_ctl: could not start server
Jan 10 09:18:24 hostname s= ystemd[1]:postgresql.service: control process existed, c=E2=80=A6=3D1
Jan 10 09:18:24 hostname s= ystemd[1]:Failed to start PostgreSQL database server.
Jan 10 09:18:24 hostname s= ystemd[1]:Unit postgresql.service entered failed state.
Jan 10 09:18:24 hostname s= ystemd[1]:postgresql.service failed
Hint: some lines were elli= psized, use =E2=80=93l to show in full.
 
From journal-xe, = I see:
--Unit session -1= 0325.scope has finished starting up.
--The start-up re= sult is done
Jan 10 09:20:01 h= ostname systemd[1]: Starting session 10325 of user root
--Unit session-10= 325.scope has begun starting up
Jan 10 09:20:01 h= ostname systemd[1]: Removed slice User Slice of root
--Unit user-0.sli= ce has finished shutting down.
Jan 10 09:20:01 h= ostname systemd[1]: Stopping User Slice of root
--Unit user-0.sli= ce has begun shutting down.
 
When I grep postg= res from systemctl, it loaded failed failed
#systemctl list-u= nits|grep posgresql
a postgresql-11.s= ervice loaded failed failed
PostgreSQL 11 dat= abase server
#pg_ctl start
pg_ctl: cannot be= run as root
Please log in (us= ing, e.g., =E2=80=9Csu) as the (unprivileged) user that will own the server process.
# su postgres
[postgres@hostnam= e]$ pg_ctl start
Pg_ctl: no databa= se directory specified and environment variable PGDATA unset
Try = =E2=80=9Cpg_ctl =E2=80=93help=E2=80=9D for more information.


I am new to Postgresql and any information provide will be appreciated.

thank you.

v/r,

 
<= font color=3D"#8000ff">
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 perfe= ct gentleman (Hermione Gingold)

**Live simply **Love generously **Care deeply **Speak= kindly.
*** Genuinely rich *** Faithful tale= nt *** Sharing success


On Wednesday, January 9, 2= 019 2:16 AM, Shreeyansh Dba <shreeyansh2014@gmail.com> wrote:


Try to specify the= exact name for the PostgreSQL service, which you can find under the list o= f services, using systemctl.

systemctl list-uni= ts|grep postgresql

Then you can use t= he service or systemctl command.
Or
Better to use pg_c= tl to start/stop PostgreSQL server.

Thanks & Regards,
Shreeyansh DBA Team
www.shreeyansh.com


On Wed, Jan 9, 2019 at 12:03 AM Pepe TD Vo <pepevo@yahoo.com> wrote:
sorry, my fingers split before I can finish all typing:




finally the SA installed the O= S libraries and I installed the server packages successful but not postgres= 11-contrib.
#yum install postgresql11-serv= er postgresql11-contrib  --> I see no package postgresql11-contrib = availabe
Dependencies resolved
Transaction test succeeded
running transaction 
installing: libicu-50.1.2.17.el7.x86_64   1/2
Installing: postgresql11-11.1-1PGDG.rhel7.x86_64   2/3
failed to link /usr/bin/psql -> /etc/alternative/pgsql-psql: /usr/bin/pg= ql exists and it's not a a symlink
failed to link /usr/bin/clusterdb -> /etc/alternatives/pgsql-clusterdb: = /usr/bin/clusterdb exist and itis not a symlink

failed to link /usr/bin/createdb -> /etc/alternatives/pgsql-createdb: /u= sr/bin/createdb exist and it is not a symlink
failed to link /usr/bin/createuser -> /etc/alternatives/pgsql-createuser= : /usr/bin/createuse exist and it is not a symlink
failed to link /usr/bin/dropdb -> /etc/alternatives/pgsql-dropdb: /usr/b= in/dropdb exist and it is not a symlink
failed to link /usr/bin/dropuser -> /etc/alternatives/pgsql-dropuser: /u= sr/bin/dropuser exist and it is not a symlink
failed to link /usr/bin/pg_basebackup -> /etc/alternatives/pgsql-pg_base= backup: /usr/bin/pg_basebackup exist and itis not a symlink
failed to link /usr/bin/pg_dump -> /etc/alternatives/pgsql-pg_dump: /usr= /bin/pg_dump exist and it is not a symlink
failed to link /usr/bin/pg_dumpall -> /etc/alternatives/pgsql-pg_dumpall= : /usr/bin/pg_dumpall exist and it is not a symlink
failed to link /usr/bin/pg_restore -> /etc/alternatives/pgsql-pg_restore= : /usr/bin/pg_restore exist and it is not a symlink
failed to link /usr/bin/reindexdbl -> /etc/alternatives/pgsq-reindexdb: = /usr/bin/reindexdb exist and it is not a symlink
failed to link /usr/bin/vacuumdb -> /etc/alternatives/pgsql-vacuumdb: /u= sr/bin/vacuumdbexist and it is not a symlink

installing:  postgresql11-server-11.1-1PGDB.rhel7.x86_64 &nb= sp; 1/3

Verifying:  postgresql11-11.1-1PGDB.rhel7.x86_64   1/3
Verifying: libicu-50.1.2-17.el7.x86_64   2/3
Verirying:  postgresql11-server-11.1-1PGDB.rhel7.x86_64   3/= 3

Installed:
postgresql11-server.x86_64 0:11.1-1PGDG.rhel7
Dependency Installed:
libicu.x86_64 0:50.1.2-17.el7   postgres11.x86_64 0:11.1-1PGDG.rh= el 7

Completed!

After the server successful install, I initialize the database an

# /usr/pgsql-11/bin/postgresql-11-setup initdb
Initializing database .....OK

# systemctl enable postgres-11
created symlink from /etc/systemd/system/multi-user.target.wants/postgresql= -11.service to /usr/lib/systemd/system/postgeresql-11.service.

# systemctl start postgresql-11
# systemctl status postgresql-11
postgresql-11.service - PostgreSQL 11 database server
Loaded:loaded (/usr/lib/systemd/system/postgresql-11.service; enabled; vend= or preset: disabled)
Active: active (running) since Tues 2019-01-08 12:02:05 EST; 12s ago
and so on ....

# service postgresql initdb
hint: the perferred way to do this is now "postgresql-set initdb"
Initializing database ... OK

but when I tried to correct the postgres.conf with the listen_addresses =3D= '*' and port=3D5432.  Restart the postgresql server I get an error.

redirecting to /bin/systemctl start postgresql.service

job for postgresql.service failed because the control proces exited with er= ror code.  See "systemctl status postgresql.service" and "jouralctl -x= e" for details.

I run: 
#systemctl status postgresql.service -l
postgresql.service - PostgreSQL database server
Loaded:loaded (/usr/lib/systemd/system/postgresql.service; diabled; vendor = preset: disabled)
Active: failed (result: exit-code) since Tues 2019-01-08 12:34:43 EST; 2min= 22s ago
Process: 6896 ExecStart=3D/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGP= ORT} -w -t 300 (code=3Dexisted, status=3D1/FAILURE
Process: 688 ExecStartPre=3D/usr/bin/postgresql-check-db-dir ${PGDATA} (cod= e=3Dexisted, status=3D0/SUCCESS) 
 
Jan 08 12:34:42 hostname pg_ctl[6896]:HINT: Is another postmaster alreadyin= g runnin ...y
Jan 08 12:34:42 hostname pg_ctl[6896]:LOG: could not bing IPV6 socket: Addr= essa ...se
Jan 08 12:34:42 hostname pg_ctl[6896]:HINT: Is another postmaster alreadyin= g runnin ...y
Jan 08 12:34:42 hostname pg_ctl[6896]:WARNING: could not create any TCP/IP = sockets
Jan 08 12:34:43 hostname pg_ctl[6896]:pg_ctl: could nto start server
Jan 08 12:34:43 hostname pg_ctl[1]: postgresql.service: control process exi= sted, c...=3D1
Jan 08 12:34:43 hostname pg_ctl[1]: Failed to start PostgreSQL database ser= ver.
Jan 08 12:34:43 hostname pg_ctl[1]: Unit postgresql.service entered failed = state.
Jan 08 12:34:43 hostname pg_ctl[1]: postgresql.service failed

Hint: Some lines were ellipsized, use -l to show in full

what I did wrong here?  Do I need to add listen_addresses =3D '*' and = port =3D 5432 on both /var/lib/pgsql/data/postgres.conf and /var/lib/pgsql/= 11/data/postgres.conf ?

thank you for all your help.

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 Gingol= d)

= **Live simply **Love generously **Care deeply **Speak kindly.
*** Genuinely rich *** Faithful talent *** Sharing success


On Thursday, December 20, 2018 4:17 PM, Kri= s Deugau <kdeugau@viane= t.ca> wrote:


Pepe TD Vo wrote:
> May you suggest me exactly repositories packages needed for install > PostgreSQL?  Seem to me this link,
> https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/ =
> all rpm files needed another dependencies.  Total more than 300 f= iles
> and only a few allow me to install the rest of them needed another > dependencies and didn't give me exactly what they are.

Some of them will be from the stock Red Hat repositories, and some will be from the PGDG repository.  I haven't used that repository, and I haven't done much on an RPM-based system for a while so I can't give you any more specific information.

It's possible - but very tedious and difficult - to install a package
with a large dependency tree entirely by hand.  I *have* done this myself in the past, and I recall a few cases where it literally took two or three hours to get everything installed to support the specific
package I started out trying to install.  This is why tools like yum <= br clear=3D"none"> were developed;  they do the work of checking through the list to see =
what's required, and where it can be installed from.

This isn't specific to Postgres;  it's how the underlying OS package <= br clear=3D"none"> system works.  You may want to see if someone in your office has more =
experience installing packages on RHEL with yum and ask them to give you a hand.  You've got several issues around yum's basic operation that y= ou
need to fix, and local network/systems admins should know enough about
your setup to help a lot faster.


-kgd









------=_Part_11900701_295648402.1547152042120--