常用命令总结

启动/停止 flink 集群

./bin/start-cluster.sh./bin/stop-cluster.sh

启动或停止JOBMANAGER

bin/jobmanager.sh startbin/jobmanager.sh stop

添加新的 taskmanager 节点或者重启 taskmanager 节点

bin/taskmanager.sh startbin/taskmanager.sh stop

规划

主机01 主机02 主机03
hadoop01 hadoop02 hadoop03
ip01 ip02 ip03

说明

3台主机搭建一个flink集群

解压

tar -zxvf /home/flink-1.11.1-bin-scala_2.11.tgz -C /usr/local/

小贴士:官网下载对应所需对应版本

配置环境变量

vi /etc/profile

追加如下内容

点击查看代码
export FLINK_HOME=/usr/local/flink-1.11.1/
export PATH=$PATH:$JAVA_HOME/bin:$ZK_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$KAFKA_HOME/bin:$FLINK_HOME/bin

刷新环境变量:

source /etc/profile

配置

./conf/flink-conf.yaml

点击查看代码
#==============================================================================
# Common
#==============================================================================
#jobmanager.rpc.address: hadoop01 HA模式不用
# The RPC port where the JobManager is reachable. jobmanager.rpc.port: 6123
# The heap size for the JobManager JVM jobmanager.heap.size: 1024m
# The heap size for the TaskManager JVM taskmanager.heap.size: 1024m
#==============================================================================
# Rest & web frontend
#==============================================================================
# The port to which the REST client connects to. If rest.bind-port has
# not been specified, then the server will bind to this port as well.
#
rest.port: 8081
# The address to which the REST client will connect to
#
rest.address: hadoop01
# HA settings
high-availability: zookeeper
high-availability.zookeeper.quorum: hadoop01:2181,hadoop02:2181,hadoop03:2181
high-availability.zookeeper.path.root: /flink
high-availability.cluster-id: /cluster_flink
high-availability.storageDir: hdfs://hadoop01:9000/flink/recovery

./conf/slaves

点击查看代码
hadoop01
hadoop02
hadoop03

小贴士:集群主机IP或者主机名

./conf/masters

点击查看代码
hadoop01:8081
hadoop02:8081

分发并修改hadoop02和hadoop03节点的ip或者主机名

分发:

scp -r /etc/profile hadoop02:/etc
scp -r /etc/profile hadoop03:/etc
scp -r ../flink-1.11.1/ hadoop02:/usr/local/
scp -r ../flink-1.11.1/ hadoop03:/usr/local/

修改配置:

hadoop02 --------./conf/flink-conf.yaml

修改如下

rest.address: hadoop02

hadoop03 -------- ./conf/flink-conf.yaml

修改如下

rest.address: hadoop03

启动

启动顺序:先启动zk和hdfs、再启动flflink。

启动集群

start-cluster.sh

关闭standalone模式

stop-cluster.sh

测试进程

检测每一台的jps进程

web访问地址:http://hadoop01:8081

web访问地址:http://hadoop02:8081

job historyserver配置:

配置:vi ./conf/flink-conf.yaml追加如下内容

点击查看代码
# The HistoryServer is started and stopped via bin/historyserver.sh (start|stop)
# Directory to upload completed jobs to. Add this directory to the list of
# monitored directories of the HistoryServer as well (see below).
#该目录不能创建, 则可以手动创建
jobmanager.archive.fs.dir: hdfs://hadoop01:9000/flink_completed_jobs/
# The address under which the web-based HistoryServer
listens.historyserver.web.address: 192.168.216.111
# The port under which the web-based HistoryServer listens.
historyserver.web.port: 8082
# Comma separated list of directories to monitor for completed
jobs.historyserver.archive.fs.dir: hdfs://hadoop01:9000/flink_completed_jobs/
# Interval in milliseconds for refreshing the monitored
directories.historyserver.archive.fs.refresh-interval: 10000

启动历史服务(重新启动flflink集群):

historyserver.sh start

查看进程:

jps

访问web:http://hadoop01:8082/

注意:

启动flink集群报错:

点击查看代码
Caused by: org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Could
not find a file system implementation for scheme 'hdfs'. The scheme is not
directly supported by Flink and no Hadoop file system to support this scheme
could be loaded.
at org.apache.flink.core.fs.FileSystem.getUnguardedFileSystem(FileSystem.java:447)
at org.apache.flink.core.fs.FileSystem.get(FileSystem.java:359)
at org.apache.flink.core.fs.Path.getFileSystem(Path.java:298)
at org.apache.flink.runtime.blob.BlobUtils.createFileSystemBlobStore(BlobUtils.java:116) ... 10 more
Caused by: org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Hadoop is not in the classpath/dependencies.
at org.apache.flink.core.fs.UnsupportedSchemeFactory.create(UnsupportedSchemeFactory.java:58)
at org.apache.flink.core.fs.FileSystem.getUnguardedFileSystem(FileSystem.java:443) ... 13 more

**解决办法:**
我使用的hadoop的版本是2.7.6,flink的版本是1.11.1
因为flink的checkpoint是需要记录在hdfs上,但是应该是flink1.8之后的就把hadoop的一些依赖删除了,所以报错找不到相应的jar包。
手动将flink对hadoop的依赖包进行导入到flink的lib目录下即可。
flink-shaded-hadoop-2-uber-2.7.5-10.0.jar
下载地址:
https://repo.maven.apache.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/2.7.5-10.0/flink-shaded-hadoop-2-uber-2.7.5-10.0.jar

FLINK集群搭建的更多相关文章

  1. 实时计算框架:Flink集群搭建与运行机制

    一.Flink概述 1.基础简介 Flink是一个框架和分布式处理引擎,用于对无界和有界数据流进行有状态计算.Flink被设计在所有常见的集群环境中运行,以内存执行速度和任意规模来执行计算.主要特性包 ...

  2. Flink 集群搭建,Standalone,集群部署,HA高可用部署

    基础环境 准备3台虚拟机 配置无密码登录 配置方法:https://ipooli.com/2020/04/linux_host/ 并且做好主机映射. 下载Flink https://www.apach ...

  3. ubuntu18.04 flink-1.9.0 Standalone集群搭建

    集群规划 Master JobManager Standby JobManager Task Manager Zookeeper flink01 √ √ flink02 √ √ flink03 √ √ ...

  4. Kafka_2.12-2.5.1集群搭建与参数调优

    Kafka是目前业界使用最广泛的消息队列.数据流转常见这样的业务场景,客户端把采集到的日志推送给Kafka,业务方可以消费Kafka的数据落地HDFS,用于离线分析,也可以使用Spark或Flink消 ...

  5. 第06讲:Flink 集群安装部署和 HA 配置

    Flink系列文章 第01讲:Flink 的应用场景和架构模型 第02讲:Flink 入门程序 WordCount 和 SQL 实现 第03讲:Flink 的编程模型与其他框架比较 第04讲:Flin ...

  6. 【Oracle 集群】Linux下Oracle RAC集群搭建之Oracle DataBase安装(八)

    Oracle 11G RAC数据库安装(八) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总 ...

  7. 【Oracle 集群】Linux下Oracle RAC集群搭建之基本测试与使用(九)

    Oracle 11G RAC数据库安装(九) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总 ...

  8. 【Data Cluster】真机环境下MySQL数据库集群搭建

    真机环境下MySQL-Cluster搭建文档  摘要:本年伊始阶段,由于实验室对不同数据库性能测试需求,才出现MySQL集群搭建.购置主机,交换机,双绞线等一系列准备工作就绪,也就开始集群搭建.起初笔 ...

  9. (四)Spark集群搭建-Java&Python版Spark

    Spark集群搭建 视频教程 1.优酷 2.YouTube 安装scala环境 下载地址http://www.scala-lang.org/download/ 上传scala-2.10.5.tgz到m ...

  10. (三)Spark-Hadoop集群搭建-Java&Python版Spark

    Spark-Hadoop集群搭建 视频教程: 1.优酷 2.YouTube 配置java 启动ftp [root@master ~]# /etc/init.d/vsftpd restart 关闭 vs ...

随机推荐

  1. 更换CentOS的下载源为阿里云

    阿里Linux镜像地址:http://mirrors.aliyun.com/ 1.备份mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/Cen ...

  2. SpringBoot导读

    SpringBoot 一.导读 1.开发工具及技术栈 JDK:jdk1.8.0_191 开发工具:IntelliJIDEA 2020.3.2 SpringBoot: 简化Spring的开发 需要一定的 ...

  3. 《OKR源于英特尔和谷歌的目标管理利器》读书笔记

    17年10月下旬至11月,因团队需要改变考核方式以及更好的服务业务,Q4将尝试OKR的方式进行考核,故阅读了此书,有些想法与笔记. OKR定义:OKR是一套严密的思考框架和持续的纪律要求,旨在确保员工 ...

  4. centos7 安装jupyter

    1.基本包安装 yum update -y yum install python-pip -y yum install bzip2 -y yum groupinstall "Developm ...

  5. iOS开发 React Native与iOS交互汇总

    RN简介 React Native 是一个使用React和应用平台的原生功能来构建 Android 和 iOS 应用的开源框架.起源于faceBbook内部,2013开源. React Native ...

  6. pgsql给表重命名

    alter table "pavement_damage_dtl_temp" rename to "pavement_damage_dtl"; 搜索 复制

  7. TypeScript Array(数组)

    TypeScript Array(数组) 数组对象是使用单独的变量名来存储一系列的值. 数组非常常用. 假如你有一组数据(例如:网站名字),存在单独变量如下所示: var site1="Go ...

  8. Docker部署Nastool(含jellyfin、transmission)

    先弄清楚原理 首先从[资源搜索]或者[推荐栏目]寻找自己想看的电影,执行订阅或者搜索资源启动下载,下载电影存放在downloads/mov目录下,[媒体整理]就是将mov子目录下电影文件复制到down ...

  9. matlab 求解 f(x)=x(x+1)(x+2)(x+3)(x+4)...(x+n-2)(x+n-1)(x+n)的导数;

    matlab 求解 f(x)=x(x+1)(x+2)(x+3)(x+4)...(x+n-2)(x+n-1)(x+n)的导数; matlab diff() 问题的提出 问题 代码求解 clc; clea ...

  10. node.js发送短信验证码(附带60秒倒计时插件)

    推荐一个简单且功能齐全的发送短信验证码接口1.安装下载后的SDK只包含一个zhenzisms.js文件,直接导入到工程中即可使用.下载 2.用法引入模块 const zhenzismsClient = ...