Flink会话集群docker-compose一键安装

这篇具有很好参考价值的文章主要介绍了Flink会话集群docker-compose一键安装。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

1、安装docker

参考,本人这篇博客:一键安装docker

2、flink-conf.yaml

flink-conf.yaml放在/home/flink/conf/job、/home/flink/conf/task下面,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: jobmanager

# The RPC port where the JobManager is reachable.

jobmanager.rpc.port: 6123


# The total process memory size for the JobManager.
#
# Note this accounts for all memory usage within the JobManager process, including JVM metaspace and other overhead.

jobmanager.memory.process.size: 4096m

# The total process memory size for the TaskManager.
#
# Note this accounts for all memory usage within the TaskManager process, including JVM metaspace and other overhead.

taskmanager.memory.process.size: 16384m

# To exclude JVM metaspace and overhead, please, use total Flink memory size instead of 'taskmanager.memory.process.size'.
# It is not recommended to set both 'taskmanager.memory.process.size' and Flink memory.
#
# taskmanager.memory.flink.size: 1280m

# The number of task slots that each TaskManager offers. Each slot runs one parallel pipeline.

taskmanager.numberOfTaskSlots: 10

# 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: file:/tmp/savepoint

# 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

# 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.memory.network.fraction: 0.1
# taskmanager.memory.network.min: 64mb
# taskmanager.memory.network.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

blob.server.port: 6124
query.server.port: 6125

3、docker-compose.yaml

使用如下命令部署集群:

docker-compose -f docker-compose.yml up -d

docker-compose.yaml内容如下:

version: "2.1"
services:
  jobmanager:
    image: flink:1.12.7-scala_2.11
    expose:
      - "6123"
    ports:
      - "8081:8081"
    command: jobmanager
    environment:
      - JOB_MANAGER_RPC_ADDRESS=jobmanager
    volumes:
      - /home/flink/conf/job/flink-conf.yaml:/opt/flink/conf/flink-conf.yaml
    restart: always

  taskmanager:
    image: flink:1.12.7-scala_2.11
    expose:
      - "6121"
      - "6122"
    depends_on:
      - jobmanager
    command: taskmanager
    links:
      - "jobmanager:jobmanager"
    environment:
      - JOB_MANAGER_RPC_ADDRESS=jobmanager
    volumes:
      - /home/flink/conf/task/flink-conf.yaml:/opt/flink/conf/flink-conf.yaml
    restart: always

4、启动后

Flink会话集群docker-compose一键安装,虚拟机&amp;容器,实战,其它,flink,大数据,安装,docker

5、页面访问

访问地址:http://IP:8081
Flink会话集群docker-compose一键安装,虚拟机&amp;容器,实战,其它,flink,大数据,安装,docker文章来源地址https://www.toymoban.com/news/detail-791297.html

到了这里,关于Flink会话集群docker-compose一键安装的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【docker】docker-compose安装带ui页面的kafka集群

    在日常的工作当中,kafka集群作为常用的中间件,其搭建过程略显繁琐,需要配置的文件颇多,为了方便各位初学者快速体验kafka的魅力,本文采取一键式安装kafka-3.3.1(不带zookeeper版本)的集群化安装。 仅需将下面配置中的10.0.0.147 改为自己本机的ip即可 执行 命令安装即可

    2024年02月14日
    浏览(51)
  • 一键卸载docker、docker-compose

    1、创建卸载文件: docker-uninstall.sh   docker-uninstall.sh 2、vim  docker-uninstall.sh,输入以下内容 # 卸载旧版本的Docker yum remove docker                   docker-client                   docker-client-latest                   docker-common                   docker-latest          

    2024年02月03日
    浏览(49)
  • 【Docker】(七)使用docker-compose一键部署环境

    本系列文章记录了从0开始学习Docker的过程,Docker系列历史文章: (一)基本概念与安装使用 (二)如何使用Docker发布一个SpringBoot服务 (三)使用registry远程镜像仓库管理镜像 (四)使用volume持久化Docker容器中的Redis数据 (五)使用bind mounts修改Docker容器中的Nginx配置 (六)

    2024年02月08日
    浏览(43)
  • docker-compose一键启动neo4j

    下载镜像 docker pull neo4j:3.5.22-community 编写配置文件 参考文档 编写docker-compose.yml文件 一键启动 docker-compose up -d

    2024年02月03日
    浏览(50)
  • [云原生1. ] 使用Docker-compose一键部署Wordpress平台

    docker-compose 是实现在单机上对容器集群编排管理的工具。 docker-compose 是基于python开发的,能运行docker的平台,都能用docker-compose编排管理容器。 本质就是在 yaml格式 的 docker-compose配置模板文件 里定义多个容器的启动参数和依赖关系,并使用 docker-compose 根据这个模板文件的配

    2024年02月07日
    浏览(40)
  • 【云原生】Docker-compose部署flink

    Apache Flink的数据流编程模型在有限和无限数据集上提供单次事件(event-at-a-time)处理。在基础层面,Flink程序由流和转换组成。 Apache Flink的API:有界或无界数据流的数据流API、用于有界数据集的数据集API、表API。 [3] 数据流的运行流程 Flink程序在执行后被映射到流数据流,每

    2024年02月08日
    浏览(44)
  • 【Docker从入门到入土 5】 使用Docker-compose一键部署Wordpress平台

    YAML 是一种标记语言,它可以很直观的展示数据序列化格式,可读性高。 类似于 json 数据描述语言,语法比 json 简单的很多。 YAML 数据结构通过缩进来表示,连续的项目通过减号来表示,键值对用冒号分隔,数组用中括号 [] 括起来, hash 用花括号 {} 括起来。 语法特点 区分大

    2024年02月03日
    浏览(49)
  • docker-compose部署rabbitmq集群

    1、集群分类 RabbitMQ的是基于Erlang语言编写,而Erlang又是一个面向并发的语言,天然支持集群模式。 RabbitMQ的集群以下分类: 标准集群:是一种分布式集群,将队列分散到集群的各个节点,从而提高整个集群的并发能力。 镜像集群:是一种主从集群,标准集群的基础上,添加

    2024年02月16日
    浏览(43)
  • docker-compose部署minio集群

    提示:本文是在Dokcer Desktop环境下部署。 docker部署单机minio 之前有讲过,这里就不在重复 提示:quay.io/minio/minio是稳定版本 docker pull quay.io/minio/minio 分别创建 C:DockerDataminio-clusterminio1和C:DockerDataminio-clusterminio2文件夹 然后再minio1/minio2中分别创建config、data1和data2文件夹 提示

    2024年02月12日
    浏览(55)
  • docker-compose 一键启动 容器中的一组相关的应用

    docker-compose是docker官方的开源项目,负责实现对docker容器的快速编排。 docker-compose 使用一个docker-compose.yml模板文件,定义一个多容器的应用,然后使用一条命令安装所有的依赖,并完成构建。 docker-compose解决容器与容器之间如何管理编排的问题。 docker-compose 多服务部署工具

    2024年02月12日
    浏览(48)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包