Return-Path: X-Original-To: apmail-ambari-user-archive@www.apache.org Delivered-To: apmail-ambari-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 02904184AB for ; Mon, 16 Nov 2015 21:28:21 +0000 (UTC) Received: (qmail 42893 invoked by uid 500); 16 Nov 2015 21:28:20 -0000 Delivered-To: apmail-ambari-user-archive@ambari.apache.org Received: (qmail 42860 invoked by uid 500); 16 Nov 2015 21:28:20 -0000 Mailing-List: contact user-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ambari.apache.org Delivered-To: mailing list user@ambari.apache.org Received: (qmail 42849 invoked by uid 99); 16 Nov 2015 21:28:20 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Nov 2015 21:28:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 51CBBC579D for ; Mon, 16 Nov 2015 21:28:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id xx4PBbwF5DSs for ; Mon, 16 Nov 2015 21:28:10 +0000 (UTC) Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id DE9F420C40 for ; Mon, 16 Nov 2015 21:28:09 +0000 (UTC) Received: by wmec201 with SMTP id c201so198302299wme.0 for ; Mon, 16 Nov 2015 13:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=SiYBfxMmhOMhECCueaIQnSqzlw6yf03r8zPXyby9YT8=; b=R2tD7F8m/5NsugDeTNczJerugbJzi4SmbwGIedkNscqU4iW/2Tcp8snnkx2xCpObW9 PxxWQFFPKDsVFs3XpL9+xcgm3J3zcJ/+LtMXui/EazTzma0dqkMi252Q0axTx0hwJl2i RHNy8mSdgPXt9ypMtMm40YdB0mM2LdCV32I+rInH70nB6yBmXA+vQgGoLUqokmVIC3Qb iIXiX7pJBM4FUqM8UY4KLxyAjYpCRmop4FckE1BgGVaAU816XC4IMNwydEYCOZC0BQX3 i1yRdPHPX7FehSaz8f742h+uEJruf5Z9FEt6KefSmqVNKXi7BgH6YmonmUmehbEelybN JPig== MIME-Version: 1.0 X-Received: by 10.28.9.204 with SMTP id 195mr22758749wmj.88.1447709289626; Mon, 16 Nov 2015 13:28:09 -0800 (PST) Received: by 10.194.156.169 with HTTP; Mon, 16 Nov 2015 13:28:09 -0800 (PST) In-Reply-To: References: Date: Mon, 16 Nov 2015 16:28:09 -0500 Message-ID: Subject: Re: simple ambari service startup script? From: James Tanner To: user@ambari.apache.org Content-Type: multipart/alternative; boundary=001a114428b0f244660524af1514 --001a114428b0f244660524af1514 Content-Type: text/plain; charset=UTF-8 Nice, I will try that. Thank you. On Mon, Nov 16, 2015 at 4:21 PM, Bhuvnesh Chaudhary wrote: > You may directly call the API to start and stop all the services which > will take care of starting them in the required order instead of doing them > one by one if that achieves what you are looking for. > > For example: To stop, > Hit the URL of the form: > url = "http://" + + ":8080/api/v1/clusters/" + > + "/services?" > > Have the payload as below. > data = { > "RequestInfo":{ > "context":"Stop all > services","operation_level":{"level":"CLUSTER","cluster_name": } > },"Body":{"ServiceInfo":{"state":"INSTALLED"}} > } > > For start just change the state to "STARTED" > > Thanks, > Bhuvnesh Chaudhary > Email: bchau dhary@pivotal.io > Desk: +1-650-846-1696 | Mobile: +1-973-906-6976 > > On Mon, Nov 16, 2015 at 1:06 PM, James Tanner wrote: > >> Has anyone written and can share a bash/python script that will start and >> stop -all- ambari managed services in the right order? >> >> I'm trying to build images that will start services on boot and kill them >> on shutdown, so I need something suitable for sysvinit+systemd. >> > > --001a114428b0f244660524af1514 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Nice, I will try that. Thank you.

On Mon, Nov 16, 2015 at 4:21 PM, Bhu= vnesh Chaudhary <bchaudhary@pivotal.io> wrote:
You may directly call the API to = start and stop all the services which will take care of starting them in th= e required order instead of doing them one by one if that achieves what you= are looking for.

For example: To stop,=C2=A0
= Hit the URL of the form:
url =3D "http://" + <a= mbari-server-address> + ":8080/api/v1/clusters/" + <ambari-= cluster-name> + "/services?"

Have the= payload as below.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 data =3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "RequestInfo":{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "context= ":"Stop all services","operation_level":{"lev= el":"CLUSTER","cluster_name":=C2=A0<ambari-clus= ter-name>}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 },"B= ody":{"ServiceInfo":{"state":"INSTALLED"= }}
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

F= or start just change the state to=C2=A0"STARTED"

Thank= s,
Bhuvnesh Chaudhary

On Mon, Nov 16, 2015 at 1:06 PM, James Tanne= r <tanner.jc@gmail.com> wrote:
Has anyone written and can share a bash/python= script that will start and stop -all- ambari managed services in the right= order?

I'm trying to build images that will start servic= es on boot and kill them on shutdown, so I need something suitable for sysv= init+systemd.


--001a114428b0f244660524af1514--