[ 
https://issues.apache.org/jira/browse/AMBARI-12510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14724307#comment-14724307
 ] 

Tuong Truong commented on AMBARI-12510:
---------------------------------------

Here it is:

[xxxx~]# service postgresql stop
Redirecting to /bin/systemctl stop  postgresql.service
[xxxx~]# service postgresql status
Redirecting to /bin/systemctl status  postgresql.service
postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled)
   Active: failed (Result: exit-code) since Wed 2015-08-19 14:02:32 PDT; 1 
weeks 5 days ago
  Process: 1604 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} 
-w -t 300 (code=exited, status=1/FAILURE)
  Process: 1599 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} 
(code=exited, status=0/SUCCESS)

Aug 19 14:02:32 xxxx pg_ctl[1604]: pg_ctl: this data directory appears to be 
running a pre-existing postmaster
Aug 19 14:02:32 xxxx pg_ctl[1604]: pg_ctl: could not start server
Aug 19 14:02:32 xxxx pg_ctl[1604]: Examine the log output.
Aug 19 14:02:32 xxxx systemd[1]: postgresql.service: control process exited, 
code=exited status=1
Aug 19 14:02:32 xxxx systemd[1]: Failed to start PostgreSQL database server.
Aug 19 14:02:32 xxxx systemd[1]: Unit postgresql.service entered failed state.
Aug 31 15:35:49 xxxx systemd[1]: Stopped PostgreSQL database server.
[xxxx ~]# yum list postgresql
Loaded plugins: langpacks, product-id, rhnplugin, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use 
subscription-manager to register.
This system is receiving updates from RHN Classic or Red Hat Satellite.
rhel-x86_64-server-7                                                            
                                                       | 1.5 kB  00:00:00
Installed Packages
postgresql.x86_64                                                     
9.2.13-1.el7_1                                                     
@rhel-x86_64-server-7
Available Packages
postgresql.i686                                                       
9.2.13-1.el7_1                                                     
rhel-x86_64-server-7
[xxxx ~]# service postgresql status
Redirecting to /bin/systemctl status  postgresql.service
postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled)
   Active: failed (Result: exit-code) since Wed 2015-08-19 14:02:32 PDT; 1 
weeks 5 days ago
  Process: 1604 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} 
-w -t 300 (code=exited, status=1/FAILURE)
  Process: 1599 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} 
(code=exited, status=0/SUCCESS)

Aug 19 14:02:32 xxxx pg_ctl[1604]: pg_ctl: this data directory appears to be 
running a pre-existing postmaster
Aug 19 14:02:32 xxxx pg_ctl[1604]: pg_ctl: could not start server
Aug 19 14:02:32 xxxx pg_ctl[1604]: Examine the log output.
Aug 19 14:02:32 xxxx systemd[1]: postgresql.service: control process exited, 
code=exited status=1
Aug 19 14:02:32 xxxx systemd[1]: Failed to start PostgreSQL database server.
Aug 19 14:02:32 xxxx systemd[1]: Unit postgresql.service entered failed state.
Aug 31 15:35:49 xxxx systemd[1]: Stopped PostgreSQL database server.
[xxxx ~]# echo $?
3


> ambari-server failed to properly detect of postgresql database status on RHEL 
> 7.x 
> ----------------------------------------------------------------------------------
>
>                 Key: AMBARI-12510
>                 URL: https://issues.apache.org/jira/browse/AMBARI-12510
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 2.1.0
>         Environment: RHEL 7.0, 7.1
>            Reporter: Tuong Truong
>            Assignee: Tuong Truong
>              Labels: RHEL7.1
>             Fix For: 2.1.2
>
>         Attachments: AMBARI-12510-0.patch
>
>
> Ambari-server failed to initalize the postgre db when postgresql packages are 
> installed as part of Ambari installation on RHEL 7.1, and 7.0 in some 
> scenario.  
> Ambari-server detects status of Postgre via the "service postgresql status" 
> call, and perform regex on  the output for "running" or "stopped".   This 
> works OK for RHEL 6, but not for RHEL 7 as its output may include "running" 
> when postgres is not actually running.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to