Home Forums HDP on Linux – Installation Automatically starting services

This topic contains 1 reply, has 2 voices, and was last updated by  tedr 10 months, 2 weeks ago.

  • Creator
    Topic
  • #27050

    finance turd
    Member

    I am running Horonworks/Ambari on a single VM for development purposes. We have an automated install for our multi-node production environment.

    I have added to /etc/rc.local:
    ambari-server restart
    ambari-agent restart

    And they both start up after system reboot… however…

    None of the Hadoop services (HDFS, Namenode, Oozie, etc.) are started.

    I have to go into Ambari and click on each one, and that’s really a pain.

    I tried to look to see what the command is to start these myself, but it’s not self-evident, at least not to me.

    Could you please tell me what commands to add to execute on system start-up to bring up not only ambari but also the Hadoop services that Ambari manages?

    Thank you.

    FT

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.

  • Author
    Replies
  • #27104

    tedr
    Moderator

    Hi Finance,

    You can add these commands to your start/stop scripts:

    Stop Services

    curl –user admin:$PASSWORD -i -X PUT -d ‘{“ServiceInfo”: {“state” : “INSTALLED”}}’ http://$HOST:8080/api/v1/clusters/$CLUSTER_NAME/services/$SERVICE

    Start Services

    curl –user admin:$PASSWORD -i -X PUT -d ‘{“ServiceInfo”: {“state” : “STARTED”}}’ http://$HOST:8080/api/v1/clusters/$CLUSTER_NAME/services/$SERVICE

    You will need to set the following environment variables in your script:
    PASSWORD = the password for the Ambari admin user
    CLUSTER_NAME = the name you gave to your cluster
    SERVICE = one of (HDFS, MAPREDUCE, WEBHCAT, ZOOKEEPER, OOZIE, HBASE, HCATALOG, HIVE, GANGLIA, NAGIOS) – this is the order that is best to start the services, reverse it for stopping them.

    Thanks,
    Ted.

    Collapse
Viewing 1 replies (of 1 total)