ubuntu 1604 桌面版中配置mesos测试环境

来源:互联网 发布:富通天下软件下载 编辑:程序博客网 时间:2024/06/05 03:57

原文地址 https://gist.github.com/EronWright/e9b542cd6b138a7d44f9a4af7af755f0

前置条件: ubuntu 已更新并已安装docker

配置mesos

以下所有命令, 请以 root 用户执行

安装

cat <<EOF >> /etc/apt/sources.list.d/mesosphere.listdeb http://repos.mesosphere.com/ubuntu xenial mainEOFapt updateapt-get -y install mesos marathon  

配置zookeeper

cat <<EOF >> etc/zookeeper/conf/myid1EOFcat <<EOF >> /etc/zookeeper/conf/zoo.cfgserver.1=`hostname`:2888:3888EOF

配置mesos-master

cat <<EOF >> /etc/mesos/zkzk://`hostname`:2181/mesosEOFcat <<EOF >> /etc/mesos-master/quorum1EOF

配置mesos-slave的 Containerizer

使用带docker支持的 mesos containerizer

cat <<EOF >> /etc/mesos-slave/containerizersmesosEOFcat <<EOF >> /etc/mesos-slave/image_providersdockerEOFcat <<EOF >> /etc/mesos-slave/isolationfilesystem/linux,docker/runtimeEOF

设置JAVA_HOME

一些 framework的任务执行中需要JAVA_HOME环境变量.

cat <<EOF >> /etc/mesos-slave/executor_environment_variables{  "JAVA_HOME": "/usr/lib/jvm/java-8-openjdk-amd64"}EOF

启动服务

sudo service zookeeper restartsudo service mesos-master restartsudo service mesos-slave restart

验证

验证mesos启动是否正常

MASTER=$(mesos-resolve `cat /etc/mesos/zk`)mesos-execute --master=$MASTER --name="cluster-test" --command="sleep 5"

打开浏览器

  • Mesos: http://localhost:5050
  • Marathon: http://localhost:8080
原创粉丝点击