Flink集群搭建

docker版

https://hub.docker.com/_/flink

正常版

免密登录

虽然网上没说,但是看后面集群启动时的操作来看是做了免密登录的。

安装及配置

下载并配置集群

wget http://mirrors.tuna.tsinghua.edu.cn/apache/flink/flink-1.8.1/flink-1.8.1-bin-scala_2.12.tgz && tar -zxvf flink-1.8.1-bin-scala_2.12.tgz && cd flink-1.8.1 && vi conf/masters

配置JobManager节点

192.168.1.146:8081
192.168.1.144:8081
192.168.1.141:8081

通过conf/masters配置HA(基于zookeeper)

#==============================================================================
# High Availability
#==============================================================================
# add by Qbit according to https://ci.apache.org/projects/flink/flink-docs-release-1.8/ops/jobmanager_high_availability.html
high-availability.cluster-id: /qbit
high-availability.zookeeper.path.root: /flink
# 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: 192.168.1.146:2181,192.168.1.144:2181,192.168.1.141:2181

启动

bin/start-cluster.sh

启动后8081端口可访问说明启动成功

你可能感兴趣的:(中间件)