2015-08-20 35 views
0

我想在我的Mesos Cluster(0.23)上運行一個簡單的python框架,它運行在CentOS 7.1上。我在mesosphere packages上安裝了Mesos,一切正常(我正在運行一些Marathon作業)。但是當我想用Python開始開發自己的框架時,我陷入了困境。我使用James J Porter的這個example,我知道他在mesos 0.20.0上測試了它,但是我認爲我可以在Mesos 0.23上花點功夫運行它。在CentOS 7.1上的Mesos 0.23.0上運行自己的python框架

起初我從python得到一個導入錯誤,它說mesos.native和mesos.interface不可用。然後我試圖做一個easy_install的,但我找不到mesos.native並試圖6.在安裝「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 

當我試圖從源代碼構建它,我得到這個警告,並出現以下錯誤:

../configure

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 

我錯過了什麼嗎?

回答

1

我發現我的錯誤。我只是錯過了安裝,從中間層安裝蟒蛇蛋:

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到所有的雞蛋。

+0

下載仍然有效,但鏈接無處可查。你將如何安裝更大的mesos版本(0.28)? – odedfos

+0

您可以在這裏找到所有鏈接:http://open.mesosphere.com/downloads/mesos/#apache-mesos-0.28.0 - 鏈接爲Mesos 0.28和CentOS 7在這裏http://repos.mesosphere.com/ el/7/x86_64/RPMS/mesos-0.28.0-2.0.16.centos701406.x86_64.rpm –

+0

我指的是每個版本的python egg文件。他們曾經出現在下載頁面,但不在那裏了。 – odedfos

0

我想你的軟件包壞了,你最好從軟件包中安裝東西。我曾使用以下順序來緩解問題:

# 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