Flink 集群搭建安装 CentOS 7.x 版本

基本准备:

  • JDK
  • 免密登录(不设置后期启动可以手动输入密码)
  • Centos 7.x

一、下载Flink

下载地址:http://flink.apache.org/downloads.html 

我这里使用:https://www.apache.org/dyn/closer.lua/flink/flink-1.9.0/flink-1.9.0-bin-scala_2.11.tgz

二、解压

tar -zxvf flink-1.9.0-bin-scala_2.11.tgz 

三、修改配置文件

进入目录

flink-1.9.0/conf

修改masters文件

vi masters

修改内容如下 

# cat masters 
jast4:8081

修改slaves文件

[jast@xxx conf]$ vi slaves 
您在 /var/spool/mail/root 中有邮件
[jast@xxx conf]$ cat slaves 
jast1
jast2
jast3

修改flink-conf.yaml文件,内容如下

################################################################################
#  Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you under the Apache License, Version 2.0 (the
#  "License"); you may not use this file except in compliance
#  with the License.  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
# limitations under the License.
#################################################################################==============================================================================
# Common
#==============================================================================# The external address of the host on which the JobManager runs and can be
# reached by the TaskManagers and any clients which want to connect. This setting
# is only used in Standalone mode and may be overwritten on the JobManager side
# by specifying the --host <hostname> parameter of the bin/jobmanager.sh executable.
# In high availability mode, if you use the bin/start-cluster.sh script and setup
# the conf/masters file, this will be taken care of automatically. Yarn/Mesos
# automatically configure the host name based on the hostname of the node where the
# JobManager runs.jobmanager.rpc.address: fwqzx012# The RPC port where the JobManager is reachable.jobmanager.rpc.port: 6123# The heap size for the JobManager JVMjobmanager.heap.size: 1024m# The heap size for the TaskManager JVMtaskmanager.heap.size: 1024m# The number of task slots that each TaskManager offers. Each slot runs one parallel pipeline.taskmanager.numberOfTaskSlots: 2# The parallelism used for programs that did not specify and other parallelism.parallelism.default: 1# The default file system scheme and authority.
# 
# By default file paths without scheme are interpreted relative to the local
# root file system 'file:///'. Use this to override the default and interpret
# relative paths relative to a different file system,
# for example 'hdfs://mynamenode:12345'
#
# fs.default-scheme#==============================================================================
# High Availability
#==============================================================================# The high-availability mode. Possible options are 'NONE' or 'zookeeper'.
#
# high-availability: zookeeper# The path where metadata for master recovery is persisted. While ZooKeeper stores
# the small ground truth for checkpoint and leader election, this location stores
# the larger objects, like persisted dataflow graphs.
# 
# Must be a durable file system that is accessible from all nodes
# (like HDFS, S3, Ceph, nfs, ...) 
#
# high-availability.storageDir: hdfs:///flink/ha/# The list of ZooKeeper quorum peers that coordinate the high-availability
# setup. This must be a list of the form:
# "host1:clientPort,host2:clientPort,..." (default clientPort: 2181)
#
# high-availability.zookeeper.quorum: localhost:2181# ACL options are based on https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html#sc_BuiltinACLSchemes
# It can be either "creator" (ZOO_CREATE_ALL_ACL) or "open" (ZOO_OPEN_ACL_UNSAFE)
# The default value is "open" and it can be changed to "creator" if ZK security is enabled
#
# high-availability.zookeeper.client.acl: open#==============================================================================
# Fault tolerance and checkpointing
#==============================================================================# The backend that will be used to store operator state checkpoints if
# checkpointing is enabled.
#
# Supported backends are 'jobmanager', 'filesystem', 'rocksdb', or the
# <class-name-of-factory>.
#
# state.backend: filesystem# Directory for checkpoints filesystem, when using any of the default bundled
# state backends.
#
# state.checkpoints.dir: hdfs://namenode-host:port/flink-checkpoints# Default target directory for savepoints, optional.
#
# state.savepoints.dir: hdfs://namenode-host:port/flink-checkpoints# Flag to enable/disable incremental checkpoints for backends that
# support incremental checkpoints (like the RocksDB state backend). 
#
# state.backend.incremental: false# The failover strategy, i.e., how the job computation recovers from task failures.
# Only restart tasks that may have been affected by the task failure, which typically includes
# downstream tasks and potentially upstream tasks if their produced data is no longer available for consumption.jobmanager.execution.failover-strategy: region#==============================================================================
# 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: 0.0.0.0# Port range for the REST and web server to bind to.
#
#rest.bind-port: 8080-8090# The address that the REST & web server binds to
#
#rest.bind-address: 0.0.0.0# Flag to specify whether job submission is enabled from the web-based
# runtime monitor. Uncomment to disable.#web.submit.enable: false#==============================================================================
# Advanced
#==============================================================================# Override the directories for temporary files. If not specified, the
# system-specific Java temporary directory (java.io.tmpdir property) is taken.
#
# For framework setups on Yarn or Mesos, Flink will automatically pick up the
# containers' temp directories without any need for configuration.
#
# Add a delimited list for multiple directories, using the system directory
# delimiter (colon ':' on unix) or a comma, e.g.:
#     /data1/tmp:/data2/tmp:/data3/tmp
#
# Note: Each directory entry is read from and written to by a different I/O
# thread. You can include the same directory multiple times in order to create
# multiple I/O threads against that directory. This is for example relevant for
# high-throughput RAIDs.
#
# io.tmp.dirs: /tmp# Specify whether TaskManager's managed memory should be allocated when starting
# up (true) or when memory is requested.
#
# We recommend to set this value to 'true' only in setups for pure batch
# processing (DataSet API). Streaming setups currently do not use the TaskManager's
# managed memory: The 'rocksdb' state backend uses RocksDB's own memory management,
# while the 'memory' and 'filesystem' backends explicitly keep data as objects
# to save on serialization cost.
#
# taskmanager.memory.preallocate: false# The classloading resolve order. Possible values are 'child-first' (Flink's default)
# and 'parent-first' (Java's default).
#
# Child first classloading allows users to use different dependency/library
# versions in their application than those in the classpath. Switching back
# to 'parent-first' may help with debugging dependency issues.
#
# classloader.resolve-order: child-first# The amount of memory going to the network stack. These numbers usually need 
# no tuning. Adjusting them may be necessary in case of an "Insufficient number
# of network buffers" error. The default min is 64MB, the default max is 1GB.
# 
# taskmanager.network.memory.fraction: 0.1
# taskmanager.network.memory.min: 64mb
# taskmanager.network.memory.max: 1gb#==============================================================================
# Flink Cluster Security Configuration
#==============================================================================# Kerberos authentication for various components - Hadoop, ZooKeeper, and connectors -
# may be enabled in four steps:
# 1. configure the local krb5.conf file
# 2. provide Kerberos credentials (either a keytab or a ticket cache w/ kinit)
# 3. make the credentials available to various JAAS login contexts
# 4. configure the connector to use JAAS/SASL# The below configure how Kerberos credentials are provided. A keytab will be used instead of
# a ticket cache if the keytab path and principal are set.# security.kerberos.login.use-ticket-cache: true
# security.kerberos.login.keytab: /path/to/kerberos/keytab
# security.kerberos.login.principal: flink-user# The configuration below defines which JAAS login contexts# security.kerberos.login.contexts: Client,KafkaClient#==============================================================================
# ZK Security Configuration
#==============================================================================# Below configurations are applicable if ZK ensemble is configured for security# Override below configuration to provide custom ZK service name if configured
# zookeeper.sasl.service-name: zookeeper# The configuration below must match one of the values set in "security.kerberos.login.contexts"
# zookeeper.sasl.login-context-name: Client#==============================================================================
# HistoryServer
#==============================================================================# 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:///completed-jobs/# The address under which the web-based HistoryServer listens.
#historyserver.web.address: 0.0.0.0# 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:///completed-jobs/# Interval in milliseconds for refreshing the monitored directories.
#historyserver.archive.fs.refresh-interval: 10000

四、将flink目录发送到各个服务器

scp -r flink-1.9.0 jast@xxx.xxx.xxx:/home/jast

五、配置环境变量

在 bashrc 中添加

export FLINK_HOME=/home/jast/flink-1.9.0
export PATH=$PATH:$FLINK_HOME/bin

使用 source 命令使配置生效

五、启动服务

start-cluster.sh

六、查看webUI

访问 http://jast4:8081 ,如下图所示搭建成功

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/509876.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

web通讯录之登录注册界面

登录页面&#xff1a; 功能说明&#xff1a;登录页面是在页面模糊背景网站中找的素材加以修改成自己想要的登录界面&#xff0c;我们老师让我们在登录时候加验证码&#xff0c;看了大部分人用的是签名登录方式&#xff0c;觉得没有什么特色因此设计了滑动登录&#xff0c;把验证…

使用IntelliJ IDEA导入 Flink 消费kafka报错 Error: A JNI error has occurred, please check your installation an

提示找不到类&#xff0c;pom中已经引用了jar包&#xff0c;使用eclipse也可以执行&#xff0c;就是IntelliJ不行 java.lang.NoClassDefFoundError: org/apache/flink/api/common/serialization/DeserializationSchemaat java.lang.Class.getDeclaredMethods0(Native Method)a…

有限状态机/FSM

有限状态机&#xff08;FSM&#xff09;的设计与实现&#xff08;一&#xff09; 有限状态机&#xff08;FSM&#xff09;是表示有限个状态及在这些状态之间的转移和动作等行为的数学模型&#xff0c;在计算机领域有着广泛的应用。通常FSM包含几个要素&#xff1a;状态的管理、…

web通讯录之通讯录主界面

界面展示&#xff1a; 界面所用的素材网址点击打开链接&#xff0c;在用网上素材时候首先要把代码看懂才能进行修改&#xff0c;因此希望读者好好看看源码&#xff0c;看的时候着重看看字母排序原理、JQuery设计等等。 分组展示&#xff1a;这个地方有个不好的地方&#xff0c…

NameNode 启动失败 - There appears to be a gap in the edit log. We expected txid xxx, but got tx

场景 NameNode迁移&#xff0c;导致一个节点无法启动 异常 在Namenode主动迁移&#xff0c;或者Namenode机器挂掉无法恢复时&#xff0c;我们需要Namenode节点迁移&#xff0c;迁移经常会出现一个NameNode启动成功&#xff0c;另外一个standby启动失败&#xff0c;报错如下 …

opengl光照

看一张图片&#xff1a; 图中绘制了两个大小相同的白色球体。其中右边的一个是没有使用任何光照效果的&#xff0c;它看起来就像是一个二维的圆盘&#xff0c;没有立体的感觉。左边的一个是使用了简单的光照效果的&#xff0c;我们通过光照的层次&#xff0c;很容易的认为它是一…

Nifi 之 kafka消费存入hbase

添加kafka processor&#xff0c;配置如下 kakfa数据格式为JSON&#xff1a; {"events_tag":"103913","query_word":"华大癌变 虎嗅","time":"2018-08-09 13:01:11"} 添加putHbaseJSON&#xff0c;json格式添加数…

web通讯录之搜索功能

手机号搜索&#xff1a; 姓名搜索&#xff1a; 拼音搜索&#xff1a; 城市搜索&#xff1a; 性别搜索&#xff1a; 点击姓名或者电话显示完整信息 相信大家期待自己所写的搜索功能类似于百度、谷歌这种搜索引擎&#xff0c;有兴趣的读者可以去学学SEO&#xff0c;在这里我…

Hbase 删表过程

Hbase 执行删表命令后(drop)&#xff0c;表的数据会移动到 /hbase/archive 目录下&#xff0c;并不会直接从hdfs删除&#xff0c;后台会有进程定期去检查&#xff08;默认五分钟&#xff09;&#xff0c;如果这张表没有快照则会删除&#xff0c;有快照会保留数据。 刚drop时&a…

opengl纹理单元

可以这样简单的理解为&#xff1a;显卡中有N个纹理单元&#xff08;具体数目依赖你的显卡能力&#xff09;&#xff0c;每个纹理单元&#xff08;GL_TEXTURE0、GL_TEXTURE1等&#xff09;都有GL_TEXTURE_1D、GL_TEXTURE_2D等&#xff0c;如下代码&#xff1a; [cpp] view plain…

Spark 创建 hive表报错 ROW FORMAT DELIMITED is only compatible with 'textfile', not 'parquet'

场景&#xff1a; 在spark分析数据时&#xff0c;创建hive表失败。 提示异常 &#xff1a; 19/10/09 10:59:18 INFO execution.SparkSqlParser: Parsing command: CREATE EXTERNAL TABLE IF NOT EXISTS dm_xxx.user_area(biFollowersCount String,city String,created_at Str…

多重纹理和纹理组合器

多重纹理和纹理组合器 本文主要介绍OpenGL中两种技术的使用方法&#xff1a;多重纹理技术和纹理组合器技术&#xff0c;最终根据参考【2】中的代码&#xff0c;实现了两个简单的演示DEMO&#xff0c;其中使用到了《八叉树颜色量化、BMP、TGA文件解析》篇章中提供的图像解析类。…

ClouderaManager agent 报错,无法连接到结群 Error, CM server guid updated, expected xxx , received xxx

场景 集群版本&#xff1a;CDH 6.0.1 服务器版本&#xff1a;Centos 7.3 JAVA版本&#xff1a;1.8 异常出现原因 搭建集群中遇到异常&#xff0c;删除agent节点&#xff0c;重新部署CM后发现异常&#xff0c;CDH处于无法使用状态 异常 查看agent日志会出现,说无法连接到…

CDH Kerberos 认证下Kafka 消费方式

集群Kerberos认证安装参考&#xff1a;https://datamining.blog.csdn.net/article/details/98480008 目录 环境&#xff1a; 配置 Java Producer 代码 文件内容&#xff1a; kafka_client_jaas.conf krb5.conf ( kerberos 配置文件复制过来即可) kafka.keytab Java Co…

IntelliJ IDEA Maven jar包冲突解决,快速发现jar包冲突

IntelliJ IDEA 自带的Diagrams 去查看jar包冲突相当费劲 ~ &#xff0c;安装个插件即可快速解决该问题 打开Settings&#xff0c;搜索maven helper&#xff0c;并安装 安装完成后&#xff0c;直接打开pom文件&#xff0c;点击Dependency Analyzer 删除冲突jar包&#xff0c;在…

osg基本图元

OSG绘制几何体学习总结&#xff08;超全&#xff09;在osg中&#xff0c;场景图形采用一种自顶向下的&#xff0c;分层的树状数据结构来组织空间数据集&#xff0c;以提高渲染的效率 场景图形树结构的顶部是一个根节点&#xff0c;从根节点向下延伸&#xff0c;各个组节点中均包…

如何用css设计出商品购物图片

代码&#xff1a; 常见问题&#xff1a;背景填充时候图片大小不一致、重复等等问题&#xff0c;建议在插入图片的时候最好不用img标签直接在div中添加背景图片&#xff0c;有利于对背景图片的更改。 插入图片&#xff1a;background-image: url(../img/product-auto/benz-amg-s…

OLTP、OLAP与HTAP 区别

OLTP On-Line Transaction Processing联机事务处理过程(OLTP) 也称为面向交易的处理过程&#xff0c;其基本特征是前台接收的用户数据可以立即传送到计算中心进行处理&#xff0c;并在很短的时间内给出处理结果&#xff0c;是对用户操作快速响应的方式之一。 这样做的最大优点…

osg布告板技术(Billboard)

公告牌技术,即billboard技术,在3D游戏中有着广泛的应用.它的本质就是用预先做好的几幅 位图来代替3D物体,极大地节省资源和提高速度.仔细观察<<魔法门>>系列游戏,它的精灵,树木,物 品都是二维图象,但由于它始终朝向观察者,你根本看不到它"扁"的一面,所以…

osg坐标系转换

osg中将局部坐标系下的点坐标换算成全局坐标系下点的坐标 标签&#xff1a; matrixlist2012-05-17 16:27 2940人阅读 评论(1) 收藏 举报分类&#xff1a;osg&#xff08;7&#xff09; 坐标变换版权声明&#xff1a;本文为博主原创文章&#xff0c;未经博主允许不得转载。 今天…