CentOS 7 安装Mesos+Marathon+Zookeeper

CentOS 7 安装Mesos+Marathon+Zookeeper

1.地址规划

  • 192.168.1.110  master1
  • 192.168.1.111  master2
  • 192.168.1.112  master3

 

  • 192.168.1.115  salve1
  • 192.168.1.116  salve2

Master节点:

1.关闭防火墙

systemctl stop firewalld && systemctl disable firewalld

2.关闭selinux

setenforce 0

3.安装mesosphere源

rpm -ivh /mesosphere-el-repo-7-1.noarch.rpm

4.安装mesos及相关软件

yum -y install mesos  mesosphere-zookeeper

5.配置zookeeper

  • master1: echo 1 > /var/lib/zookeeper/myid
  • master2: echo 2 > /var/lib/zookeeper/myid
  • master3: echo 3 > /var/lib/zookeeper/myid

vi /etc/zookeeper/conf/zoo.cfg  #加入

  • server.1=192.168.1.110:2888:3888
  • server.2=192.168.1.111:2888:3888
  • server.3=192.168.1.112:2888:3888

6.配置mesos

master1 master2 master3

vi /etc/mesos/zk  #加入

zk://192.168.1.110:2181,192.168.1.111:2181,192.168.1.112:2181/mesos

echo 2 > /etc/mesos-master/quorum  #加入

  • master1: echo 192.168.1.110 | sudo tee /etc/mesos-master/hostname
  • master2: echo 192.168.1.111 | sudo tee /etc/mesos-master/hostname
  • master3: echo 192.168.1.112 | sudo tee /etc/mesos-master/hostname

7.配置marathon

去官网下载marathon.tar.gz

master1 master2 master3

tar zxvf  marathon.tar.gz

cd marathon/

启动: ./bin/start --master zk://192.168.0.180:2181,192.168.0.227:2181,192.168.0.221:2181/mesos --zk zk://192.168.0.180:2181,192.168.0.227:2181,192.168.0.221:2181/marathon

8.启动mesos-master,zookeeper

systemctl start  zookeeper && systemctl start mesos-master

systemctl disable mesos-slave

Slave节点:

1.关闭防火墙

systemctl stop firewalld && systemctl disable firewalld

2.关闭selinux

setenforce 0

3.安装mesosphere源

rpm -ivh /mesosphere-el-repo-7-1.noarch.rpm

4.安装mesos

yum -y install  mesos

5.配置mesos

slave1  slave2

vi /etc/mesos/zk  #加入

zk://192.168.1.110:2181,192.168.1.111:2181,192.168.1.112:2181/mesos

  • slave1: echo 192.168.1.115 | sudo tee /etc/mesos-slave/hostname
  • slave2: echo 192.168.1.116 | sudo tee /etc/mesos-slave/hostname

6.启动mesos-slave

systemctl start  mesos-slave  && systemctl enable  mesos-slave

systemctl disable mesos-master

测试:

输入192.168.0.111:5050

随便输入一个master的地址就OK,zookeeper会自动选出一个leader

CentOS 7 安装Mesos+Marathon+Zookeeper

CentOS 7 安装Mesos+Marathon+Zookeeper

输入192.168.0.111:8080,可利用其发布docker镜像并可调整应用数量

CentOS 7 安装Mesos+Marathon+Zookeeper

相关推荐