You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Jay Guo <gu...@gmail.com> on 2016/03/22 14:21:03 UTC

Compile with CFLAGS=-DWITH_NETWORK_ISOLATOR

Hi,

I got error trying to compile Mesos
on Ubuntu
with CFLAG WITH_NETWORK_ISOLATOR

Here's what I did:
1. apt-get install libnl-dev
2. ./bootstrap
3. mkdir build && cd build
4. CXXFLAGS=-DWITH_NETWORK_ISOLATOR ../configure --disable-java
--disable-python
5. make check

Although I got following error:

In file included from ../../src/linux/routing/filter/ip.hpp:35:0,
                 from
../../src/slave/containerizer/mesos/isolators/network/port_mapping.hpp:44,
                 from
../../src/slave/containerizer/mesos/containerizer.cpp:82:
../../src/linux/routing/handle.hpp:92:39: error: ‘TC_H_ROOT’ was not
declared in this scope
 constexpr Handle EGRESS_ROOT = Handle(TC_H_ROOT);
                                       ^
../../src/linux/routing/handle.hpp:93:40: error: ‘TC_H_INGRESS’ was not
declared in this scope
 constexpr Handle INGRESS_ROOT = Handle(TC_H_INGRESS);

Any ideas?

Also, does this work with OSX? Is there any equivalent library as libnl?

Cheers,
/J

Re: Compile with CFLAGS=-DWITH_NETWORK_ISOLATOR

Posted by Kevin Klues <kl...@gmail.com>.
As haosdent said, the default libnl-3 that comes with ubuntu is not
new enough.  It will cause the following check in configure.ac to
fail:

AC_CHECK_LIB([nl-3], [nl_has_capability], ...

because the default ubuntu version does not contain the function
nl_has_capability.  You need to install the version from:
https://github.com/thom311/libnl/releases/tag/libnl3_2_27

and then run through the instructions that Guangya linked to:
https://github.com/apache/mesos/blob/master/docs/network-monitoring.md#prerequisites

On Tue, Mar 22, 2016 at 6:36 AM, Guangya Liu <gy...@gmail.com> wrote:
> I did try this feature before, and you may want to follow here
> https://github.com/apache/mesos/blob/master/docs/network-monitoring.md#prerequisites
> to install the right version prerequisites first.
>
> On Tue, Mar 22, 2016 at 9:21 PM, Jay Guo <gu...@gmail.com> wrote:
>
>> Hi,
>>
>> I got error trying to compile Mesos
>> on Ubuntu
>> with CFLAG WITH_NETWORK_ISOLATOR
>>
>> Here's what I did:
>> 1. apt-get install libnl-dev
>> 2. ./bootstrap
>> 3. mkdir build && cd build
>> 4. CXXFLAGS=-DWITH_NETWORK_ISOLATOR ../configure --disable-java
>> --disable-python
>> 5. make check
>>
>> Although I got following error:
>>
>> In file included from ../../src/linux/routing/filter/ip.hpp:35:0,
>>                  from
>> ../../src/slave/containerizer/mesos/isolators/network/port_mapping.hpp:44,
>>                  from
>> ../../src/slave/containerizer/mesos/containerizer.cpp:82:
>> ../../src/linux/routing/handle.hpp:92:39: error: ‘TC_H_ROOT’ was not
>> declared in this scope
>>  constexpr Handle EGRESS_ROOT = Handle(TC_H_ROOT);
>>                                        ^
>> ../../src/linux/routing/handle.hpp:93:40: error: ‘TC_H_INGRESS’ was not
>> declared in this scope
>>  constexpr Handle INGRESS_ROOT = Handle(TC_H_INGRESS);
>>
>> Any ideas?
>>
>> Also, does this work with OSX? Is there any equivalent library as libnl?
>>
>> Cheers,
>> /J
>>



-- 
~Kevin

Re: Compile with CFLAGS=-DWITH_NETWORK_ISOLATOR

Posted by Guangya Liu <gy...@gmail.com>.
I did try this feature before, and you may want to follow here
https://github.com/apache/mesos/blob/master/docs/network-monitoring.md#prerequisites
to install the right version prerequisites first.

On Tue, Mar 22, 2016 at 9:21 PM, Jay Guo <gu...@gmail.com> wrote:

> Hi,
>
> I got error trying to compile Mesos
> on Ubuntu
> with CFLAG WITH_NETWORK_ISOLATOR
>
> Here's what I did:
> 1. apt-get install libnl-dev
> 2. ./bootstrap
> 3. mkdir build && cd build
> 4. CXXFLAGS=-DWITH_NETWORK_ISOLATOR ../configure --disable-java
> --disable-python
> 5. make check
>
> Although I got following error:
>
> In file included from ../../src/linux/routing/filter/ip.hpp:35:0,
>                  from
> ../../src/slave/containerizer/mesos/isolators/network/port_mapping.hpp:44,
>                  from
> ../../src/slave/containerizer/mesos/containerizer.cpp:82:
> ../../src/linux/routing/handle.hpp:92:39: error: ‘TC_H_ROOT’ was not
> declared in this scope
>  constexpr Handle EGRESS_ROOT = Handle(TC_H_ROOT);
>                                        ^
> ../../src/linux/routing/handle.hpp:93:40: error: ‘TC_H_INGRESS’ was not
> declared in this scope
>  constexpr Handle INGRESS_ROOT = Handle(TC_H_INGRESS);
>
> Any ideas?
>
> Also, does this work with OSX? Is there any equivalent library as libnl?
>
> Cheers,
> /J
>

Re: Compile with CFLAGS=-DWITH_NETWORK_ISOLATOR

Posted by Cong Wang <cw...@twopensource.com>.
On Tue, Mar 22, 2016 at 6:21 AM, Jay Guo <gu...@gmail.com> wrote:
>
> Also, does this work with OSX? Is there any equivalent library as libnl?

No, netlink is a very specific and powerful feature on Linux, and it is one
big reason why Linux is MUCH better than OSX on networking.

See: https://en.wikipedia.org/wiki/Netlink

Re: Compile with CFLAGS=-DWITH_NETWORK_ISOLATOR

Posted by haosdent <ha...@gmail.com>.
Hi, this only works in linux. Please install this libnl
https://github.com/thom311/libnl/releases/tag/libnl3_2_27

On Tue, Mar 22, 2016 at 9:21 PM, Jay Guo <gu...@gmail.com> wrote:

> Hi,
>
> I got error trying to compile Mesos
> on Ubuntu
> with CFLAG WITH_NETWORK_ISOLATOR
>
> Here's what I did:
> 1. apt-get install libnl-dev
> 2. ./bootstrap
> 3. mkdir build && cd build
> 4. CXXFLAGS=-DWITH_NETWORK_ISOLATOR ../configure --disable-java
> --disable-python
> 5. make check
>
> Although I got following error:
>
> In file included from ../../src/linux/routing/filter/ip.hpp:35:0,
>                  from
> ../../src/slave/containerizer/mesos/isolators/network/port_mapping.hpp:44,
>                  from
> ../../src/slave/containerizer/mesos/containerizer.cpp:82:
> ../../src/linux/routing/handle.hpp:92:39: error: ‘TC_H_ROOT’ was not
> declared in this scope
>  constexpr Handle EGRESS_ROOT = Handle(TC_H_ROOT);
>                                        ^
> ../../src/linux/routing/handle.hpp:93:40: error: ‘TC_H_INGRESS’ was not
> declared in this scope
>  constexpr Handle INGRESS_ROOT = Handle(TC_H_INGRESS);
>
> Any ideas?
>
> Also, does this work with OSX? Is there any equivalent library as libnl?
>
> Cheers,
> /J
>



-- 
Best Regards,
Haosdent Huang

Re: Compile with CFLAGS=-DWITH_NETWORK_ISOLATOR

Posted by tommy xiao <xi...@gmail.com>.
thanks for your share.  Jay, rocks.

2016-03-23 11:52 GMT+08:00 Jay Guo <gu...@gmail.com>:

> Hi,
>
> Problem solved, thanks guys.
>
> Just for future reference, here's a summary of what should be done to
> enable --network-isolator
>
> 1. Make sure kernel version is >= 3.15 or apply proper patches
> 2. Install libnl with version >= 3.2.26, make sure headers are installed
> into /usr/include (using --prefix when configure) instead of ubuntu default
> /usr/local/include
> 3. Make sure you are linking against correct shared library in /usr/lib,
> instead of /lib/ (ldd libmesos.so could help). export
> LD_LIBRARY_PATH=/usr/lib
> 4. Use --with-network-isolator instead of CXXFLAGS env. (just good
> practice, both should work)
>
> P.S. I do think OSX comes with network capability, just not devel.
> Thoughts?
>
> cheers,
> /J
>
> On Wed, Mar 23, 2016 at 6:15 AM, James Peach <jo...@gmail.com> wrote:
>
> >
> > > On Mar 22, 2016, at 6:21 AM, Jay Guo <gu...@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > I got error trying to compile Mesos
> > > on Ubuntu
> > > with CFLAG WITH_NETWORK_ISOLATOR
> > >
> > > Here's what I did:
> > > 1. apt-get install libnl-dev
> > > 2. ./bootstrap
> > > 3. mkdir build && cd build
> > > 4. CXXFLAGS=-DWITH_NETWORK_ISOLATOR ../configure --disable-java
> > > --disable-python
> >
> > You should do:
> >
> >     ../configure --disable-java --disable-python --with-network-isolator
> >
> > This will check for the dependencies correctly and enable the right build
> > components.
> >
> > > 5. make check
> > >
> > > Although I got following error:
> > >
> > > In file included from ../../src/linux/routing/filter/ip.hpp:35:0,
> > >                 from
> > >
> >
> ../../src/slave/containerizer/mesos/isolators/network/port_mapping.hpp:44,
> > >                 from
> > > ../../src/slave/containerizer/mesos/containerizer.cpp:82:
> > > ../../src/linux/routing/handle.hpp:92:39: error: ‘TC_H_ROOT’ was not
> > > declared in this scope
> > > constexpr Handle EGRESS_ROOT = Handle(TC_H_ROOT);
> > >                                       ^
> > > ../../src/linux/routing/handle.hpp:93:40: error: ‘TC_H_INGRESS’ was not
> > > declared in this scope
> > > constexpr Handle INGRESS_ROOT = Handle(TC_H_INGRESS);
> > >
> > > Any ideas?
> > >
> > > Also, does this work with OSX? Is there any equivalent library as
> libnl?
> > >
> > > Cheers,
> > > /J
> >
> >
>



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

Re: Compile with CFLAGS=-DWITH_NETWORK_ISOLATOR

Posted by Jay Guo <gu...@gmail.com>.
Hi,

Problem solved, thanks guys.

Just for future reference, here's a summary of what should be done to
enable --network-isolator

1. Make sure kernel version is >= 3.15 or apply proper patches
2. Install libnl with version >= 3.2.26, make sure headers are installed
into /usr/include (using --prefix when configure) instead of ubuntu default
/usr/local/include
3. Make sure you are linking against correct shared library in /usr/lib,
instead of /lib/ (ldd libmesos.so could help). export
LD_LIBRARY_PATH=/usr/lib
4. Use --with-network-isolator instead of CXXFLAGS env. (just good
practice, both should work)

P.S. I do think OSX comes with network capability, just not devel. Thoughts?

cheers,
/J

On Wed, Mar 23, 2016 at 6:15 AM, James Peach <jo...@gmail.com> wrote:

>
> > On Mar 22, 2016, at 6:21 AM, Jay Guo <gu...@gmail.com> wrote:
> >
> > Hi,
> >
> > I got error trying to compile Mesos
> > on Ubuntu
> > with CFLAG WITH_NETWORK_ISOLATOR
> >
> > Here's what I did:
> > 1. apt-get install libnl-dev
> > 2. ./bootstrap
> > 3. mkdir build && cd build
> > 4. CXXFLAGS=-DWITH_NETWORK_ISOLATOR ../configure --disable-java
> > --disable-python
>
> You should do:
>
>     ../configure --disable-java --disable-python --with-network-isolator
>
> This will check for the dependencies correctly and enable the right build
> components.
>
> > 5. make check
> >
> > Although I got following error:
> >
> > In file included from ../../src/linux/routing/filter/ip.hpp:35:0,
> >                 from
> >
> ../../src/slave/containerizer/mesos/isolators/network/port_mapping.hpp:44,
> >                 from
> > ../../src/slave/containerizer/mesos/containerizer.cpp:82:
> > ../../src/linux/routing/handle.hpp:92:39: error: ‘TC_H_ROOT’ was not
> > declared in this scope
> > constexpr Handle EGRESS_ROOT = Handle(TC_H_ROOT);
> >                                       ^
> > ../../src/linux/routing/handle.hpp:93:40: error: ‘TC_H_INGRESS’ was not
> > declared in this scope
> > constexpr Handle INGRESS_ROOT = Handle(TC_H_INGRESS);
> >
> > Any ideas?
> >
> > Also, does this work with OSX? Is there any equivalent library as libnl?
> >
> > Cheers,
> > /J
>
>

Re: Compile with CFLAGS=-DWITH_NETWORK_ISOLATOR

Posted by James Peach <jo...@gmail.com>.
> On Mar 22, 2016, at 6:21 AM, Jay Guo <gu...@gmail.com> wrote:
> 
> Hi,
> 
> I got error trying to compile Mesos
> on Ubuntu
> with CFLAG WITH_NETWORK_ISOLATOR
> 
> Here's what I did:
> 1. apt-get install libnl-dev
> 2. ./bootstrap
> 3. mkdir build && cd build
> 4. CXXFLAGS=-DWITH_NETWORK_ISOLATOR ../configure --disable-java
> --disable-python

You should do:

    ../configure --disable-java --disable-python --with-network-isolator

This will check for the dependencies correctly and enable the right build components.

> 5. make check
> 
> Although I got following error:
> 
> In file included from ../../src/linux/routing/filter/ip.hpp:35:0,
>                 from
> ../../src/slave/containerizer/mesos/isolators/network/port_mapping.hpp:44,
>                 from
> ../../src/slave/containerizer/mesos/containerizer.cpp:82:
> ../../src/linux/routing/handle.hpp:92:39: error: ‘TC_H_ROOT’ was not
> declared in this scope
> constexpr Handle EGRESS_ROOT = Handle(TC_H_ROOT);
>                                       ^
> ../../src/linux/routing/handle.hpp:93:40: error: ‘TC_H_INGRESS’ was not
> declared in this scope
> constexpr Handle INGRESS_ROOT = Handle(TC_H_INGRESS);
> 
> Any ideas?
> 
> Also, does this work with OSX? Is there any equivalent library as libnl?
> 
> Cheers,
> /J