You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ambari.apache.org by Xiaoke Zhang <xi...@arcadiadata.com> on 2016/06/03 23:28:11 UTC

optional (blankable) configuration in custom ambari stacks

Hi,

I am trying to create a custom stack for Ambari,  I am using version
2.2.1.1 on centos.

ambari-agent-2.2.1.1-70
ambari-server-2.2.1.1-70

One problem I ran into is creating an optionally empty parameter for my
service.
srv_ssl_cert and srv_ssl_key. Both are optional. If you don't have it, the
service would then run it on http instead of https.

I tried to put this in my configuration.

-- metainfo.xml
<configuration-dependencies>
       <config-type>my-config</config-type>
 </configuration-dependencies>

--- my-config

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
  <property require-input="false" >
    <name>srv_ssl_cert</name>
    <value></value>
    <description>
      Path on disk for SSL certificate in PEM format.
    </description>
  </property>
  <property require-input="false" >
    <name>srv_ssl_key</name>
    <value></value>
    <description>
      Path on disk for SSL key in PEM format.
    </description>
  </property>
</configuration>


Unfortunately, it doesn't work.  Even though some of the ambari workshop
examples uses require-input="false".
https://github.com/randerzander/r-service/blob/master/configuration/r-config.xml

I tried without the empty <value></value> , ambari just don't show any
thing at all.

I realize I can make it a special value like "none" or "n/a" or ship a with
a default self signed certificate.  Just wondering if ambari has the
capability to support optional and "blank able" parameters.

Thanks for any advice.

custom ambari service that only installs files

Posted by Martin Serrano <ma...@attivio.com>.
Hi,

I am interested in writing a custom ambari plugin (service?) that would
do two things:

* copy a set of jars to local disk on each node
* populate some znodes in zookeeper (based on user configuration choices)

But after that, no actions would need to occur.  We plan on executing
code via a YARN client later, and want to pre-stage most of the
application code since it can be large.  We would also want to react
(even if user had to click a button -- but prefer not) to cluster
configuration changes.

Is this something the Ambari Stack architecture is appropriate for?  Or
should we try to accomplish this some another way?

Thanks,
Martin Serrano

Re: optional (blankable) configuration in custom ambari stacks

Posted by Xiaoke Zhang <xi...@arcadiadata.com>.
Thanks that worked.



On Sat, Jun 4, 2016 at 1:43 PM, Nate Cole <nc...@hortonworks.com> wrote:

> You should be able to annotate your property like so:
>
>
>
>   <property>
>
>     <name>hadoop.security.key.provider.path</name>
>
>     <value></value>
>
>     <value-attributes>
>
>       <empty-value-valid>true</empty-value-valid>
>
>     </value-attributes>
>
>     …
>
> </property>
>
>
>
> Thanks,
>
> Nate
>
>
>
> *From: *Xiaoke Zhang <xi...@arcadiadata.com>
> *Reply-To: *"user@ambari.apache.org" <us...@ambari.apache.org>
> *Date: *Friday, June 3, 2016 at 7:28 PM
> *To: *"user@ambari.apache.org" <us...@ambari.apache.org>
> *Subject: *optional (blankable) configuration in custom ambari stacks
>
>
>
> Hi,
>
> I am trying to create a custom stack for Ambari,  I am using version
> 2.2.1.1 on centos.
>
>
> ambari-agent-2.2.1.1-70
> ambari-server-2.2.1.1-70
>
> One problem I ran into is creating an optionally empty parameter for my
> service.
> srv_ssl_cert and srv_ssl_key. Both are optional. If you don't have it, the
> service would then run it on http instead of https.
>
> I tried to put this in my configuration.
>
> -- metainfo.xml
> <configuration-dependencies>
>        <config-type>my-config</config-type>
>
>  </configuration-dependencies>
>
> --- my-config
>
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
>
> <configuration>
>   <property require-input="false" >
>     <name>srv_ssl_cert</name>
>     <value></value>
>     <description>
>       Path on disk for SSL certificate in PEM format.
>     </description>
>   </property>
>   <property require-input="false" >
>     <name>srv_ssl_key</name>
>     <value></value>
>     <description>
>       Path on disk for SSL key in PEM format.
>     </description>
>   </property>
> </configuration>
>
> Unfortunately, it doesn't work.  Even though some of the ambari workshop
> examples uses require-input="false".
> https://github.com/randerzander/r-service/blob/master/configuration/r-config.xml
>
> I tried without the empty <value></value> , ambari just don't show any
> thing at all.
>
>
>
> I realize I can make it a special value like "none" or "n/a" or ship a
> with a default self signed certificate.  Just wondering if ambari has the
> capability to support optional and "blank able" parameters.
>
>
> Thanks for any advice.
>
>
>

Re: optional (blankable) configuration in custom ambari stacks

Posted by Nate Cole <nc...@hortonworks.com>.
You should be able to annotate your property like so:

  <property>
    <name>hadoop.security.key.provider.path</name>
    <value></value>
    <value-attributes>
      <empty-value-valid>true</empty-value-valid>
    </value-attributes>
    …
</property>

Thanks,
Nate

From: Xiaoke Zhang <xi...@arcadiadata.com>
Reply-To: "user@ambari.apache.org" <us...@ambari.apache.org>
Date: Friday, June 3, 2016 at 7:28 PM
To: "user@ambari.apache.org" <us...@ambari.apache.org>
Subject: optional (blankable) configuration in custom ambari stacks

Hi,
I am trying to create a custom stack for Ambari,  I am using version 2.2.1.1 on centos.

ambari-agent-2.2.1.1-70
ambari-server-2.2.1.1-70
One problem I ran into is creating an optionally empty parameter for my service.
srv_ssl_cert and srv_ssl_key. Both are optional. If you don't have it, the service would then run it on http instead of https.

I tried to put this in my configuration.
-- metainfo.xml
<configuration-dependencies>
       <config-type>my-config</config-type>
 </configuration-dependencies>
--- my-config

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
  <property require-input="false" >
    <name>srv_ssl_cert</name>
    <value></value>
    <description>
      Path on disk for SSL certificate in PEM format.
    </description>
  </property>
  <property require-input="false" >
    <name>srv_ssl_key</name>
    <value></value>
    <description>
      Path on disk for SSL key in PEM format.
    </description>
  </property>
</configuration>

Unfortunately, it doesn't work.  Even though some of the ambari workshop examples uses require-input="false". https://github.com/randerzander/r-service/blob/master/configuration/r-config.xml
I tried without the empty <value></value> , ambari just don't show any thing at all.

I realize I can make it a special value like "none" or "n/a" or ship a with a default self signed certificate.  Just wondering if ambari has the capability to support optional and "blank able" parameters.

Thanks for any advice.