当前位置:   article > 正文

linux下安装flink 1.18_flink下载 linux

flink下载 linux

一、flink介绍

Flink是为分布式、高性能、随时可用以及准确的流处理应用程序打造的开源流处理框架

二、flink下载

flink下载

三、flink配置

3.1、配置环境变量

  1. export JAVA_HOME=/usr/local/jdk1.8.0_391
  2. export JRE_HOME=/usr/local/jdk1.8.0_391/jre
  3. export HBASE_HOME=/usr/local/bigdata/hbase-2.5.6-hadoop3
  4. export HADOOP_HOME=/usr/local/bigdata/hadoop-3.3.6
  5. export FLINK_HOME=/usr/local/bigdata/flink-1.18.0
  6. export HIVE_HOME=/usr/local/bigdata/apache-hive-3.1.3-bin
  7. export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JAR_HOME/lib
  8. export PATH=.:$JAVA_HOME/bin:$JRE_HOME/bin:$HADOOP_HOME/bin:$FLINK_HOME/bin:$HIVE_HOME/bin:$HBASE_HOME/bin:$PYTHON_HOME/bin:$PATH

3.2、创建目录

在flink下面创建data,在data下面创建zk和tmp

3.3、配置flink-conf.yaml

  1. [root@node1 conf]# cat flink-conf.yaml
  2. ################################################################################
  3. # Licensed to the Apache Software Foundation (ASF) under one
  4. # or more contributor license agreements. See the NOTICE file
  5. # distributed with this work for additional information
  6. # regarding copyright ownership. The ASF licenses this file
  7. # to you under the Apache License, Version 2.0 (the
  8. # "License"); you may not use this file except in compliance
  9. # with the License. You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. ################################################################################
  19. # These parameters are required for Java 17 support.
  20. # They can be safely removed when using Java 8/11.
  21. 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
  22. #==============================================================================
  23. # Common
  24. #==============================================================================
  25. # The external address of the host on which the JobManager runs and can be
  26. # reached by the TaskManagers and any clients which want to connect. This setting
  27. # is only used in Standalone mode and may be overwritten on the JobManager side
  28. # by specifying the --host <hostname> parameter of the bin/jobmanager.sh executable.
  29. # In high availability mode, if you use the bin/start-cluster.sh script and setup
  30. # the conf/masters file, this will be taken care of automatically. Yarn
  31. # automatically configure the host name based on the hostname of the node where the
  32. # JobManager runs.
  33. jobmanager.rpc.address: node1
  34. # The RPC port where the JobManager is reachable.
  35. jobmanager.rpc.port: 6123
  36. # The host interface the JobManager will bind to. By default, this is localhost, and will prevent
  37. # the JobManager from communicating outside the machine/container it is running on.
  38. # On YARN this setting will be ignored if it is set to 'localhost', defaulting to 0.0.0.0.
  39. # On Kubernetes this setting will be ignored, defaulting to 0.0.0.0.
  40. #
  41. # To enable this, set the bind-host address to one that has access to an outside facing network
  42. # interface, such as 0.0.0.0.
  43. jobmanager.bind-host: 0.0.0.0
  44. # The total process memory size for the JobManager.
  45. #
  46. # Note this accounts for all memory usage within the JobManager process, including JVM metaspace and other overhead.
  47. jobmanager.memory.process.size: 1600m
  48. # The host interface the TaskManager will bind to. By default, this is localhost, and will prevent
  49. # the TaskManager from communicating outside the machine/container it is running on.
  50. # On YARN this setting will be ignored if it is set to 'localhost', defaulting to 0.0.0.0.
  51. # On Kubernetes this setting will be ignored, defaulting to 0.0.0.0.
  52. #
  53. # To enable this, set the bind-host address to one that has access to an outside facing network
  54. # interface, such as 0.0.0.0.
  55. taskmanager.bind-host: 0.0.0.0
  56. # The address of the host on which the TaskManager runs and can be reached by the JobManager and
  57. # other TaskManagers. If not specified, the TaskManager will try different strategies to identify
  58. # the address.
  59. #
  60. # Note this address needs to be reachable by the JobManager and forward traffic to one of
  61. # the interfaces the TaskManager is bound to (see 'taskmanager.bind-host').
  62. #
  63. # Note also that unless all TaskManagers are running on the same machine, this address needs to be
  64. # configured separately for each TaskManager.
  65. taskmanager.host: node1
  66. # The total process memory size for the TaskManager.
  67. #
  68. # Note this accounts for all memory usage within the TaskManager process, including JVM metaspace and other overhead.
  69. taskmanager.memory.process.size: 1728m
  70. # To exclude JVM metaspace and overhead, please, use total Flink memory size instead of 'taskmanager.memory.process.size'.
  71. # It is not recommended to set both 'taskmanager.memory.process.size' and Flink memory.
  72. #
  73. # taskmanager.memory.flink.size: 1280m
  74. # The number of task slots that each TaskManager offers. Each slot runs one parallel pipeline.
  75. taskmanager.numberOfTaskSlots: 1
  76. # The parallelism used for programs that did not specify and other parallelism.
  77. parallelism.default: 1
  78. # The default file system scheme and authority.
  79. #
  80. # By default file paths without scheme are interpreted relative to the local
  81. # root file system 'file:///'. Use this to override the default and interpret
  82. # relative paths relative to a different file system,
  83. # for example 'hdfs://mynamenode:12345'
  84. #
  85. # fs.default-scheme
  86. #==============================================================================
  87. # High Availability
  88. #==============================================================================
  89. # The high-availability mode. Possible options are 'NONE' or 'zookeeper'.
  90. #
  91. # high-availability.type: zookeeper
  92. # The path where metadata for master recovery is persisted. While ZooKeeper stores
  93. # the small ground truth for checkpoint and leader election, this location stores
  94. # the larger objects, like persisted dataflow graphs.
  95. #
  96. # Must be a durable file system that is accessible from all nodes
  97. # (like HDFS, S3, Ceph, nfs, ...)
  98. #
  99. # high-availability.storageDir: hdfs:///flink/ha/
  100. # The list of ZooKeeper quorum peers that coordinate the high-availability
  101. # setup. This must be a list of the form:
  102. # "host1:clientPort,host2:clientPort,..." (default clientPort: 2181)
  103. #
  104. # high-availability.zookeeper.quorum: node1:2181,node2:2181,node3:2181
  105. # ACL options are based on https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html#sc_BuiltinACLSchemes
  106. # It can be either "creator" (ZOO_CREATE_ALL_ACL) or "open" (ZOO_OPEN_ACL_UNSAFE)
  107. # The default value is "open" and it can be changed to "creator" if ZK security is enabled
  108. #
  109. # high-availability.zookeeper.client.acl: open
  110. #==============================================================================
  111. # Fault tolerance and checkpointing
  112. #==============================================================================
  113. # The backend that will be used to store operator state checkpoints if
  114. # checkpointing is enabled. Checkpointing is enabled when execution.checkpointing.interval > 0.
  115. #
  116. # Execution checkpointing related parameters. Please refer to CheckpointConfig and ExecutionCheckpointingOptions for more details.
  117. #
  118. # execution.checkpointing.interval: 3min
  119. # execution.checkpointing.externalized-checkpoint-retention: [DELETE_ON_CANCELLATION, RETAIN_ON_CANCELLATION]
  120. # execution.checkpointing.max-concurrent-checkpoints: 1
  121. # execution.checkpointing.min-pause: 0
  122. # execution.checkpointing.mode: [EXACTLY_ONCE, AT_LEAST_ONCE]
  123. # execution.checkpointing.timeout: 10min
  124. # execution.checkpointing.tolerable-failed-checkpoints: 0
  125. # execution.checkpointing.unaligned: false
  126. #
  127. # Supported backends are 'hashmap', 'rocksdb', or the
  128. # <class-name-of-factory>.
  129. #
  130. # state.backend.type: hashmap
  131. # Directory for checkpoints filesystem, when using any of the default bundled
  132. # state backends.
  133. #
  134. # state.checkpoints.dir: hdfs://namenode-host:port/flink-checkpoints
  135. # Default target directory for savepoints, optional.
  136. #
  137. # state.savepoints.dir: hdfs://namenode-host:port/flink-savepoints
  138. # Flag to enable/disable incremental checkpoints for backends that
  139. # support incremental checkpoints (like the RocksDB state backend).
  140. #
  141. # state.backend.incremental: false
  142. # The failover strategy, i.e., how the job computation recovers from task failures.
  143. # Only restart tasks that may have been affected by the task failure, which typically includes
  144. # downstream tasks and potentially upstream tasks if their produced data is no longer available for consumption.
  145. jobmanager.execution.failover-strategy: region
  146. #==============================================================================
  147. # Rest & web frontend
  148. #==============================================================================
  149. # The port to which the REST client connects to. If rest.bind-port has
  150. # not been specified, then the server will bind to this port as well.
  151. #
  152. #rest.port: 8081
  153. # The address to which the REST client will connect to
  154. #
  155. rest.address: node1
  156. # Port range for the REST and web server to bind to.
  157. #
  158. #rest.bind-port: 8080-8090
  159. # The address that the REST & web server binds to
  160. # By default, this is localhost, which prevents the REST & web server from
  161. # being able to communicate outside of the machine/container it is running on.
  162. #
  163. # To enable this, set the bind address to one that has access to outside-facing
  164. # network interface, such as 0.0.0.0.
  165. #
  166. rest.bind-address: 0.0.0.0
  167. # Flag to specify whether job submission is enabled from the web-based
  168. # runtime monitor. Uncomment to disable.
  169. #web.submit.enable: false
  170. # Flag to specify whether job cancellation is enabled from the web-based
  171. # runtime monitor. Uncomment to disable.
  172. #web.cancel.enable: false
  173. #==============================================================================
  174. # Advanced
  175. #==============================================================================
  176. # Override the directories for temporary files. If not specified, the
  177. # system-specific Java temporary directory (java.io.tmpdir property) is taken.
  178. #
  179. # For framework setups on Yarn, Flink will automatically pick up the
  180. # containers' temp directories without any need for configuration.
  181. #
  182. # Add a delimited list for multiple directories, using the system directory
  183. # delimiter (colon ':' on unix) or a comma, e.g.:
  184. # /data1/tmp:/data2/tmp:/data3/tmp
  185. #
  186. # Note: Each directory entry is read from and written to by a different I/O
  187. # thread. You can include the same directory multiple times in order to create
  188. # multiple I/O threads against that directory. This is for example relevant for
  189. # high-throughput RAIDs.
  190. #
  191. io.tmp.dirs: /usr/local/bigdata/flink-1.18.0/data/tmp
  192. # The classloading resolve order. Possible values are 'child-first' (Flink's default)
  193. # and 'parent-first' (Java's default).
  194. #
  195. # Child first classloading allows users to use different dependency/library
  196. # versions in their application than those in the classpath. Switching back
  197. # to 'parent-first' may help with debugging dependency issues.
  198. #
  199. # classloader.resolve-order: child-first
  200. # The amount of memory going to the network stack. These numbers usually need
  201. # no tuning. Adjusting them may be necessary in case of an "Insufficient number
  202. # of network buffers" error. The default min is 64MB, the default max is 1GB.
  203. #
  204. # taskmanager.memory.network.fraction: 0.1
  205. # taskmanager.memory.network.min: 64mb
  206. # taskmanager.memory.network.max: 1gb
  207. #==============================================================================
  208. # Flink Cluster Security Configuration
  209. #==============================================================================
  210. # Kerberos authentication for various components - Hadoop, ZooKeeper, and connectors -
  211. # may be enabled in four steps:
  212. # 1. configure the local krb5.conf file
  213. # 2. provide Kerberos credentials (either a keytab or a ticket cache w/ kinit)
  214. # 3. make the credentials available to various JAAS login contexts
  215. # 4. configure the connector to use JAAS/SASL
  216. # The below configure how Kerberos credentials are provided. A keytab will be used instead of
  217. # a ticket cache if the keytab path and principal are set.
  218. # security.kerberos.login.use-ticket-cache: true
  219. # security.kerberos.login.keytab: /path/to/kerberos/keytab
  220. # security.kerberos.login.principal: flink-user
  221. # The configuration below defines which JAAS login contexts
  222. # security.kerberos.login.contexts: Client,KafkaClient
  223. #==============================================================================
  224. # ZK Security Configuration
  225. #==============================================================================
  226. # Below configurations are applicable if ZK ensemble is configured for security
  227. # Override below configuration to provide custom ZK service name if configured
  228. # zookeeper.sasl.service-name: zookeeper
  229. # The configuration below must match one of the values set in "security.kerberos.login.contexts"
  230. # zookeeper.sasl.login-context-name: Client
  231. #==============================================================================
  232. # HistoryServer
  233. #==============================================================================
  234. # The HistoryServer is started and stopped via bin/historyserver.sh (start|stop)
  235. # Directory to upload completed jobs to. Add this directory to the list of
  236. # monitored directories of the HistoryServer as well (see below).
  237. #jobmanager.archive.fs.dir: hdfs:///completed-jobs/
  238. # The address under which the web-based HistoryServer listens.
  239. #historyserver.web.address: 0.0.0.0
  240. # The port under which the web-based HistoryServer listens.
  241. #historyserver.web.port: 8082
  242. # Comma separated list of directories to monitor for completed jobs.
  243. #historyserver.archive.fs.dir: hdfs:///completed-jobs/
  244. # Interval in milliseconds for refreshing the monitored directories.
  245. #historyserver.archive.fs.refresh-interval: 10000

3.4、配置flink-conf.yaml,结合hdfs的配置

  1. [root@node4 conf]# cat flink-conf.yaml
  2. ################################################################################
  3. # Licensed to the Apache Software Foundation (ASF) under one
  4. # or more contributor license agreements. See the NOTICE file
  5. # distributed with this work for additional information
  6. # regarding copyright ownership. The ASF licenses this file
  7. # to you under the Apache License, Version 2.0 (the
  8. # "License"); you may not use this file except in compliance
  9. # with the License. You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. ################################################################################
  19. # These parameters are required for Java 17 support.
  20. # They can be safely removed when using Java 8/11.
  21. 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
  22. #==============================================================================
  23. # Common
  24. #==============================================================================
  25. # The external address of the host on which the JobManager runs and can be
  26. # reached by the TaskManagers and any clients which want to connect. This setting
  27. # is only used in Standalone mode and may be overwritten on the JobManager side
  28. # by specifying the --host <hostname> parameter of the bin/jobmanager.sh executable.
  29. # In high availability mode, if you use the bin/start-cluster.sh script and setup
  30. # the conf/masters file, this will be taken care of automatically. Yarn
  31. # automatically configure the host name based on the hostname of the node where the
  32. # JobManager runs.
  33. jobmanager.rpc.address: node4
  34. # The RPC port where the JobManager is reachable.
  35. jobmanager.rpc.port: 6123
  36. # The host interface the JobManager will bind to. By default, this is localhost, and will prevent
  37. # the JobManager from communicating outside the machine/container it is running on.
  38. # On YARN this setting will be ignored if it is set to 'localhost', defaulting to 0.0.0.0.
  39. # On Kubernetes this setting will be ignored, defaulting to 0.0.0.0.
  40. #
  41. # To enable this, set the bind-host address to one that has access to an outside facing network
  42. # interface, such as 0.0.0.0.
  43. jobmanager.bind-host: 0.0.0.0
  44. # The total process memory size for the JobManager.
  45. #
  46. # Note this accounts for all memory usage within the JobManager process, including JVM metaspace and other overhead.
  47. jobmanager.memory.process.size: 1600m
  48. # The host interface the TaskManager will bind to. By default, this is localhost, and will prevent
  49. # the TaskManager from communicating outside the machine/container it is running on.
  50. # On YARN this setting will be ignored if it is set to 'localhost', defaulting to 0.0.0.0.
  51. # On Kubernetes this setting will be ignored, defaulting to 0.0.0.0.
  52. #
  53. # To enable this, set the bind-host address to one that has access to an outside facing network
  54. # interface, such as 0.0.0.0.
  55. taskmanager.bind-host: 0.0.0.0
  56. # The address of the host on which the TaskManager runs and can be reached by the JobManager and
  57. # other TaskManagers. If not specified, the TaskManager will try different strategies to identify
  58. # the address.
  59. #
  60. # Note this address needs to be reachable by the JobManager and forward traffic to one of
  61. # the interfaces the TaskManager is bound to (see 'taskmanager.bind-host').
  62. #
  63. # Note also that unless all TaskManagers are running on the same machine, this address needs to be
  64. # configured separately for each TaskManager.
  65. taskmanager.host: node4
  66. # The total process memory size for the TaskManager.
  67. #
  68. # Note this accounts for all memory usage within the TaskManager process, including JVM metaspace and other overhead.
  69. taskmanager.memory.process.size: 1728m
  70. # To exclude JVM metaspace and overhead, please, use total Flink memory size instead of 'taskmanager.memory.process.size'.
  71. # It is not recommended to set both 'taskmanager.memory.process.size' and Flink memory.
  72. #
  73. # taskmanager.memory.flink.size: 1280m
  74. # The number of task slots that each TaskManager offers. Each slot runs one parallel pipeline.
  75. taskmanager.numberOfTaskSlots: 1
  76. # The parallelism used for programs that did not specify and other parallelism.
  77. parallelism.default: 1
  78. # The default file system scheme and authority.
  79. #
  80. # By default file paths without scheme are interpreted relative to the local
  81. # root file system 'file:///'. Use this to override the default and interpret
  82. # relative paths relative to a different file system,
  83. # for example 'hdfs://mynamenode:12345'
  84. #
  85. # fs.default-scheme
  86. #==============================================================================
  87. # High Availability
  88. #==============================================================================
  89. # The high-availability mode. Possible options are 'NONE' or 'zookeeper'.
  90. #
  91. # high-availability.type: zookeeper
  92. # The path where metadata for master recovery is persisted. While ZooKeeper stores
  93. # the small ground truth for checkpoint and leader election, this location stores
  94. # the larger objects, like persisted dataflow graphs.
  95. #
  96. # Must be a durable file system that is accessible from all nodes
  97. # (like HDFS, S3, Ceph, nfs, ...)
  98. #
  99. # high-availability.storageDir: hdfs:///flink/ha/
  100. # The list of ZooKeeper quorum peers that coordinate the high-availability
  101. # setup. This must be a list of the form:
  102. # "host1:clientPort,host2:clientPort,..." (default clientPort: 2181)
  103. #
  104. # high-availability.zookeeper.quorum: localhost:2181
  105. # ACL options are based on https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgrammers.html#sc_BuiltinACLSchemes
  106. # It can be either "creator" (ZOO_CREATE_ALL_ACL) or "open" (ZOO_OPEN_ACL_UNSAFE)
  107. # The default value is "open" and it can be changed to "creator" if ZK security is enabled
  108. #
  109. # high-availability.zookeeper.client.acl: open
  110. #==============================================================================
  111. # Fault tolerance and checkpointing
  112. #==============================================================================
  113. # The backend that will be used to store operator state checkpoints if
  114. # checkpointing is enabled. Checkpointing is enabled when execution.checkpointing.interval > 0.
  115. #
  116. # Execution checkpointing related parameters. Please refer to CheckpointConfig and ExecutionCheckpointingOptions for more details.
  117. #
  118. # execution.checkpointing.interval: 3min
  119. # execution.checkpointing.externalized-checkpoint-retention: [DELETE_ON_CANCELLATION, RETAIN_ON_CANCELLATION]
  120. # execution.checkpointing.max-concurrent-checkpoints: 1
  121. # execution.checkpointing.min-pause: 0
  122. # execution.checkpointing.mode: [EXACTLY_ONCE, AT_LEAST_ONCE]
  123. # execution.checkpointing.timeout: 10min
  124. # execution.checkpointing.tolerable-failed-checkpoints: 0
  125. # execution.checkpointing.unaligned: false
  126. #
  127. # Supported backends are 'hashmap', 'rocksdb', or the
  128. # <class-name-of-factory>.
  129. #
  130. # state.backend.type: hashmap
  131. # Directory for checkpoints filesystem, when using any of the default bundled
  132. state backends: filesystem
  133. #
  134. state.checkpoints.dir: hdfs://node4:9001/flink-checkpoints
  135. # Default target directory for savepoints, optional.
  136. #
  137. state.savepoints.dir: hdfs://node4:9001/flink-savepoints
  138. # Flag to enable/disable incremental checkpoints for backends that
  139. # support incremental checkpoints (like the RocksDB state backend).
  140. #
  141. # state.backend.incremental: false
  142. # The failover strategy, i.e., how the job computation recovers from task failures.
  143. # Only restart tasks that may have been affected by the task failure, which typically includes
  144. # downstream tasks and potentially upstream tasks if their produced data is no longer available for consumption.
  145. jobmanager.execution.failover-strategy: region
  146. #==============================================================================
  147. # Rest & web frontend
  148. #==============================================================================
  149. # The port to which the REST client connects to. If rest.bind-port has
  150. # not been specified, then the server will bind to this port as well.
  151. #
  152. #rest.port: 8081
  153. # The address to which the REST client will connect to
  154. #
  155. rest.address: node4
  156. # Port range for the REST and web server to bind to.
  157. #
  158. #rest.bind-port: 8080-8090
  159. # The address that the REST & web server binds to
  160. # By default, this is localhost, which prevents the REST & web server from
  161. # being able to communicate outside of the machine/container it is running on.
  162. #
  163. # To enable this, set the bind address to one that has access to outside-facing
  164. # network interface, such as 0.0.0.0.
  165. #
  166. rest.bind-address: 0.0.0.0
  167. # Flag to specify whether job submission is enabled from the web-based
  168. # runtime monitor. Uncomment to disable.
  169. #web.submit.enable: false
  170. # Flag to specify whether job cancellation is enabled from the web-based
  171. # runtime monitor. Uncomment to disable.
  172. #web.cancel.enable: false
  173. #==============================================================================
  174. # Advanced
  175. #==============================================================================
  176. # Override the directories for temporary files. If not specified, the
  177. # system-specific Java temporary directory (java.io.tmpdir property) is taken.
  178. #
  179. # For framework setups on Yarn, Flink will automatically pick up the
  180. # containers' temp directories without any need for configuration.
  181. #
  182. # Add a delimited list for multiple directories, using the system directory
  183. # delimiter (colon ':' on unix) or a comma, e.g.:
  184. # /data1/tmp:/data2/tmp:/data3/tmp
  185. #
  186. # Note: Each directory entry is read from and written to by a different I/O
  187. # thread. You can include the same directory multiple times in order to create
  188. # multiple I/O threads against that directory. This is for example relevant for
  189. # high-throughput RAIDs.
  190. #
  191. io.tmp.dirs: /usr/local/bigdata/flink-1.18.0/data/tmp
  192. # The classloading resolve order. Possible values are 'child-first' (Flink's default)
  193. # and 'parent-first' (Java's default).
  194. #
  195. # Child first classloading allows users to use different dependency/library
  196. # versions in their application than those in the classpath. Switching back
  197. # to 'parent-first' may help with debugging dependency issues.
  198. #
  199. # classloader.resolve-order: child-first
  200. # The amount of memory going to the network stack. These numbers usually need
  201. # no tuning. Adjusting them may be necessary in case of an "Insufficient number
  202. # of network buffers" error. The default min is 64MB, the default max is 1GB.
  203. #
  204. # taskmanager.memory.network.fraction: 0.1
  205. # taskmanager.memory.network.min: 64mb
  206. # taskmanager.memory.network.max: 1gb
  207. #==============================================================================
  208. # Flink Cluster Security Configuration
  209. #==============================================================================
  210. # Kerberos authentication for various components - Hadoop, ZooKeeper, and connectors -
  211. # may be enabled in four steps:
  212. # 1. configure the local krb5.conf file
  213. # 2. provide Kerberos credentials (either a keytab or a ticket cache w/ kinit)
  214. # 3. make the credentials available to various JAAS login contexts
  215. # 4. configure the connector to use JAAS/SASL
  216. # The below configure how Kerberos credentials are provided. A keytab will be used instead of
  217. # a ticket cache if the keytab path and principal are set.
  218. # security.kerberos.login.use-ticket-cache: true
  219. # security.kerberos.login.keytab: /path/to/kerberos/keytab
  220. # security.kerberos.login.principal: flink-user
  221. # The configuration below defines which JAAS login contexts
  222. # security.kerberos.login.contexts: Client,KafkaClient
  223. #==============================================================================
  224. # ZK Security Configuration
  225. #==============================================================================
  226. # Below configurations are applicable if ZK ensemble is configured for security
  227. # Override below configuration to provide custom ZK service name if configured
  228. # zookeeper.sasl.service-name: zookeeper
  229. # The configuration below must match one of the values set in "security.kerberos.login.contexts"
  230. # zookeeper.sasl.login-context-name: Client
  231. #==============================================================================
  232. # HistoryServer
  233. #==============================================================================
  234. # The HistoryServer is started and stopped via bin/historyserver.sh (start|stop)
  235. # Directory to upload completed jobs to. Add this directory to the list of
  236. # monitored directories of the HistoryServer as well (see below).
  237. jobmanager.archive.fs.dir: hdfs://node4:9001/completed-jobs/
  238. # The address under which the web-based HistoryServer listens.
  239. historyserver.web.address: 0.0.0.0
  240. # The port under which the web-based HistoryServer listens.
  241. historyserver.web.port: 8082
  242. # Comma separated list of directories to monitor for completed jobs.
  243. historyserver.archive.fs.dir: hdfs://node4:9001/completed-jobs/
  244. # Interval in milliseconds for refreshing the monitored directories.
  245. historyserver.archive.fs.refresh-interval: 10000

四、启动flink

进入flink的bin下面,输入./start-cluster.sh 就启动了

远程就可以访问了,访问地址是http://ip:8081

 在flink里面执行任务

flink run /usr/local/bigdata/flink-1.18.0/examples/batch/WordCount.jar  --input /usr/local/bigdata/words.txt
  1. [root@node1 bigdata]# flink run /usr/local/bigdata/flink-1.18.0/examples/batch/WordCount.jar --input /usr/local/bigdata/words.txt
  2. Printing result to stdout. Use --output to specify output path.
  3. Job has been submitted with JobID 1c34e43b5dbdddc9023b4779e8d04bd3
  4. Program execution finished
  5. Job with JobID 1c34e43b5dbdddc9023b4779e8d04bd3 has finished.
  6. Job Runtime: 318 ms
  7. Accumulator Results:
  8. - 5457c3b30d7f7aa4a5778adeb8240a86 (java.util.ArrayList) [5 elements]
  9. (aaaaa,1)
  10. (flink,157)
  11. (hadoop,44)
  12. (link,19)
  13. (spark,107)

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/662183
推荐阅读
相关标签
  

闽ICP备14008679号