Flink 集群部署

Flink 集群部署

Flink 集群部署分类

根据以下两种条件将集群部署模式分为三种类型:

1、集群的生命周期和资源隔离;

2、根据程序main()方法执行在Client 还是JobManager

  • Session Mode
    • 共享JobManager 和TaskManager,所有提交的Job都在一个Runtime中运行
  • Pre-Job Mode
    • 独享JobManager 和TaskManager,好比为每个Job单独启动一个Runtime
  • Application Mode (1.11版本提出)
    • Application的main()运行在Cluster上,而不在客户端
    • 每个Application对应一个Runtime,Application中可以包含有多个Job

Flink支持资源管理器

  • Standalone
  • Hadoop Yarn
  • Apache Mesos
  • Docker
  • Kubernetes
Cluster ManagementSession 模式Pre-Job模式Application 模式Native 模式是否生产可用是否支持高可用国内接受度
Local支持不支持不支持不支持不支持
Standalone支持不支持不支持不支持支持
Yarn支持支持支持支持支持
Mesos支持支持不支持支持支持
Docker支持支持不支持不支持不支持
Kubernetes支持支持支持支持支持

Standalone

单机

https://flink.apache.org/downloads.html

wget https://dlcdn.apache.org/flink/flink-1.16.0/flink-1.16.0-bin-scala_2.12.tgz
tar -zxvf flink-1.16.0-bin-scala_2.12.tgz
cd flink-1.16.0 & ./bin/start-cluster.sh

多机

修改 conf/flink-conf.yaml:
high-availability: zookeeper
high-availability.zookeeper.quorum: node01:2181,node02:2181,node03:2181,node04:2181,node05:2181 
high-availability.zookeeper.path.root: /flink 
#high-availability.cluster-id: /cluster_one # important: customize per cluster 
high-availability.storageDir: hdfs:///flink/recovery
配置 conf/masters:
localhost:8081 
localhost:8082
配置 conf/zoo.cfg(可选):
server.0=localhost:2888:3888
启动 HA 集群
$ bin/start-cluster.sh 
Starting HA cluster with 2 masters and 1 peers in ZooKeeper quorum. 
Starting standalonesession daemon on host localhost. 
Starting standalonesession daemon on host localhost. 
Starting taskexecutor daemon on host localhost.

Yarn

Session 集群启动:

./bin/yarn-session.sh -jm 1024m -tm 4096m

Job 集群启动:

./bin/flink run -m yarn-cluster -p 4 -yjm 1024m -ytm 4096m ./examples/batch/WordCout.jar

Application Mode集群启动:

./bin/flink run-application -t yarn-application \
-Djobmanager.memory.process.size=2048m \
-Dtaskmanager.memory.process.size=4096m \
-Dyarn.provided.lib.dirs="hdfs://node02:8020/flink-training/flink-1.16.0" \
./MyApplication.jar
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值