运行 在 CentOS 7.1 上的 Mesos 0.23.0 上拥有 python 框架

Run own python framework on Mesos 0.23.0 on CentOS 7.1

我想在我的 Mesos Cluster (0.23) 上 运行 一个简单的 python 框架,在 CentOS 7.1 上 运行s。我在 James J Porter 的 mesosphere packages everything works fine (I'm running some Marathon jobs). But when I wanted to start develop my own framework with Python I got stuck. I used this example 上安装了 Mesos,我知道他在 Mesos 0.20.0 上测试过它,但我认为我可以 运行 在 Mesos 0.23 上不费吹灰之力。

起初我收到来自 python 的导入错误,它说 mesos.native 和 mesos.interface 不可用。然后我尝试做一个 easy_install 但我找不到 mesos.native 并尝试 isntall "mesos" 结果如下:

$ pip install mesos
Collecting mesos
/usr/lib/python2.7/site-packages/pip-7.1.0-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Could not find a version that satisfies the requirement mesos (from versions: )
No matching distribution found for mesos
$ easy_install mesos
Searching for mesos
Reading https://pypi.python.org/simple/mesos/
No local packages or download links found for mesos
error: Could not find suitable distribution for Requirement.parse('mesos')

然后我认为根据getting started guide自己构建所有内容是个好主意。但是知道我收到以下错误:

$ python hello_mesos.py 
Traceback (most recent call last):
  File "hello_mesos.py", line 7, in <module>
    from mesos.native import MesosExecutorDriver, MesosSchedulerDriver
  File "/usr/lib/python2.7/site-packages/mesos.native-0.23.0-py2.7.egg/mesos/native/__init__.py", line 17, in <module>
    from ._mesos import MesosExecutorDriverImpl
ImportError: libsvn_delta-1.so.1: cannot open shared object file: No such file or directory

当我尝试从源代码构建它时,我收到此警告和以下错误:

../配置

checking whether we can build usable Python eggs... In file included from /usr/include/limits.h:26:0,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/limits.h:168,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/syslimits.h:7,
                 from /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include/limits.h:34,
                 from /usr/include/python2.7/Python.h:19,
                 from testpyegg.cpp:1:
/usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^

制作:

g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[2]: *** [master/libmesos_no_3rdparty_la-master.lo] Error 1
make[2]: Leaving directory `/root/mesos-0.23.0/build/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/mesos-0.23.0/build/src'
make: *** [all-recursive] Error 1

我是不是漏掉了什么?

我想你的包坏了,你最好从包中安装东西。我使用以下顺序来缓解问题:

# Fetch the Apache Maven repo file.
$ sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo

# 'Mesos > 0.21.0' requires 'subversion > 1.8' devel package, which is
# not available in the default repositories.
# Add the WANdisco SVN repo file: '/etc/yum.repos.d/wandisco-svn.repo' with content:

  [WANdiscoSVN]
  name=WANdisco SVN Repo 1.9
  enabled=1
  baseurl=http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/$basearch/
  gpgcheck=1
  gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco

# Install essential development tools.
$ sudo yum groupinstall -y "Development Tools"

# Install other Mesos dependencies.
$ sudo yum install -y apache-maven python-devel java-1.7.0-openjdk-devel zlib-devel libcurl-devel openssl-devel cyrus-sasl-devel cyrus-sasl-md5 apr-devel subversion-devel apr-util-devel

我发现了我的错误。我只是错过了从 mesosphere 安装 python egg:

wget http://downloads.mesosphere.io/master/centos/7/mesos-0.23.0-py2.7-linux-x86_64.egg
easy_install mesos-0.23.0-py2.7-linux-x86_64.egg

这里有一个Link给所有彩蛋。