博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
flink Standalone Cluster
阅读量:7256 次
发布时间:2019-06-29

本文共 4307 字,大约阅读时间需要 14 分钟。

Requirements

Software Requirements

Flink runs on all UNIX-like environments, e.g. Linux, Mac OS X, and Cygwin (for Windows) and expects the cluster to consist of one master node and one or more worker nodes. Before you start to setup the system, make sure you have the following software installed on each node:

  • Java 1.8.x or higher,
  • ssh (sshd must be running to use the Flink scripts that manage remote components)

If your cluster does not fulfill these software requirements you will need to install/upgrade it.

Having passwordless SSH and the same directory structure on all your cluster nodes will allow you to use our scripts to control everything.

ssh免密登录:

在源机器执行

ssh-keygen  //一路回车,生成公钥,位置~/.ssh/id_rsa.pub

ssh-copy-id -i ~/.ssh/id_rsa.pub root@目的机器  //将源机器生成的公钥拷贝到目的机器的~/.ssh/authorized_keys

或者 手动将源机器生成的公钥拷贝到目的机器的~/.ssh/authorized_keys。注意:不要有换行

完成!

JAVA_HOME Configuration 

系统环境配置了JAVA_HOME即可,无需如下操作

Flink requires the JAVA_HOME environment variable to be set on the master and all worker nodes and point to the directory of your Java installation.

You can set this variable in conf/flink-conf.yaml via the env.java.home key.

Go to the  and get the ready-to-run package. Make sure to pick the Flink package matching your Hadoop version. If you don’t plan to use Hadoop, pick any version.

After downloading the latest release, copy the archive to your master node and extract it:

tar xzf flink-*.tgzcd flink-*

After having extracted the system files, you need to configure Flink for the cluster by editing conf/flink-conf.yaml.

Set the jobmanager.rpc.address key to point to your master node. You should also define the maximum amount of main memory the JVM is allowed to allocate on each node by setting the jobmanager.heap.mb and taskmanager.heap.mb keys.

These values are given in MB. If some worker nodes have more main memory which you want to allocate to the Flink system you can overwrite the default value by setting the environment variable FLINK_TM_HEAP on those specific nodes.

Finally, you must provide a list of all nodes in your cluster which shall be used as worker nodes. Therefore, similar to the HDFS configuration, edit the file conf/slaves and enter the IP/host name of each worker node. Each worker node will later run a TaskManager.

The following example illustrates the setup with three nodes (with IP addresses from 10.0.0.1 to 10.0.0.3 and hostnames masterworker1worker2) and shows the contents of the configuration files (which need to be accessible at the same path on all machines):

/path/to/flink/conf/flink-conf.yaml
jobmanager.rpc.address: 10.0.0.1 注意:需要在所有需要启动taskmanager的机器进行如上配置

 /path/to/flink/conf/slaves

10.0.0.210.0.0.3

 

The Flink directory must be available on every worker under the same path. You can use a shared NFS directory, or copy the entire Flink directory to every worker node.

Please see the  for details and additional configuration options.

In particular,

  • the amount of available memory per JobManager (jobmanager.heap.mb),
  • the amount of available memory per TaskManager (taskmanager.heap.mb),
  • the number of available CPUs per machine (taskmanager.numberOfTaskSlots),
  • the total number of CPUs in the cluster (parallelism.default) and
  • the temporary directories (taskmanager.tmp.dirs)

are very important configuration values.

The following script starts a JobManager on the local node and connects via SSH to all worker nodes listed in the slaves file to start the TaskManager on each node. Now your Flink system is up and running. The JobManager running on the local node will now accept jobs at the configured RPC port.

Assuming that you are on the master node and inside the Flink directory:

bin/start-cluster.sh

To stop Flink, there is also a stop-cluster.sh script.

Adding JobManager/TaskManager Instances to a Cluster

You can add both JobManager and TaskManager instances to your running cluster with the bin/jobmanager.sh and bin/taskmanager.shscripts.

Adding a JobManager

bin/jobmanager.sh ((start|start-foreground) cluster)|stop|stop-all

Adding a TaskManager

bin/taskmanager.sh start|start-foreground|stop|stop-all

Make sure to call these scripts on the hosts on which you want to start/stop the respective instance.

转载地址:http://jnkdm.baihongyu.com/

你可能感兴趣的文章
【leetcode】704.BinarySearch
查看>>
磁盘管理三-raid
查看>>
static 关键字的使用,静态和非静态类的区别
查看>>
一个简单的三层结构demo
查看>>
DFS (Backtracing) 基本框架
查看>>
汕头市队赛 C SRM 05 - YYL 杯 R1 T3!
查看>>
基于Redis的分布式锁安全性分析-转
查看>>
android——仿网易今日头条等自定义频道listview 或者grideview等item上移到另一个view中...
查看>>
leetcode 2. 两数相加
查看>>
第二周进度报告
查看>>
Hadoop集群(一) Zookeeper搭建
查看>>
JDBC事务,银行转账,货物进出库等等。
查看>>
oc-Foundation框架-NSString-常用方法
查看>>
算法:管窥算法-查找旋转数组(即进行了左移或右移的数组)的最小值
查看>>
linux 查看进程和端口
查看>>
服务器端汉字乱码
查看>>
学习笔记之Data analysis
查看>>
Linux系统中“动态库”和“静态库”那点事儿【转】
查看>>
Linux磁盘空间不足
查看>>
Java项目怎么使用Swagger生成API文档?
查看>>