当前位置:网站首页>Flink 1.15.1 Cluster Construction (StandaloneSession)
Flink 1.15.1 Cluster Construction (StandaloneSession)
2022-08-05 02:48:00 【spreadk】
I. Preparation
1. Flink version
Apache Flink 1.15.1 for Scala 2.12
2. System platform
linux debian11.4_64.
3. Node
- 192.168.1.25 (flink-master, flink-worker-1)
- 192.168.1.26 (flink-worker-2)
- 192.168.1.27 (flink-worker-3)
4. Configuration
(1) Local DNS settings
Add the following to the /etc/hosts file of the three nodes:
192.168.1.25 flink-master192.168.1.25 flink-worker-1192.168.1.26 flink-worker-2192.168.1.27 flink-worker-3(2) ssh password-free login settings
Flink standalone clusters run sshd to execute scripts for managing Flink components.
1) Generate a secret key
Execute the following commands on the three nodes respectively:
ssh-keygen2) Install the public key
Install the public key of the current node on other nodes (including the current node), that is, add the content of the ~/.ssh /id_rsa.pub file of this node to the ~/.ssh/authorized_keys file of other cluster nodes, thenOther cluster nodes can log in to this node without password.
Execute the following three commands on the three nodes respectively:
ssh-copy-id flink-worker-1ssh-copy-id flink-worker-2ssh-copy-id flink-worker-3Second, build a cluster
1. Installation path
Unzip the downloaded Flink binary package and copy it to the /opt/flink-1.15.1 path.The three nodes are the same.
2. Configure the cluster node list
It can be configured on the master node.
1) Primary node (jobmanager)
Modify the /opt/flink-1.15.1/conf/masters file and add the master node address as follows:
flink-master:80812) Work node (taskmanager)
Modify the /opt/flink-1.15.1/conf/workers file and add the worker node address as follows:
flink-worker-1flink-worker-2flink-worker-3By configuring masters and workers, the start-cluster.sh and stop-cluster.sh scripts can be used to uniformly manage (start, shut down, etc.) all cluster nodes, which is convenient and fast.
We can also not configure masters, workers, and manage sets without using start-cluster.sh and stop-cluster.sh scripts, directly by executing " jobmanager.sh start | stop ", " taskmanager.sh start | stop "To start the master node and worker nodes (clusters started through start-cluster.sh, you can also dynamically add or remove worker nodes through taskmanager.sh).
3. Cluster parameter configuration
Modify the /opt/flink-1.15.1/conf/flink-conf.yaml file of the three nodes respectively. The key content is as follows (other parameters are set as appropriate):
# master addressjobmanager.rpc.address: flink-master# master portjobmanager.rpc.port: 6123# master address binding settings (master node parameters)jobmanager.bind-host: 0.0.0.0# worker address binding settingstaskmanager.bind-host: 0.0.0.0# worker address (note: the hosts of the three worker nodes are different)taskmanager.host: flink-worker-1# worker slot number settingtaskmanager.numberOfTaskSlots: 2# default parallelismparallelism.default: 2# WEB UI port (master node parameter)rest.port: 8081# WEB UI management addressrest.address: flink-master# WEB UI address binding settings, if you want external access, you can set a specific IP, or directly set it to "0.0.0.0" (master node parameter)rest.bind-address: 0.0.0.0# Job file directory (master node parameter)web.upload.dir: /opt/flink-1.15.1/usrlib# IO temporary directory, default: /tmpio.tmp.dirs: /opt/flink-1.15.1/tmp# Cluster node process ID storage directory, default: /tmpenv.pid.dir: /opt/flink-1.15.1/pidsNote:
The "taskmanager.host" parameters of the three worker nodes are different and can be changed to their respective addresses.The number of slots and parallelism of each worker node can also be set according to the conditions of the node itself.
4. Start the cluster
On the master node, the cluster can be started through the /opt/flink-1.15.1/bin/start-cluster.sh script (standalonesession mode).Running this script automatically starts the jobmanager node and the other three taskmanagers in the cluster (no need to start taskmanager on other nodes).
Startup process:

Admin interface (overview):

Management interface (jobmanager):

Management interface (taskmanager):

5. Close the cluster
On the master node, run the /opt/flink-1.15.1/bin/stop-cluster.sh script, which will stop the jobmanager and all taskmanagers at the same time.

Second, execute JOB
Upload task JAR:

Task Status:


边栏推荐
- The pit of std::string::find return value
- 解决端口占用问题 Port xxxx was already in use
- lua学习
- 注意潍坊开具发票一般需要注意
- 1667. Fix names in tables
- Simple description of linked list and simple implementation of code
- HDU 1114: Piggy-Bank ← The Complete Knapsack Problem
- The usage of try...catch and finally in js
- Snapback - same tree
- torch.roll()
猜你喜欢

2022-08-04: Input: deduplicated array arr, the numbers in it only contain 0~9.limit, a number.Return: The maximum number that can be spelled out with arr if the requirement is smaller than limit.from

线上MySQL的自增id用尽怎么办?

Countdown to 2 days|Cloud native Meetup Guangzhou Station, waiting for you!

J9 Digital Currency: What is the creator economy of web3?

Gantt chart is here, project management artifact, template is used directly

腾讯云【Hiflow】新时代自动化工具

Ant Sword Advanced Module Development

VSCode Change Default Terminal 如何修改vscode的默认terminal
![Tencent Cloud [Hiflow] New Era Automation Tool](/img/ac/5c61424f22cd9fed74dcd529fdb6a4.png)
Tencent Cloud [Hiflow] New Era Automation Tool

2022-08-04:输入:去重数组arr,里面的数只包含0~9。limit,一个数字。 返回:要求比limit小的情况下,能够用arr拼出来的最大数字。 来自字节。
随机推荐
Matlab map with color representation module value size arrow
1484. 按日期分组销售产品
C student management system head to add a student node
Beidou no. 3 short message terminal high slope in open-pit mine monitoring programme
Review 51 MCU
[Fortune-telling-60]: "The Soldier, the Tricky Way"-2-Interpretation of Sun Tzu's Art of War
QStyle platform style
Compressed storage of special matrices
QT: The Magical QVarient
DAY22: sqli-labs shooting range clearance wp (Less01~~Less20)
undo问题
sql server installation prompts that the username does not exist
Common hardware delays
post-study program
Gantt chart is here, project management artifact, template is used directly
Everyone in China said data, you need to focus on core characteristic is what?
HDU 1114:Piggy-Bank ← 完全背包问题
数据增强Mixup原理与代码解读
软链接引发的物理备份问题
private封装