You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mesos.apache.org by Thodoris Zois <zo...@ics.forth.gr> on 2017/09/19 23:46:27 UTC
Ports and Tasks
Hello list,
I have a weird problem, and i am wondering if there is any easy way to solve it.
I am running some tasks (docker images using mesos contaunerizer) that each one starts a mysql server, does some queries and closes the server.
Every server is listening to the same port. And that is the problem. In Mesos offer i allocate a port for each task, but how i can use it in the script that docker file (CMD script.sh) executes when starts?
Any help would be appreciated!
Thank you very much,
Thodoris
Re: Ports and Tasks
Posted by Thodoris Zois <zo...@ics.forth.gr>.
Seems that it is :)
Thank you!
> On 20 Sep 2017, at 17:00, tommy xiao <xi...@gmail.com> wrote:
>
> ENV is good fit.
>
> 2017-09-20 15:53 GMT+08:00 Thodoris Zois <zois@ics.forth.gr <ma...@ics.forth.gr>>:
> Hello,
>
> Thank you for the provided links, i am using my own framework..
>
> Thodoris
>
> On 20 Sep 2017, at 03:15, Sunil Shah <sunilsh@yelp.com <ma...@yelp.com>> wrote:
>
>> Hi Thodoris,
>>
>> What framework are you using? Marathon makes this port available as an environment variable, you may want to do similar: docs <https://mesosphere.github.io/marathon/docs/task-environment-vars.html>, code <https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/mesos/EnvironmentHelper.scala#L25>.
>>
>> Sunil
>>
>> On Tue, Sep 19, 2017 at 4:46 PM, Thodoris Zois <zois@ics.forth.gr <ma...@ics.forth.gr>> wrote:
>> Hello list,
>>
>> I have a weird problem, and i am wondering if there is any easy way to solve it.
>>
>> I am running some tasks (docker images using mesos contaunerizer) that each one starts a mysql server, does some queries and closes the server.
>>
>> Every server is listening to the same port. And that is the problem. In Mesos offer i allocate a port for each task, but how i can use it in the script that docker file (CMD script.sh) executes when starts?
>>
>> Any help would be appreciated!
>>
>> Thank you very much,
>> Thodoris
>>
>
>
>
> --
> Deshi Xiao
> Twitter: xds2000
> E-mail: xiaods(AT)gmail.com <http://gmail.com/>
Re: Ports and Tasks
Posted by tommy xiao <xi...@gmail.com>.
ENV is good fit.
2017-09-20 15:53 GMT+08:00 Thodoris Zois <zo...@ics.forth.gr>:
> Hello,
>
> Thank you for the provided links, i am using my own framework..
>
> Thodoris
>
> On 20 Sep 2017, at 03:15, Sunil Shah <su...@yelp.com> wrote:
>
> Hi Thodoris,
>
> What framework are you using? Marathon makes this port available as an
> environment variable, you may want to do similar: docs
> <https://mesosphere.github.io/marathon/docs/task-environment-vars.html>,
> code
> <https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/mesos/EnvironmentHelper.scala#L25>
> .
>
> Sunil
>
> On Tue, Sep 19, 2017 at 4:46 PM, Thodoris Zois <zo...@ics.forth.gr> wrote:
>
>> Hello list,
>>
>> I have a weird problem, and i am wondering if there is any easy way to
>> solve it.
>>
>> I am running some tasks (docker images using mesos contaunerizer) that
>> each one starts a mysql server, does some queries and closes the server.
>>
>> Every server is listening to the same port. And that is the problem. In
>> Mesos offer i allocate a port for each task, but how i can use it in the
>> script that docker file (CMD script.sh) executes when starts?
>>
>> Any help would be appreciated!
>>
>> Thank you very much,
>> Thodoris
>>
>
>
--
Deshi Xiao
Twitter: xds2000
E-mail: xiaods(AT)gmail.com
Re: Ports and Tasks
Posted by Thodoris Zois <zo...@ics.forth.gr>.
Hello,
Thank you for the provided links, i am using my own framework..
Thodoris
> On 20 Sep 2017, at 03:15, Sunil Shah <su...@yelp.com> wrote:
>
> Hi Thodoris,
>
> What framework are you using? Marathon makes this port available as an environment variable, you may want to do similar: docs, code.
>
> Sunil
>
>> On Tue, Sep 19, 2017 at 4:46 PM, Thodoris Zois <zo...@ics.forth.gr> wrote:
>> Hello list,
>>
>> I have a weird problem, and i am wondering if there is any easy way to solve it.
>>
>> I am running some tasks (docker images using mesos contaunerizer) that each one starts a mysql server, does some queries and closes the server.
>>
>> Every server is listening to the same port. And that is the problem. In Mesos offer i allocate a port for each task, but how i can use it in the script that docker file (CMD script.sh) executes when starts?
>>
>> Any help would be appreciated!
>>
>> Thank you very much,
>> Thodoris
>
Re: Ports and Tasks
Posted by Sunil Shah <su...@yelp.com>.
Hi Thodoris,
What framework are you using? Marathon makes this port available as an
environment variable, you may want to do similar: docs
<https://mesosphere.github.io/marathon/docs/task-environment-vars.html>,
code
<https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/mesos/EnvironmentHelper.scala#L25>
.
Sunil
On Tue, Sep 19, 2017 at 4:46 PM, Thodoris Zois <zo...@ics.forth.gr> wrote:
> Hello list,
>
> I have a weird problem, and i am wondering if there is any easy way to
> solve it.
>
> I am running some tasks (docker images using mesos contaunerizer) that
> each one starts a mysql server, does some queries and closes the server.
>
> Every server is listening to the same port. And that is the problem. In
> Mesos offer i allocate a port for each task, but how i can use it in the
> script that docker file (CMD script.sh) executes when starts?
>
> Any help would be appreciated!
>
> Thank you very much,
> Thodoris
>
Re: Ports and Tasks
Posted by Sunil Shah <su...@yelp.com>.
Hi Thodoris,
What framework are you using? Marathon makes this port available as an
environment variable, you may want to do similar: docs
<https://mesosphere.github.io/marathon/docs/task-environment-vars.html>,
code
<https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/mesos/EnvironmentHelper.scala#L25>
.
Sunil
On Tue, Sep 19, 2017 at 4:46 PM, Thodoris Zois <zo...@ics.forth.gr> wrote:
> Hello list,
>
> I have a weird problem, and i am wondering if there is any easy way to
> solve it.
>
> I am running some tasks (docker images using mesos contaunerizer) that
> each one starts a mysql server, does some queries and closes the server.
>
> Every server is listening to the same port. And that is the problem. In
> Mesos offer i allocate a port for each task, but how i can use it in the
> script that docker file (CMD script.sh) executes when starts?
>
> Any help would be appreciated!
>
> Thank you very much,
> Thodoris
>