当前位置: 代码网 > it编程>编程语言>Java > Flink 1.19.1 standalone 集群模式部署及配置

Flink 1.19.1 standalone 集群模式部署及配置

2024年08月04日 Java 我要评论
config.yaml: jobmanager address 统一使用 dev001,bind-port 统一改成 0.0.0.0,taskmanager address 分别更改为dev所在host。flink 1.19起 conf/flink-conf.yaml 更改为新的 conf/config.yaml。standalone集群: dev001、dev002、dev003。

flink 1.19起 conf/flink-conf.yaml 更改为新的 conf/config.yaml

7df23ada99d64064a148a28d1770c559.png

standalone集群: dev001、dev002、dev003

config.yaml: jobmanager address 统一使用 dev001,bind-port 统一改成 0.0.0.0,taskmanager address 分别更改为dev所在host

dev001 config.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.
################################################################################

# these parameters are required for java 17 support.
# they can be safely removed when using java 8/11.
env:
  java:
    opts:
      all: --add-exports=java.base/sun.net.util=all-unnamed --add-exports=java.rmi/sun.rmi.registry=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.api=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.file=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.parser=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.tree=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.util=all-unnamed --add-exports=java.security.jgss/sun.security.krb5=all-unnamed --add-opens=java.base/java.lang=all-unnamed --add-opens=java.base/java.net=all-unnamed --add-opens=java.base/java.io=all-unnamed --add-opens=java.base/java.nio=all-unnamed --add-opens=java.base/sun.nio.ch=all-unnamed --add-opens=java.base/java.lang.reflect=all-unnamed --add-opens=java.base/java.text=all-unnamed --add-opens=java.base/java.time=all-unnamed --add-opens=java.base/java.util=all-unnamed --add-opens=java.base/java.util.concurrent=all-unnamed --add-opens=java.base/java.util.concurrent.atomic=all-unnamed --add-opens=java.base/java.util.concurrent.locks=all-unnamed

#==============================================================================
# common
#==============================================================================

jobmanager:
  # the host interface the jobmanager will bind to. by 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.
  bind-host: 0.0.0.0
  rpc:
    # 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.
    address: dev001
    # the rpc port where the jobmanager is reachable.
    port: 6123
  memory:
    process:
      # 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.
      size: 1600m
  execution:
    # 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.
    failover-strategy: region

taskmanager:
  # the host interface the taskmanager will bind to. by default, this is localhost, and will prevent
  # the taskmanager 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.
  bind-host: 0.0.0.0
  # the address of the host on which the taskmanager runs and can be reached by the jobmanager and
  # other taskmanagers. if not specified, the taskmanager will try different strategies to identify
  # the address.
  #
  # note this address needs to be reachable by the jobmanager and forward traffic to one of
  # the interfaces the taskmanager is bound to (see 'taskmanager.bind-host').
  #
  # note also that unless all taskmanagers are running on the same machine, this address needs to be
  # configured separately for each taskmanager.
  host: dev001
  # the number of task slots that each taskmanager offers. each slot runs one parallel pipeline.
  numberoftaskslots: 2
  memory:
    process:
      # 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.
      # 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.
      size: 1728m

parallelism:
  # the parallelism used for programs that did not specify and other 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: hdfs://mynamenode:12345

#==============================================================================
# high availability
#==============================================================================

# high-availability:
#   # the high-availability mode. possible options are 'none' or 'zookeeper'.
#   type: 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, ...)
#   storagedir: hdfs:///flink/ha/
#   zookeeper:
#     # 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)
#     quorum: localhost:2181
#     client:
#       # 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
#       acl: open

#==============================================================================
# fault tolerance and checkpointing
#==============================================================================

# the backend that will be used to store operator state checkpoints if
# checkpointing is enabled. checkpointing is enabled when execution.checkpointing.interval > 0.

# # execution checkpointing related parameters. please refer to checkpointconfig and executioncheckpointingoptions for more details.
# execution:
#   checkpointing:
#     interval: 3min
#     externalized-checkpoint-retention: [delete_on_cancellation, retain_on_cancellation]
#     max-concurrent-checkpoints: 1
#     min-pause: 0
#     mode: [exactly_once, at_least_once]
#     timeout: 10min
#     tolerable-failed-checkpoints: 0
#     unaligned: false

# state:
#   backend:
#     # supported backends are 'hashmap', 'rocksdb', or the
#     # <class-name-of-factory>.
#     type: hashmap
#     # flag to enable/disable incremental checkpoints for backends that
#     # support incremental checkpoints (like the rocksdb state backend).
#     incremental: false
#   checkpoints:
#       # directory for checkpoints filesystem, when using any of the default bundled
#       # state backends.
#       dir: hdfs://namenode-host:port/flink-checkpoints
#   savepoints:
#       # default target directory for savepoints, optional.
#       dir: hdfs://namenode-host:port/flink-savepoints

#==============================================================================
# rest & web frontend
#==============================================================================

rest:
  # the address to which the rest client will connect to
  address: dev001
  # the address that the rest & web server binds to
  # by default, this is localhost, which prevents the rest & web server from
  # being able to communicate outside of the machine/container it is running on.
  #
  # to enable this, set the bind address to one that has access to outside-facing
  # network interface, such as 0.0.0.0.
  bind-address: 0.0.0.0
  # # 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.
  # port: 8081
  # # port range for the rest and web server to bind to.
  # bind-port: 8080-8090

# web:
#   submit:
#     # flag to specify whether job submission is enabled from the web-based
#     # runtime monitor. uncomment to disable.
#     enable: false
#   cancel:
#     # flag to specify whether job cancellation is enabled from the web-based
#     # runtime monitor. uncomment to disable.
#     enable: false

#==============================================================================
# advanced
#==============================================================================

# io:
#   tmp:
#     # 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, 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.
#     dirs: /tmp

# classloader:
#   resolve:
#     # 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.
#     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
#       min: 64mb
#       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
#       keytab: /path/to/kerberos/keytab
#       principal: flink-user
#       # the configuration below defines which jaas login contexts
#       contexts: client,kafkaclient

#==============================================================================
# zk security configuration
#==============================================================================

# zookeeper:
#   sasl:
#     # 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"
#     login-context-name: client

#==============================================================================
# historyserver
#==============================================================================

# the historyserver is started and stopped via bin/historyserver.sh (start|stop)
#
# jobmanager:
#   archive:
#     fs:
#       # directory to upload completed jobs to. add this directory to the list of
#       # monitored directories of the historyserver as well (see below).
#       dir: hdfs:///completed-jobs/

# historyserver:
#   web:
#     # the address under which the web-based historyserver listens.
#     address: 0.0.0.0
#     # the port under which the web-based historyserver listens.
#     port: 8082
#   archive:
#     fs:
#       # comma separated list of directories to monitor for completed jobs.
#       dir: hdfs:///completed-jobs/
#       # interval in milliseconds for refreshing the monitored directories.
#       fs.refresh-interval: 10000


dev002 config.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.
################################################################################

# these parameters are required for java 17 support.
# they can be safely removed when using java 8/11.
env:
  java:
    opts:
      all: --add-exports=java.base/sun.net.util=all-unnamed --add-exports=java.rmi/sun.rmi.registry=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.api=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.file=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.parser=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.tree=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.util=all-unnamed --add-exports=java.security.jgss/sun.security.krb5=all-unnamed --add-opens=java.base/java.lang=all-unnamed --add-opens=java.base/java.net=all-unnamed --add-opens=java.base/java.io=all-unnamed --add-opens=java.base/java.nio=all-unnamed --add-opens=java.base/sun.nio.ch=all-unnamed --add-opens=java.base/java.lang.reflect=all-unnamed --add-opens=java.base/java.text=all-unnamed --add-opens=java.base/java.time=all-unnamed --add-opens=java.base/java.util=all-unnamed --add-opens=java.base/java.util.concurrent=all-unnamed --add-opens=java.base/java.util.concurrent.atomic=all-unnamed --add-opens=java.base/java.util.concurrent.locks=all-unnamed

#==============================================================================
# common
#==============================================================================

jobmanager:
  # the host interface the jobmanager will bind to. by 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.
  bind-host: 0.0.0.0
  rpc:
    # 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.
    address: dev001
    # the rpc port where the jobmanager is reachable.
    port: 6123
  memory:
    process:
      # 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.
      size: 1600m
  execution:
    # 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.
    failover-strategy: region

taskmanager:
  # the host interface the taskmanager will bind to. by default, this is localhost, and will prevent
  # the taskmanager 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.
  bind-host: 0.0.0.0
  # the address of the host on which the taskmanager runs and can be reached by the jobmanager and
  # other taskmanagers. if not specified, the taskmanager will try different strategies to identify
  # the address.
  #
  # note this address needs to be reachable by the jobmanager and forward traffic to one of
  # the interfaces the taskmanager is bound to (see 'taskmanager.bind-host').
  #
  # note also that unless all taskmanagers are running on the same machine, this address needs to be
  # configured separately for each taskmanager.
  host: dev002
  # the number of task slots that each taskmanager offers. each slot runs one parallel pipeline.
  numberoftaskslots: 2
  memory:
    process:
      # 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.
      # 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.
      size: 1728m

parallelism:
  # the parallelism used for programs that did not specify and other 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: hdfs://mynamenode:12345

#==============================================================================
# high availability
#==============================================================================

# high-availability:
#   # the high-availability mode. possible options are 'none' or 'zookeeper'.
#   type: 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, ...)
#   storagedir: hdfs:///flink/ha/
#   zookeeper:
#     # 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)
#     quorum: localhost:2181
#     client:
#       # 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
#       acl: open

#==============================================================================
# fault tolerance and checkpointing
#==============================================================================

# the backend that will be used to store operator state checkpoints if
# checkpointing is enabled. checkpointing is enabled when execution.checkpointing.interval > 0.

# # execution checkpointing related parameters. please refer to checkpointconfig and executioncheckpointingoptions for more details.
# execution:
#   checkpointing:
#     interval: 3min
#     externalized-checkpoint-retention: [delete_on_cancellation, retain_on_cancellation]
#     max-concurrent-checkpoints: 1
#     min-pause: 0
#     mode: [exactly_once, at_least_once]
#     timeout: 10min
#     tolerable-failed-checkpoints: 0
#     unaligned: false

# state:
#   backend:
#     # supported backends are 'hashmap', 'rocksdb', or the
#     # <class-name-of-factory>.
#     type: hashmap
#     # flag to enable/disable incremental checkpoints for backends that
#     # support incremental checkpoints (like the rocksdb state backend).
#     incremental: false
#   checkpoints:
#       # directory for checkpoints filesystem, when using any of the default bundled
#       # state backends.
#       dir: hdfs://namenode-host:port/flink-checkpoints
#   savepoints:
#       # default target directory for savepoints, optional.
#       dir: hdfs://namenode-host:port/flink-savepoints

#==============================================================================
# rest & web frontend
#==============================================================================

rest:
  # the address to which the rest client will connect to
  address: dev002
  # the address that the rest & web server binds to
  # by default, this is localhost, which prevents the rest & web server from
  # being able to communicate outside of the machine/container it is running on.
  #
  # to enable this, set the bind address to one that has access to outside-facing
  # network interface, such as 0.0.0.0.
  bind-address: 0.0.0.0
  # # 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.
  # port: 8081
  # # port range for the rest and web server to bind to.
  # bind-port: 8080-8090

# web:
#   submit:
#     # flag to specify whether job submission is enabled from the web-based
#     # runtime monitor. uncomment to disable.
#     enable: false
#   cancel:
#     # flag to specify whether job cancellation is enabled from the web-based
#     # runtime monitor. uncomment to disable.
#     enable: false

#==============================================================================
# advanced
#==============================================================================

# io:
#   tmp:
#     # 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, 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.
#     dirs: /tmp

# classloader:
#   resolve:
#     # 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.
#     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
#       min: 64mb
#       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
#       keytab: /path/to/kerberos/keytab
#       principal: flink-user
#       # the configuration below defines which jaas login contexts
#       contexts: client,kafkaclient

#==============================================================================
# zk security configuration
#==============================================================================

# zookeeper:
#   sasl:
#     # 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"
#     login-context-name: client

#==============================================================================
# historyserver
#==============================================================================

# the historyserver is started and stopped via bin/historyserver.sh (start|stop)
#
# jobmanager:
#   archive:
#     fs:
#       # directory to upload completed jobs to. add this directory to the list of
#       # monitored directories of the historyserver as well (see below).
#       dir: hdfs:///completed-jobs/

# historyserver:
#   web:
#     # the address under which the web-based historyserver listens.
#     address: 0.0.0.0
#     # the port under which the web-based historyserver listens.
#     port: 8082
#   archive:
#     fs:
#       # comma separated list of directories to monitor for completed jobs.
#       dir: hdfs:///completed-jobs/
#       # interval in milliseconds for refreshing the monitored directories.
#       fs.refresh-interval: 10000


dev003 config.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.
################################################################################

# these parameters are required for java 17 support.
# they can be safely removed when using java 8/11.
env:
  java:
    opts:
      all: --add-exports=java.base/sun.net.util=all-unnamed --add-exports=java.rmi/sun.rmi.registry=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.api=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.file=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.parser=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.tree=all-unnamed --add-exports=jdk.compiler/com.sun.tools.javac.util=all-unnamed --add-exports=java.security.jgss/sun.security.krb5=all-unnamed --add-opens=java.base/java.lang=all-unnamed --add-opens=java.base/java.net=all-unnamed --add-opens=java.base/java.io=all-unnamed --add-opens=java.base/java.nio=all-unnamed --add-opens=java.base/sun.nio.ch=all-unnamed --add-opens=java.base/java.lang.reflect=all-unnamed --add-opens=java.base/java.text=all-unnamed --add-opens=java.base/java.time=all-unnamed --add-opens=java.base/java.util=all-unnamed --add-opens=java.base/java.util.concurrent=all-unnamed --add-opens=java.base/java.util.concurrent.atomic=all-unnamed --add-opens=java.base/java.util.concurrent.locks=all-unnamed

#==============================================================================
# common
#==============================================================================

jobmanager:
  # the host interface the jobmanager will bind to. by 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.
  bind-host: 0.0.0.0
  rpc:
    # 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.
    address: dev001
    # the rpc port where the jobmanager is reachable.
    port: 6123
  memory:
    process:
      # 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.
      size: 1600m
  execution:
    # 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.
    failover-strategy: region

taskmanager:
  # the host interface the taskmanager will bind to. by default, this is localhost, and will prevent
  # the taskmanager 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.
  bind-host: 0.0.0.0
  # the address of the host on which the taskmanager runs and can be reached by the jobmanager and
  # other taskmanagers. if not specified, the taskmanager will try different strategies to identify
  # the address.
  #
  # note this address needs to be reachable by the jobmanager and forward traffic to one of
  # the interfaces the taskmanager is bound to (see 'taskmanager.bind-host').
  #
  # note also that unless all taskmanagers are running on the same machine, this address needs to be
  # configured separately for each taskmanager.
  host: dev003
  # the number of task slots that each taskmanager offers. each slot runs one parallel pipeline.
  numberoftaskslots: 2
  memory:
    process:
      # 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.
      # 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.
      size: 1728m

parallelism:
  # the parallelism used for programs that did not specify and other 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: hdfs://mynamenode:12345

#==============================================================================
# high availability
#==============================================================================

# high-availability:
#   # the high-availability mode. possible options are 'none' or 'zookeeper'.
#   type: 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, ...)
#   storagedir: hdfs:///flink/ha/
#   zookeeper:
#     # 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)
#     quorum: localhost:2181
#     client:
#       # 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
#       acl: open

#==============================================================================
# fault tolerance and checkpointing
#==============================================================================

# the backend that will be used to store operator state checkpoints if
# checkpointing is enabled. checkpointing is enabled when execution.checkpointing.interval > 0.

# # execution checkpointing related parameters. please refer to checkpointconfig and executioncheckpointingoptions for more details.
# execution:
#   checkpointing:
#     interval: 3min
#     externalized-checkpoint-retention: [delete_on_cancellation, retain_on_cancellation]
#     max-concurrent-checkpoints: 1
#     min-pause: 0
#     mode: [exactly_once, at_least_once]
#     timeout: 10min
#     tolerable-failed-checkpoints: 0
#     unaligned: false

# state:
#   backend:
#     # supported backends are 'hashmap', 'rocksdb', or the
#     # <class-name-of-factory>.
#     type: hashmap
#     # flag to enable/disable incremental checkpoints for backends that
#     # support incremental checkpoints (like the rocksdb state backend).
#     incremental: false
#   checkpoints:
#       # directory for checkpoints filesystem, when using any of the default bundled
#       # state backends.
#       dir: hdfs://namenode-host:port/flink-checkpoints
#   savepoints:
#       # default target directory for savepoints, optional.
#       dir: hdfs://namenode-host:port/flink-savepoints

#==============================================================================
# rest & web frontend
#==============================================================================

rest:
  # the address to which the rest client will connect to
  address: dev003
  # the address that the rest & web server binds to
  # by default, this is localhost, which prevents the rest & web server from
  # being able to communicate outside of the machine/container it is running on.
  #
  # to enable this, set the bind address to one that has access to outside-facing
  # network interface, such as 0.0.0.0.
  bind-address: 0.0.0.0
  # # 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.
  # port: 8081
  # # port range for the rest and web server to bind to.
  # bind-port: 8080-8090

# web:
#   submit:
#     # flag to specify whether job submission is enabled from the web-based
#     # runtime monitor. uncomment to disable.
#     enable: false
#   cancel:
#     # flag to specify whether job cancellation is enabled from the web-based
#     # runtime monitor. uncomment to disable.
#     enable: false

#==============================================================================
# advanced
#==============================================================================

# io:
#   tmp:
#     # 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, 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.
#     dirs: /tmp

# classloader:
#   resolve:
#     # 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.
#     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
#       min: 64mb
#       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
#       keytab: /path/to/kerberos/keytab
#       principal: flink-user
#       # the configuration below defines which jaas login contexts
#       contexts: client,kafkaclient

#==============================================================================
# zk security configuration
#==============================================================================

# zookeeper:
#   sasl:
#     # 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"
#     login-context-name: client

#==============================================================================
# historyserver
#==============================================================================

# the historyserver is started and stopped via bin/historyserver.sh (start|stop)
#
# jobmanager:
#   archive:
#     fs:
#       # directory to upload completed jobs to. add this directory to the list of
#       # monitored directories of the historyserver as well (see below).
#       dir: hdfs:///completed-jobs/

# historyserver:
#   web:
#     # the address under which the web-based historyserver listens.
#     address: 0.0.0.0
#     # the port under which the web-based historyserver listens.
#     port: 8082
#   archive:
#     fs:
#       # comma separated list of directories to monitor for completed jobs.
#       dir: hdfs:///completed-jobs/
#       # interval in milliseconds for refreshing the monitored directories.
#       fs.refresh-interval: 10000

conf/masters 及 conf/works 使用 xsync 同步分发命令 分发到各机器节点即可:

5c4cf13312fd443a81162dbbec3460c8.png

-- masters
dev001:8081

-- workers
dev001
dev002
dev003

补充:

linux 查看port是否被占用:nestat -apn|grep 8081

linux 查看各节点flink任务:jps

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com