Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4C995186BC for ; Wed, 14 Oct 2015 08:54:05 +0000 (UTC) Received: (qmail 20105 invoked by uid 500); 14 Oct 2015 08:54:05 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 20071 invoked by uid 500); 14 Oct 2015 08:54:05 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 20051 invoked by uid 99); 14 Oct 2015 08:54:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Oct 2015 08:54:05 +0000 Date: Wed, 14 Oct 2015 08:54:05 +0000 (UTC) From: "Laszlo Puskas (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMBARI-13398) Blueprints: Implement REST resource for storing Kerberos descriptors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-13398?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Laszlo Puskas updated AMBARI-13398: ----------------------------------- Attachment: AMBARI-13398.patch > Blueprints: Implement REST resource for storing Kerberos descriptors > -------------------------------------------------------------------- > > Key: AMBARI-13398 > URL: https://issues.apache.org/jira/browse/AMBARI-13398 > Project: Ambari > Issue Type: Bug > Components: ambari-server > Affects Versions: trunk > Reporter: Laszlo Puskas > Assignee: Laszlo Puskas > Labels: patch > Fix For: 2.1.3 > > Attachments: AMBARI-13398.patch > > > h2. Support for saving a Kerberos descriptor to the REST API in Ambari > In order to support referring to a Kerberos descriptor by name in the Clu= ster Creation Template (POST-ing a Kerberos descriptor to a REST resource, = then referring to it during Blueprint deployment), we=E2=80=99ll need a new= REST resource defined in the Ambari REST API. =20 > We=E2=80=99ll need the ability to POST a kerberos.json descriptor documen= t to: > http://ambari-host:ambari-port/api/v1/kerberos_descriptors/kerberos_descr= iptor_name > Where {code}kerberos_descriptors{code} is the collection resource for all= Kerberos descriptors to be saved to the back end. This can be any number = of descriptors that are POST-ed, and the fact that a descriptor is posted h= ere is not necessarily an indicator that it is used in a cluster deployment= . This is similar to how the {code}blueprints{code} resource works, in tha= t the documents are saved in the Ambari DB to be referenced later by deploy= ments (Blueprint deployments in our case).=20 > The {code}kerberos_descriptor_name{code} can be any arbitrary name given = to the customer=E2=80=99s customized kerberos descriptor. This can be a pa= rtial document, listing only the overrides necessary, as the default Kerber= os descriptors will be merged by the Kerberos framework when the Kerberizat= ion is setup. =20 > For most Blueprint deployments that require Kerberos, the Blueprint or Cl= uster creation template will reference this =E2=80=9Ckerberos_descriptor_na= me=E2=80=9D when indicating the kerberos descriptor used to configure Kerbe= ros for this cluster.=20 > There needs to be support for: > 1. POST-ing a Kerberos descriptor to this REST endpoint > 2. Obtaining the list of Kerberos descriptors by making a GET call on the= following URL: > http://ambari-host:ambari-port/api/v1/kerberos_descriptors > 3. Obtaining a named Kerberos descriptor by making a GET call on the foll= owing URL: > http://ambari-host:ambari-port/api/v1/kerberos_descriptors/kerberos_descr= iptor_name > This portion of the Blueprints Kerberos support is not necessarily Bluepr= int-specific, and should be implemented without any direct references to Bl= ueprint code or constructs. =20 > h2. Ambari Database Upgrade issues=20 > The addition of this new resource type will require the creation of one m= ore more database tables in order to store the Kerberos descriptors in the = Ambari back-end. =20 > This current task will encompass any Database table changes needed to mak= e these additions, and will also likely require some ambari-server Upgrade = handling. This will involve using the existing Ambari Upgrade utilities to = support moving from older Ambari installs to Ambari 2.2. The main work here= will be updating existing database tables to support the new structure. Fo= r this particular task, this will likely mean that an upgrade will need to = add the new tables to the Ambari Database. =20 > h2. Existing Example of this type of resource > The Ambari REST API includes many services and ResourceProvider implement= ations that could serve as a model for this implementation. The "blueprint= s" resource is probably the most straightforward in this case. =20 > Example of a Service interface that must be defined for each resource: > {code}org.apache.ambari.server.api.services.BlueprintService{code} > Example of a ResourceProvider implementation that must be defined for eac= h resource: > {code}org.apache.ambari.server.controller.internal.BlueprintResourceProvi= der{code} > Example of a resource definition that must be defined for a new resource: > {code}org.apache.ambari.server.api.resources.BlueprintResourceDefinition{= code} > There may be other classes required for this implementation, but the Blue= print resource pattern is probably the best starting point for this current= task. =20 > h2. Ambari REST API Documentation > The following link shows the Ambari REST API Documentation, which will li= kely be useful during this task: > https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/ind= ex.md > h2. Examples of Kerberos Descriptors > The default Kerberos descriptors are defined in the stacks, and can be fo= und at the service-level and stack-level. =20 > In the trunk repo, the stack definitions for the "HDP" stack can be found= in: > {code}ambari/ambari-server/src/main/resources/stacks/HDP{code} > All of the Kerberos Descriptors in the stacks are named "kerberos.json". = =20 > From the directory mentioned above in the stack definitions, the followin= g shows the default kerberos descriptors for the "HDP" stacks: > {code} > find . -name "kerberos.json" > ./2.0.6/kerberos.json > ./2.2/services/YARN/kerberos.json > ./2.3/services/ACCUMULO/kerberos.json > ./2.3/services/KAFKA/kerberos.json > ./2.3/services/TEZ/kerberos.json > ./2.3/services/YARN/kerberos.json > ./2.3.GlusterFS/services/ACCUMULO/kerberos.json > ./2.3.GlusterFS/services/TEZ/kerberos.json > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)