Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-14807

Systemd on RHEL/CentOS 7.2 breaks ambari-server startup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.2.2
    • None
    • None

    Description

      Systemd on RHEL/CentOS 7.2 breaks Ambari startup.

      Users are unable to automate the startup of Ambari services

      Steps to Reproduce:

      1\. Install RHEL 7.2
      2\. Configure env for Ambari
      3\. Install Ambari 2.2.0
      4\. Configure Ambari
      5\. Start Ambari
      6\. Try using systemd to work with Ambari eg. systemctl status ambari-server

      Expected behaviour:

      Under RHEL 7.1 this worked, sample output:

      [root@node1 ~]# systemctl status ambari-server
      ambari-server.service - SYSV: ambari-server daemon
      Loaded: loaded (/etc/rc.d/init.d/ambari-server)
      Active: active (running) since Mon 2016-01-18 15:46:08 GMT; 16h ago
      Process: 903 ExecStart=/etc/rc.d/init.d/ambari-server start (code=exited, status=0/SUCCESS)
      CGroup: /system.slice/ambari-server.service
      └─2343 /usr/jdk64/jdk1.8.0_40/bin/java -server -XX:NewRatio=3 -XX:+UseConcMarkSweepGC -XX:-UseGCOverheadLimit -XX:CMSInit...

      Jan 18 15:45:51 node1.node1.com ambari-server[903]: Ambari Server running with administrator privileges.
      Jan 18 15:45:51 node1.node1.com ambari-server[903]: Running initdb: This may take upto a minute.
      Jan 18 15:45:51 node1.node1.com ambari-server[903]: About to start PostgreSQL
      Jan 18 15:45:51 node1.node1.com ambari-server[903]: Organizing resource files at /var/lib/ambari-server/resources...
      Jan 18 15:45:51 node1.node1.com ambari-server[903]: Server PID at: /var/run/ambari-server/ambari-server.pid
      Jan 18 15:45:51 node1.node1.com ambari-server[903]: Server out at: /var/log/ambari-server/ambari-server.out
      Jan 18 15:45:51 node1.node1.com ambari-server[903]: Server log at: /var/log/ambari-server/ambari-server.log
      Jan 18 15:46:08 node1.node1.com ambari-server[903]: Waiting for server start...................
      Jan 18 15:46:08 node1.node1.com ambari-server[903]: Ambari Server 'start' completed successfully.
      Jan 18 15:46:08 node1.node1.com systemd[1]: Started SYSV: ambari-server daemon.

      Actual Behaviour:

      [root@ip-172-30-0-10 ec2-user]# systemctl status ambari-server
      ● ambari-server.service
      Loaded: not-found (Reason: No such file or directory)
      Active: inactive (dead)
      [root@ip-172-30-0-10 ec2-user]#

      Analysis:

      I have tested this on Ambari 2.2.0 on CentOS 7.1 and RHEL 7.2 and can confirm
      that it's broken on 7.2.

      Rackspace discovered this and provided the following feedback:

      Version 7.2 of CentOS/RHEL includes a new version of systemd that breaks how
      the ambari-server is started up.
      The init.d script from the ambari-server package is not recognized anymore and
      not added to systemd, thus ambari-server cannot start at boot time anymore:

      [root@server-02 ~]# rpm -qa|grep ambari
      ambari-agent-2.2.0.0-1310.x86_64
      ambari-server-2.2.0.0-1310.x86_64
      [root@server-02 ~]# cat /etc/redhat-release
      CentOS Linux release 7.2.1511 (Core)
      [root@server-02 ~]# systemctl daemon-reload
      [root@server-02 ~]# systemctl status ambari-server
      ● ambari-server.service
      Loaded: not-found (Reason: No such file or directory)
      Active: inactive (dead)
      [root@server-02 ~]#

      I believe this is because /etc/rc.d/init.d/ambari-server is a symlink.
      ambari-agent init script still works just fine:

      [root@server-02 ~]# ls l /etc/rc.d/init.d/ambari*
      -rwxr-xr-x. 1 root root 1628 Dec 20 23:34 /etc/rc.d/init.d/ambari-agent
      lrwxrwxrwx. 1 root root 23 Jan 20 10:18 /etc/rc.d/init.d/ambari-server -> /usr/sbin/ambari-server
      [root@server-02 ~]# systemctl status ambari-agent
      ● ambari-agent.service - SYSV: ambari-agent daemon
      Loaded: loaded (/etc/rc.d/init.d/ambari-agent)

      If I remove the symlink and copy the /usr/sbin/ambari-server then systemd
      works again just fine:

      [root@server-02 ~]# unlink /etc/rc.d/init.d/ambari-server && cp -a /usr/sbin/ambari-server /etc/rc.d/init.d/ambari-server && systemctl daemon-reload
      [root@server-02 ~]# systemctl status ambari-server
      ● ambari-server.service - SYSV: ambari-server daemon
      Loaded: loaded (/etc/rc.d/init.d/ambari-server)

      So please have this fixed as currently, by default, ambari-server startup is
      broken in CentOS/RHEL 7.2

      Attachments

        1. AMBARI-14807.patch
          4 kB
          Andrew Onischuk

        Issue Links

          Activity

            People

              aonishuk Andrew Onischuk
              aonishuk Andrew Onischuk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: