You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@slider.apache.org by "David.Serafini" <Da...@target.com> on 2017/04/04 16:50:16 UTC

Re: [EXTERNAL] Re: specifying port explicitly

I misinterpreted the meaning of that statement.  I thought it meant that the app could tell slider what port it wanted to use.  Is that possible? 

-david


On 4/4/17, 7:34 AM, <bi...@gmail.com> wrote:

    If you want Slider to allocate a port for you, use a
    ${COMPONENT_NAME.ALLOCATED_PORT} variable in the appConfig, like this:
    https://github.com/apache/incubator-slider/blob/develop/app-packages/hbase/appConfig-default.json#L39
    
    This is typically used for singleton / master ports that need to be known
    by the client, whereas ports that are only used internally by the app can
    be set to 0 so the app selects a random port (if the app supports that). To
    publish the ALLOCATED_PORT, you would specify an export in the metainfo,
    like this:
    https://github.com/apache/incubator-slider/blob/develop/app-packages/hbase/metainfo.xml#L42
    
    If there are multiple instances of a component and each one needs its own
    port, you add {PER_CONTAINER}:
    https://github.com/apache/incubator-slider/blob/develop/app-packages/accumulo/appConfig-default.json#L31
    and then have a component export:
    https://github.com/apache/incubator-slider/blob/develop/app-packages/accumulo/metainfo.xml#L147
    
    On Mon, Apr 3, 2017 at 11:16 AM, David.Serafini <Da...@target.com>
    wrote:
    
    > On the wiki in :
    >
    > https://slider.incubator.apache.org/docs/configuration/resources.html
    >
    > It says:
    >
    >     If the component were configured to request an explicit port for its
    > REST endpoint
    >
    > How do you do this?  The docs and examples show various variables related
    > to port number.  Which one(s) must I set explicitly?
    >
    > Also, does Slider check that the port is not in use on the compute node
    > before launching the app?
    >
    > thanks,
    > -david
    >
    >
    >
    >
    >
    


Re: [EXTERNAL] Re: specifying port explicitly

Posted by Gour Saha <gs...@hortonworks.com>.
If you have a fixed port say 12345 then hard-code it to 12345 instead of 0
or ALLOCATED_PORT. If you want a random port but within a range then
additionally set the config property site.global.slider.allowed.ports in
the global section of app config, as stated here -

https://slider.incubator.apache.org/docs/configuration/core.html#key-applic
ation-configuration-items


-Gour

On 4/4/17, 9:50 AM, "David.Serafini" <Da...@target.com> wrote:

>I misinterpreted the meaning of that statement.  I thought it meant that
>the app could tell slider what port it wanted to use.  Is that possible?
>
>-david
>
>
>On 4/4/17, 7:34 AM, <bi...@gmail.com> wrote:
>
>    If you want Slider to allocate a port for you, use a
>    ${COMPONENT_NAME.ALLOCATED_PORT} variable in the appConfig, like this:
>    
>https://github.com/apache/incubator-slider/blob/develop/app-packages/hbase
>/appConfig-default.json#L39
>    
>    This is typically used for singleton / master ports that need to be
>known
>    by the client, whereas ports that are only used internally by the app
>can
>    be set to 0 so the app selects a random port (if the app supports
>that). To
>    publish the ALLOCATED_PORT, you would specify an export in the
>metainfo,
>    like this:
>    
>https://github.com/apache/incubator-slider/blob/develop/app-packages/hbase
>/metainfo.xml#L42
>    
>    If there are multiple instances of a component and each one needs its
>own
>    port, you add {PER_CONTAINER}:
>    
>https://github.com/apache/incubator-slider/blob/develop/app-packages/accum
>ulo/appConfig-default.json#L31
>    and then have a component export:
>    
>https://github.com/apache/incubator-slider/blob/develop/app-packages/accum
>ulo/metainfo.xml#L147
>    
>    On Mon, Apr 3, 2017 at 11:16 AM, David.Serafini
><Da...@target.com>
>    wrote:
>    
>    > On the wiki in :
>    >
>    > 
>https://slider.incubator.apache.org/docs/configuration/resources.html
>    >
>    > It says:
>    >
>    >     If the component were configured to request an explicit port
>for its
>    > REST endpoint
>    >
>    > How do you do this?  The docs and examples show various variables
>related
>    > to port number.  Which one(s) must I set explicitly?
>    >
>    > Also, does Slider check that the port is not in use on the compute
>node
>    > before launching the app?
>    >
>    > thanks,
>    > -david
>    >
>    >
>    >
>    >
>    >
>    
>