一、下载与解压
下载地址:Apache Flink: 下载
注意:下载的版本要与自己的scala版本一致,下最新的1.15版本,安装的scala版本为2.12.2,所以要下载1.15版本对应scala2.12.2版本的flink
将安装包上传到,master,slave1,slave2节点。
tar -zxvf flink-1.15.0-bin-scala_2.12.tgz
二.配置Flink
1.设置环境变量
vi /etc/profile
export FLINK_HOME=/opt/module/flink-1.15.0
export PATH=$FLINK_HOME/bin:$PATH
使环境变量生效
source /etc/profile
2.配置flink-conf.yaml
cd /opt/module/flink-1.15.0/conf
vi flink-conf.yaml
下面配置的是standlone模式
这里jobmanager.rpc.address设置为主节点的IP或者主机名,端口默认为6123,如果冲突可以自己调整
################################################################################
# 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
# automatically configure the host name based on the hostname of the node where the
# JobManager runs.
jobmanager.rpc.address: master
# The RPC port where the JobManager is reachable.
jobmanager.rpc.port: 6123
# The host interface the JobManager will bind to. My default, this is localhost, and will prevent
# the JobManager from communicating outside the machine/container it is running on.
# On YARN this setting will be ignored if it is set to 'localhost', defaulting to 0.0.0.0.
# On Kubernetes this setting will be ignored, defaulting to 0.0.0.0.
#
# To enable this, set the bind-host address to one that has access to an outside facing network
# interface, such as 0.0.0.0.
#jobmanager.bind-host: localhost
# The total process memory size for the JobManager.
#
# Note this