mesosphere / net-modules

Apache Mesos modules for network isolation.
55 stars 28 forks source link

Error on Centos7 #62

Closed titilambert closed 8 years ago

titilambert commented 8 years ago

Hello ! I'm trying to compile libmesos_network_isolator.so on Centos7 with meso 0.25 The compilation seems good but when I type

/usr/sbin/mesos-slave --master=zk://mesos-server:2181/mesos --log_dir=/var/log/mesos --containerizers=docker,mesos --executor_registration_timeout=5mins --ip=MYIP --modules=file:///opt/modules.json

I get:

Error loading modules: Error opening library: '/opt/libmesos_network_isolator.so': Could not load library '/opt/libmesos_network_isolator.so': /opt/libmesos_network_isolator.so: undefined symbol: _ZNK8picojson5value2isIlEEbv

And this is how i compiled:

wget https://raw.githubusercontent.com/kazuho/picojson/v1.3.0/picojson.h -O /usr/local/include/picojson.h
yum install libtool python-devel gcc-c++ glog-devel gflags-devel boost-devel protobuf-devel curl-devel subversion-devel

git clone https://github.com/mesosphere/net-modules.git
cd net-modules/isolator
./bootstrap && \
    rm -rf build && \
    mkdir build && \
    cd build && \
    export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/usr/local/lib && \
    ../configure --with-mesos=/usr/local --with-protobuf=/usr && \
    make all
cp .libs/libmesos_network_isolator-0.1.so  /opt/libmesos_network_isolator.so

Did I miss something ?

Thanks !

ozdanborne commented 8 years ago

You're missing the picojson library headers.

Download the headers: wget https://raw.githubusercontent.com/kazuho/picojson/v1.3.0/picojson.h -O /usr/local/include/picojson.h

If you're not using the 0.25 integration branch, then be sure you're using the correct flags to handle some duplicate import issues: https://github.com/djosborne/net-modules/pull/24/files

titilambert commented 8 years ago

Thanks for your anwser ! With this file: https://github.com/spikecurtis/calico-mesos/blob/centos-baremetal/scripts/centos.sh this is working .... Can I get libmesos_network_isolator.so with mesos rpm package (without recompiling mesos) ?

Thanks.

spikecurtis commented 8 years ago

It's on my to-do list to build RPMs, but I haven't had a chance yet.

titilambert commented 8 years ago

I can build RPMs :) I would love make a PR with a spec file ;) But, for now, I'm just trying to build the isolator first using mesos package (from mesosphere (http://repos.mesosphere.io/el/7/x86_64/RPMS/mesos-0.25.0-0.2.70.centos701406.x86_64.rpm)) Do you know if is possible ? I ask you this, because in this script https://github.com/spikecurtis/calico-mesos/blob/centos-baremetal/scripts/centos.sh , isolator is compiled using mesos from source BTW, are you available from a small chat on freenode ?

titilambert commented 8 years ago

I close this issue, RPM are here: https://github.com/mesosphere/net-modules/pull/64