码迷,mamicode.com
首页 > 其他好文 > 详细

Flink-on-yarn

时间:2018-11-23 18:39:27      阅读:325      评论:0      收藏:0      [点我收藏+]

标签:conf   介绍   XML   run   res   apach   cluster   daemon   创建   

介绍

官网下载

flink集群地址

  • ddcve: master
  • dddve: slave
  • ddeve: slave

解压

tar -xzvf flink-1.6.1-bin-hadoop28-scala_2.11.tgz
mv flink-1.6.1 flink
cd flink

修改配置

  • 指定master
    • vim conf/flink-conf.yaml
    jobmanager.rpc.address: ddcve   # 指定master
  • 指定slaves
echo -e "dddve\nddeve" > conf/slaves

添加yarn配置项

  • hadoop/etc/hadoop/yarn-site.xml
<property>
    <name>yarn.nodemanager.resource.cpu-vcores</name>
    <value>8</value>
</property>
./bin/start-cluster.sh
  • 输出结果如下
Starting HA cluster with 2 masters.
Starting standalonesession daemon on host ddcvc.
Starting standalonesession daemon on host ddcve.
Starting taskexecutor daemon on host dddve.
Starting taskexecutor daemon on host ddeve.

以下操作都在slave

  • 启动yarn-session
./bin/yarn-session.sh -d -n 4 -tm 2048 -s 4
  • 提交job
# 先在hdfs创建输入文件
hadoop fs -copyFromLocal /tmp/passwd /tmp/passwd

# 提交
./bin/flink run ./examples/batch/WordCount.jar --input hdfs:///tmp/passwd
  • 修改conf/flink-conf.yaml
high-availability: zookeeper
high-availability.storageDir: hdfs:///flink/ha/
high-availability.zookeeper.quorum: ddcva:2181,dddva:2181,ddeva:2181
recovery.zookeeper.path.root: /flink
high-availability.zookeeper.client.acl: open
state.backend: filesystem
  • 修改conf/masters
ddcvc:8081
ddcve:8081

Flink-on-yarn

标签:conf   介绍   XML   run   res   apach   cluster   daemon   创建   

原文地址:https://www.cnblogs.com/dzqk/p/10008889.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!