signed

QiShunwang

“诚信为本、客户至上”

Flink Standalone环境的搭建

2021/6/9 9:25:58   来源:

1、下载文件:flink-1.11.2-bin-scala_2.12.tgz
https://archive.apache.org/dist/flink/flink-1.11.2/

2、上传文件

上传文件到两台机器:10.101.93.156 、10.101.93.131


2、解压文件: tar -xvf flink-1.11.2-bin-scala_2.12.tgz

3、配置文件:
把10.101.93.156配置为master
把10.101.93.131配置为worker 

两台机器配置一模一样:
$ vi flink-1.11.2/conf/flink-conf.yaml
jobmanager.rpc.address: 10.101.93.156
flink-1.11.2/conf/workers
$ vi flink-1.11.2/conf/workers 
10.101.93.131
4、启动flink (在master 节点的主机上操作)
[host-10-101-93-156-vm bin]$ ./start-cluster.sh 
Starting cluster.
Starting standalonesession daemon on host host-10-101-93-156-vm.
Starting taskexecutor daemon on host host-10-101-93-131-vm.


检查进程是否启动:

[host-10-101-93-156-vm bin]$ ps -ef |grep flink
aucd      3532     1  3 14:48 pts/0    00:00:19 /usr/java/jdk1.8.0_131//bin/java -Xmx1073741824 -Xms1073741824 -XX:MaxMetaspaceSize=268435456 -Dlog.file=/home/aucd/flink/flink-1.11.2/log/flink-aucd-standalonesession-0-host-10-101-93-156-vm.log -Dlog4j.configuration=file:/home/aucd/flink/flink-1.11.2/conf/log4j.properties -Dlog4j.configurationFile=file:/home/aucd/flink/flink-1.11.2/conf/log4j.properties -Dlogback.configurationFile=file:/home/aucd/flink/flink-1.11.2/conf/logback.xml -classpath /home/aucd/flink/flink-1.11.2/lib/flink-csv-1.11.2.jar:/home/aucd/flink/flink-1.11.2/lib/flink-json-1.11.2.jar:/home/aucd/flink/flink-1.11.2/lib/flink-shaded-zookeeper-3.4.14.jar:/home/aucd/flink/flink-1.11.2/lib/flink-table_2.12-1.11.2.jar:/home/aucd/flink/flink-1.11.2/lib/flink-table-blink_2.12-1.11.2.jar:/home/aucd/flink/flink-1.11.2/lib/log4j-1.2-api-2.12.1.jar:/home/aucd/flink/flink-1.11.2/lib/log4j-api-2.12.1.jar:/home/aucd/flink/flink-1.11.2/lib/log4j-core-2.12.1.jar:/home/aucd/flink/flink-1.11.2/lib/log4j-slf4j-impl-2.12.1.jar:/home/aucd/flink/flink-1.11.2/lib/flink-dist_2.12-1.11.2.jar::: org.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint --configDir /home/aucd/flink/flink-1.11.2/conf --executionMode cluster

[host-10-101-93-131-vm conf]$ ps -ef | grep flink
aucd      7147     1  3 14:49 ?        00:00:19 /usr/java/jdk1.8.0_251/bin/java -XX:+UseG1GC -Xmx536870902 -Xms536870902 -XX:MaxDirectMemorySize=268435458 -XX:MaxMetaspaceSize=268435456 -Dlog.file=/home/aucd/flink/flink-1.11.2/log/flink-aucd-taskexecutor-4-yuanlelin-duzhimin-normal-host-10-101-93-131-vm.log -Dlog4j.configuration=file:/home/aucd/flink/flink-1.11.2/conf/log4j.properties -Dlog4j.configurationFile=file:/home/aucd/flink/flink-1.11.2/conf/log4j.properties -Dlogback.configurationFile=file:/home/aucd/flink/flink-1.11.2/conf/logback.xml -classpath /home/aucd/flink/flink-1.11.2/lib/flink-csv-1.11.2.jar:/home/aucd/flink/flink-1.11.2/lib/flink-json-1.11.2.jar:/home/aucd/flink/flink-1.11.2/lib/flink-shaded-zookeeper-3.4.14.jar:/home/aucd/flink/flink-1.11.2/lib/flink-table_2.12-1.11.2.jar:/home/aucd/flink/flink-1.11.2/lib/flink-table-blink_2.12-1.11.2.jar:/home/aucd/flink/flink-1.11.2/lib/log4j-1.2-api-2.12.1.jar:/home/aucd/flink/flink-1.11.2/lib/log4j-api-2.12.1.jar:/home/aucd/flink/flink-1.11.2/lib/log4j-core-2.12.1.jar:/home/aucd/flink/flink-1.11.2/lib/log4j-slf4j-impl-2.12.1.jar:/home/aucd/flink/flink-1.11.2/lib/flink-dist_2.12-1.11.2.jar::: org.apache.flink.runtime.taskexecutor.TaskManagerRunner --configDir /home/aucd/flink/flink-1.11.2/conf -D taskmanager.memory.framework.off-heap.size=134217728b -D taskmanager.memory.network.max=134217730b -D taskmanager.memory.network.min=134217730b -D taskmanager.memory.framework.heap.size=134217728b -D taskmanager.memory.managed.size=536870920b -D taskmanager.cpu.cores=1.0 -D taskmanager.memory.task.heap.size=402653174b -D taskmanager.memory.task.off-heap.size=0b

5、打开Flink Dashboard
[host-10-101-93-156-vm conf]$ vi flink-conf.yaml
rest.port: 8081
rest.address: 10.101.93.156
重启flink 集群
浏览器输入:http://10.101.93.156:8081