Based on CentOS 7
准备
rpm安装包准备
环境准备
三台机器的集群,网络互通,关闭防火墙和SELinux
1 | systemctl stop firewalld && setenforce 0 |
节点 | IP | 部署服务 |
---|---|---|
1 | 10.120.177.85 | zookeeper、mesos-master、mesos-slave、marathon |
2 | 10.120.181.94 | zookeeper、mesos-master、mesos-slave、marathon |
3 | 10.120.180.209 | zookeeper、mesos-master、mesos-slave、marathon |
安装
node1、node2、node3:
1 | rpm -ivh zookeeper*.rpm |
配置
zookeeper配置
node1:
1 | echo 1 > /var/lib/zookeeper/myid |
node2:
1 | echo 2 > /var/lib/zookeeper/myid |
node3:
1 | echo 3 > /var/lib/zookeeper/myid |
node1、node2、node3配置/etc/zookeeper/zoo.cfg
1 | server.1=10.120.177.85:2888:3888 |
mesos配置
node1、node2、node3配置/etc/mesos/zk
1 | zk://10.120.177.85:2181,10.120.181.94:2181,10.120.180.209:2181/mesos |
node1、node2、node3:
1 | 集群中节点数为3 |
marathon配置
node1、node2、node3:
1 | 用于生成marathon.jar |
启动
node1、node2、node3:
1 | systemctl restart zookeeper |
可通过三个节点IP访问mesos webUI和marathon webUI,会重定向到zk选举出来的Master节点,以10.120.181.94为例:
1 | mesos webUI address: 10.120.181.94:5050 |
部署Flink
编写json格式的marathon应用描述文件flink-example.json:
1 | { |
通过Marathon WebUI提交或者使用curl命令提交:
1 | curl -X POST http://10.120.181.94:8080/v2/apps -d @flink-example.json -H "Content-type: application/json" |