You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mesos.apache.org by Rad Gruchalski <ra...@gruchalski.com> on 2015/12/08 12:27:08 UTC

Learning Agent ID without reading full state?

Hi there,  

I’m trying to figure out what would the best way to learn the agent id without having to read the complete state of mesos. Currently, I do the following:

mesos-state 2>/dev/null | jq '.slaves[] | select(.hostname == "’$(AGENT_HOSTNAME)'") | .id' -r

However, depending on how much stuff is happening, the amount of data thrown away is less massive or even more massive.
I am currently looking at 2 options, I only want to learn the agent id on a host running that agent:

cat $MESOS_WORKPLACE/meta/slaves/latest/slave.info

but I’m not sure what format the data in this file is in? It looks encoded but not sure what the exact encoding is.
The other option I’m looking at is:

basename $(readlink -f $(find $MESOS_WORKPLACE/meta/slaves -maxdepth 1 -type l))

But I’m not sure if there are any caveats I should be aware of? Any pointers?  










Kind regards,

Radek Gruchalski

radek@gruchalski.com (mailto:radek@gruchalski.com)
 (mailto:radek@gruchalski.com)
de.linkedin.com/in/radgruchalski/ (http://de.linkedin.com/in/radgruchalski/)

Confidentiality:
This communication is intended for the above-named person and may be confidential and/or legally privileged.
If it has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender immediately.



Re: Learning Agent ID without reading full state?

Posted by tommy xiao <xi...@gmail.com>.
That's ok

2015-12-08 23:01 GMT+08:00 Rad Gruchalski <ra...@gruchalski.com>:

> TBH, after having a second look at the marathon event bus, I don’t need
> it, it gives me the host of where the event happened. That should be
> sufficient.
>
> Kind regards,
> Radek Gruchalski
> radek@gruchalski.com <ra...@gruchalski.com>
> de.linkedin.com/in/radgruchalski/
>
>
> *Confidentiality:*This communication is intended for the above-named
> person and may be confidential and/or legally privileged.
> If it has come to you in error you must take no action based on it, nor
> must you copy or show it to anyone; please delete/destroy and inform the
> sender immediately.
>
> On Tuesday, 8 December 2015 at 15:42, tommy xiao wrote:
>
> why are you need the Agent ID? could you please input more information?
>
> 2015-12-08 19:27 GMT+08:00 Rad Gruchalski <ra...@gruchalski.com>:
>
> Hi there,
>
> I’m trying to figure out what would the best way to learn the agent id
> without having to read the complete state of mesos. Currently, I do the
> following:
>
> mesos-state 2>/dev/null | jq '.slaves[] | select(.hostname ==
> "’$(AGENT_HOSTNAME)'") | .id' -r
>
> However, depending on how much stuff is happening, the amount of data
> thrown away is less massive or even more massive.
> I am currently looking at 2 options, I only want to learn the agent id on
> a host running that agent:
>
> cat $MESOS_WORKPLACE/meta/slaves/latest/slave.info
>
> but I’m not sure what format the data in this file is in? It looks encoded
> but not sure what the exact encoding is.
> The other option I’m looking at is:
>
> basename $(readlink -f $(find $MESOS_WORKPLACE/meta/slaves -maxdepth 1
> -type l))
>
> But I’m not sure if there are any caveats I should be aware of? Any
> pointers?
>
> Kind regards,
> Radek Gruchalski
> radek@gruchalski.com <ra...@gruchalski.com>
> de.linkedin.com/in/radgruchalski/
>
>
> *Confidentiality:*This communication is intended for the above-named
> person and may be confidential and/or legally privileged.
> If it has come to you in error you must take no action based on it, nor
> must you copy or show it to anyone; please delete/destroy and inform the
> sender immediately.
>
>
>
>
> --
> Deshi Xiao
> Twitter: xds2000
> E-mail: xiaods(AT)gmail.com
>
>
>


-- 
Deshi Xiao
Twitter: xds2000
E-mail: xiaods(AT)gmail.com

Re: Learning Agent ID without reading full state?

Posted by Rad Gruchalski <ra...@gruchalski.com>.
TBH, after having a second look at the marathon event bus, I don’t need it, it gives me the host of where the event happened. That should be sufficient.










Kind regards,

Radek Gruchalski

radek@gruchalski.com (mailto:radek@gruchalski.com)
 (mailto:radek@gruchalski.com)
de.linkedin.com/in/radgruchalski/ (http://de.linkedin.com/in/radgruchalski/)

Confidentiality:
This communication is intended for the above-named person and may be confidential and/or legally privileged.
If it has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender immediately.



On Tuesday, 8 December 2015 at 15:42, tommy xiao wrote:

> why are you need the Agent ID? could you please input more information?
>  
> 2015-12-08 19:27 GMT+08:00 Rad Gruchalski <radek@gruchalski.com (mailto:radek@gruchalski.com)>:
> > Hi there,  
> >  
> > I’m trying to figure out what would the best way to learn the agent id without having to read the complete state of mesos. Currently, I do the following:
> >  
> > mesos-state 2>/dev/null | jq '.slaves[] | select(.hostname == "’$(AGENT_HOSTNAME)'") | .id' -r
> >  
> > However, depending on how much stuff is happening, the amount of data thrown away is less massive or even more massive.
> > I am currently looking at 2 options, I only want to learn the agent id on a host running that agent:
> >  
> > cat $MESOS_WORKPLACE/meta/slaves/latest/slave.info (http://slave.info)
> >  
> > but I’m not sure what format the data in this file is in? It looks encoded but not sure what the exact encoding is.
> > The other option I’m looking at is:
> >  
> > basename $(readlink -f $(find $MESOS_WORKPLACE/meta/slaves -maxdepth 1 -type l))
> >  
> > But I’m not sure if there are any caveats I should be aware of? Any pointers?  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> > Kind regards,

> > Radek Gruchalski
> > 
radek@gruchalski.com (mailto:radek@gruchalski.com)
 (mailto:radek@gruchalski.com)
> > de.linkedin.com/in/radgruchalski/ (http://de.linkedin.com/in/radgruchalski/)
> >  
> > Confidentiality:
> > This communication is intended for the above-named person and may be confidential and/or legally privileged.
> > If it has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender immediately.
> >  
> >  
> >  
>  
>  
>  
>  
>  
> --  
> Deshi Xiao
> Twitter: xds2000
> E-mail: xiaods(AT)gmail.com (http://gmail.com)  


Re: Learning Agent ID without reading full state?

Posted by tommy xiao <xi...@gmail.com>.
why are you need the Agent ID? could you please input more information?

2015-12-08 19:27 GMT+08:00 Rad Gruchalski <ra...@gruchalski.com>:

> Hi there,
>
> I’m trying to figure out what would the best way to learn the agent id
> without having to read the complete state of mesos. Currently, I do the
> following:
>
> mesos-state 2>/dev/null | jq '.slaves[] | select(.hostname ==
> "’$(AGENT_HOSTNAME)'") | .id' -r
>
> However, depending on how much stuff is happening, the amount of data
> thrown away is less massive or even more massive.
> I am currently looking at 2 options, I only want to learn the agent id on
> a host running that agent:
>
> cat $MESOS_WORKPLACE/meta/slaves/latest/slave.info
>
> but I’m not sure what format the data in this file is in? It looks encoded
> but not sure what the exact encoding is.
> The other option I’m looking at is:
>
> basename $(readlink -f $(find $MESOS_WORKPLACE/meta/slaves -maxdepth 1
> -type l))
>
> But I’m not sure if there are any caveats I should be aware of? Any
> pointers?
>
> Kind regards,
> Radek Gruchalski
> radek@gruchalski.com <ra...@gruchalski.com>
> de.linkedin.com/in/radgruchalski/
>
>
> *Confidentiality:*This communication is intended for the above-named
> person and may be confidential and/or legally privileged.
> If it has come to you in error you must take no action based on it, nor
> must you copy or show it to anyone; please delete/destroy and inform the
> sender immediately.
>



-- 
Deshi Xiao
Twitter: xds2000
E-mail: xiaods(AT)gmail.com