当前位置:网站首页>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:


边栏推荐
- 北斗三号短报文终端露天矿山高边坡监测方案
- 剑指offer专项突击版第20天
- LeetCode uses the minimum cost to climb the stairs----dp problem
- 通过模拟Vite一起深入其工作原理
- The 2022 EdgeX China Challenge will be grandly opened on August 3
- Likou - preorder traversal, inorder traversal, postorder traversal of binary tree
- Data storage practice based on left-order traversal
- sql server 安装提示用户名不存在
- Matlab drawing 3
- Access Characteristics of Constructor under Inheritance Relationship
猜你喜欢

链表的简单描述及代码的简单实现

QT language file production

VSCode Change Default Terminal 如何修改vscode的默认terminal

C language diary 9 3 kinds of statements of if

使用二维码传输文件的小工具 - QFileTrans 1.2.0.1

通过模拟Vite一起深入其工作原理

mysql没法Execute 大拿们求解

Regular expression to match a certain string in the middle

View handler 踩坑记录
![[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)](/img/7b/8b3f1e4f0000aa34fc1f8fff485765.png)
[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)
随机推荐
Solve the problem of port occupancy Port xxxx was already in use
Open Source License Description LGPL
注意潍坊开具发票一般需要注意
Gantt chart is here, project management artifact, template is used directly
1527. Patients suffering from a disease
View handler stepping record
C language implements a simple number guessing game
torch.roll()
倒计时 2 天|云原生 Meetup 广州站,等你来!
In 2022, you still can't "low code"?Data science can also play with Low-Code!
select 标签自定义样式
语法基础(变量、输入输出、表达式与顺序语句)
语法基础(变量、输入输出、表达式与顺序语句完成情况)
Object.defineProperty monitors data changes in real time and updates the page
A small tool to transfer files using QR code - QFileTrans 1.2.0.1
Syntax basics (variables, input and output, expressions and sequential statement completion)
1667. 修复表中的名字
QStyle platform style
通过模拟Vite一起深入其工作原理
【Daily Training】1403. Minimum Subsequence in Non-Increasing Order