ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Qing Chi 79624 <c...@vmware.com>
Subject Re: Questions about ambari REST API
Date Tue, 03 Jun 2014 05:24:15 GMT
Hi Yusaku,

Thank you for clarify this issue.

-qing

On 6/3/14 1:15 PM, "Yusaku Sako" <yusaku@hortonworks.com> wrote:

>Ambari currently supports single clusters only, though the REST API
>resource tree was designed with multiple cluster in mind.
>If you use the Ambari Web UI, there's actually code to delete any
>existing cluster when deploying a new cluster.
>This delete logic is there to get around partial failure to re-try
>installation from a clean slate.
>That's why you are seeing the existing cluster installed with the API
>disappear.
>
>Yusaku
>
>On Mon, Jun 2, 2014 at 8:56 PM, Qing Chi 79624 <chiq@vmware.com> wrote:
>> Hi,
>>
>> I did not use Ambari Blueprints API. I will use it to create cluster.
>> Thanks for your help.
>>
>> -qing
>>
>> From: Jeff Sposetti <jeff@hortonworks.com>
>> Reply-To: <user@ambari.apache.org>
>> Date: Mon, 2 Jun 2014 20:51:04 -0700
>> To: <user@ambari.apache.org>
>> Cc: Emma Lin <line@vmware.com>, Xiaoding Bian <xiaodingbian@vmware.com>
>> Subject: Re: Questions about ambari REST API
>>
>> Hi,
>>
>> How did you create your cluster? Did you use the Ambari Blueprints API
>>(and
>> are using the Ambari 1.6.0 release)?
>>
>> 
>>https://urldefense.proofpoint.com/v1/url?u=https://cwiki.apache.org/confl
>>uence/display/AMBARI/Blueprints&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=XFP
>>etyuh5lGv3twiMNs7nw%3D%3D%0A&m=dcUf3UlbKMBsmGIyqFcBeThu2xKfq1z7h5%2FjvI0U
>>b6o%3D%0A&s=6a695a399a7b207d089bd84f37908a52772ca02ba45cf24de691a21986ab1
>>079
>>
>> J
>>
>> On Mon, Jun 2, 2014 at 8:46 PM, Qing Chi 79624 <chiq@vmware.com> wrote:
>>>
>>> Hello guys,
>>>
>>> I'm working on provisioning cluster through Ambari now using REST API.
>>>And
>>> I have some questions about ambari REST API.
>>> Questions,:
>>>
>>> Can only manage a cluster in Ambari?
>>> How to install packages of service using ambari REST API?
>>> Why the cluster which created by REST API would disappear after create
>>> another cluster using ambari Web UI? Steps:
>>>
>>> a)  Create a cluster named "apache" using REST API and add hosts,
>>> services, components and configurations to the cluster.
>>> b)  Create another cluster named "test" using ambari Web UI, and
>>>persist
>>> it.
>>> c)  open this URL
>>>https://urldefense.proofpoint.com/v1/url?u=http://10.111.88.146:8080/api
>>>/v1/clusters&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=XFPetyuh5lGv3twiMNs7n
>>>w%3D%3D%0A&m=dcUf3UlbKMBsmGIyqFcBeThu2xKfq1z7h5%2FjvI0Ub6o%3D%0A&s=e3cbc
>>>31cc2942453d12b4058e6a68165a53abd44f95092cb81dabe6d7a790fef on browser.
>>> Following is result:
>>> {
>>> "href" : 
>>>"https://urldefense.proofpoint.com/v1/url?u=http://10.111.88.146:8080/ap
>>>i/v1/clusters&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=XFPetyuh5lGv3twiMNs7
>>>nw%3D%3D%0A&m=dcUf3UlbKMBsmGIyqFcBeThu2xKfq1z7h5%2FjvI0Ub6o%3D%0A&s=e3cb
>>>c31cc2942453d12b4058e6a68165a53abd44f95092cb81dabe6d7a790fef",
>>> "items" : [
>>> {
>>> "href" : 
>>>"https://urldefense.proofpoint.com/v1/url?u=http://10.111.88.146:8080/ap
>>>i/v1/clusters/test&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=XFPetyuh5lGv3tw
>>>iMNs7nw%3D%3D%0A&m=dcUf3UlbKMBsmGIyqFcBeThu2xKfq1z7h5%2FjvI0Ub6o%3D%0A&s
>>>=4a992d82b806bb88230145f69baf82f4cdc1e9887fe1c1d051e381ca39836a9a",
>>> "Clusters" : {
>>> "cluster_name" : "test",
>>> "version" : "HDP-2.1"
>>> }
>>> }
>>> ]
>>> }
>>> I am confused where is the cluster named "apache". But I rerun the
>>>command
>>> to create a cluster named "apache". It will give me the
>>>message("Attempted
>>> to create a Cluster which already exists, clusterName=apache").
>>> Command:
>>> curl -H "X-Requested-By: ambari" -X POST -d "@cluster" --user
>>> "admin:admin" -i
>>>https://urldefense.proofpoint.com/v1/url?u=http://10.141.73.168:8080/api
>>>/v1/clusters/apache&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=XFPetyuh5lGv3t
>>>wiMNs7nw%3D%3D%0A&m=dcUf3UlbKMBsmGIyqFcBeThu2xKfq1z7h5%2FjvI0Ub6o%3D%0A&
>>>s=a8f45159268465f104ac9d28f718b2d7e7d7f184f48e3f667387845a012749e9
>>> {
>>> "Clusters":
>>>  {
>>> "cluster_name": "apache",
>>>  "version":"HDP-2.0"
>>>  }
>>> }
>>> Response:
>>> HTTP/1.1 409 Conflict
>>> Set-Cookie: AMBARISESSIONID=1kcj0ocdogqm9ggvn4m2ekbng;Path=/
>>> Expires: Thu, 01 Jan 1970 00:00:00 GMT
>>> Content-Type: text/plain
>>> Content-Length: 108
>>> Server: Jetty(7.6.7.v20120910)
>>> {
>>> "status" : 409,
>>> "message" : "Attempted to create a Cluster which already exists,
>>> clusterName=apache"
>>> }
>>>
>>> Can you give me some helps for these questions?
>>>
>>> Thanks,
>>>
>>> -qing
>>
>>
>>
>> CONFIDENTIALITY NOTICE
>> NOTICE: This message is intended for the use of the individual or
>>entity to
>> which it is addressed and may contain information that is confidential,
>> privileged and exempt from disclosure under applicable law. If the
>>reader of
>> this message is not the intended recipient, you are hereby notified
>>that any
>> printing, copying, dissemination, distribution, disclosure or
>>forwarding of
>> this communication is strictly prohibited. If you have received this
>> communication in error, please contact the sender immediately and
>>delete it
>> from your system. Thank You.
>
>-- 
>CONFIDENTIALITY NOTICE
>NOTICE: This message is intended for the use of the individual or entity
>to 
>which it is addressed and may contain information that is confidential,
>privileged and exempt from disclosure under applicable law. If the reader
>of this message is not the intended recipient, you are hereby notified
>that 
>any printing, copying, dissemination, distribution, disclosure or
>forwarding of this communication is strictly prohibited. If you have
>received this communication in error, please contact the sender
>immediately 
>and delete it from your system. Thank You.


Mime
View raw message