Mesos安装配置

本文档详细介绍了在Ubuntu 18.04上安装Mesos的步骤,包括安装依赖、设置JAVA_HOME、构建和启动Mesos。在构建过程中遇到的问题如硬盘空间不足、编译错误及找不到类等问题,也提供了相应的解决方案,如增加交换分区和手动下载protobuf库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

官方文档

http://mesos.apache.org/documentation/latest/building/

安装依赖

Ubuntu18.04

换源

junyu@junyu:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.2 LTS
Release:	18.04
Codename:	bionic
junyu@junyu:~$ sudo apt update
junyu@junyu:~$ sudo gedit /etc/apt/sources.list

最前面粘贴

deb http://mirrors.aliyun.com/ubuntu/ bionic main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main multiverse restricted universe

然后更新源

junyu@junyu:~$ sudo apt update --fix-missing
junyu@junyu:~$ sudo apt -y upgrade

mesos依赖

# Update the packages.
$ sudo apt-get update

# Install a few utility tools.
$ sudo apt-get install -y tar wget git

# Install the latest OpenJDK.
$ sudo apt-get install -y openjdk-8-jdk

# Install autotools (Only necessary if building from git repository).
#$ sudo apt-get install -y autoconf libtool

# Install other Mesos dependencies.
$ sudo apt-get -y install build-essential python-dev python-six python-virtualenv libcurl4-nss-dev libsasl2-dev libsasl2-modules maven libapr1-dev libsvn-dev zlib1g-dev iputils-ping

设置JAVA_HOME(我没有设置)

root@junyu:/home/junyu/mesos/build# which javac
/usr/lib/jvm/java-8-openjdk-amd64/bin/javac
root@junyu:/home/junyu/mesos/build# gedit ~/.bashrc
export   JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export   CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export   PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export   JRE_HOME=$JAVA_HOME/jre
root@junyu:/home/junyu/mesos/build# . ~/.bashrc 

构建Mesos

下载Mesos

junyu@junyu:~$ wget http://www.apache.org/dist/mesos/1.7.2/mesos-1.7.2.tar.gz
junyu@junyu:~$ tar -xzf mesos-1.7.2.tar.gz 
junyu@junyu:~$ rm mesos-1.7.2.tar.gz ; mv mesos-1.7.2 mesos

构建Mesos

需求:
硬盘至少30G,内存至少4G,如果使用虚拟机,构建时间很长,需要多分配几个CPU。
在Mesos目录中创建一个build目录,在编译过程中输出的文件将全部放入该目录中,在一次编译完成后,build中的输出文件可以直接在其他同类型OS上使用,无须再在其他节点重新编译。

使用make进行编译,make check构建实例Framework来验证编译环境,最后通过make install安装

# Change working directory.
$ cd mesos

# Bootstrap (Only required if building from git repository).
#$ ./bootstrap

# Configure and build.
$ mkdir build
$ cd build
$ ../configure

# In order to speed up the build and reduce verbosity of the logs, you can append -j <number of cores> V=0 to make.如make -j8,make -j8 check,make -j8 install代表8核
$ make

# Run test suite. 
$ make check

# Install (Optional).
$ make install

启动Mesos

在启动Mesos之前,先建立Mesos工作目录,并授予权限:

junyu@junyu:~/mesos/build$ sudo mkdir -p /var
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值