standalone模式
- 修改,并生效环境变量
- 修改配置文件 vim flink-conf.yaml
jobmanager.rpc.address: hadoop202 # 将主节点的ip映射名写入
- 修改conf/slaves文件,写入从节点
- 将flink文件进行分发
- 如果要使用hdfs文件系统,需要将jar包放入到 flink根目录/lib下
jar包下载通道: 点击进入传送通道
百度网盘提取码: 6666 - 进行任务测试: 使用的是hdfs文件系统, 如果使用本地文件系统,需要保证每一台从节点上都存在源数据
bin/flink run /export/servers/flink-1.6.0/examples/batch/WordCount.jar --input hdfs://hadoop202:8020/test/input/wordcount.txt --output hdfs://hadoop202:8020/test/output/result.txt
- 使用自己编写的程序进行测试:
bin/flink run -c com.atguigu.wc.StreamWordCount –p 2 FlinkTutorial-1.0-SNAPSHOT-jar-with-dependencies.jar --host lcoalhost --port 7777
说明: -c :主程序入口 -p: 并行度 最后两个是自己写的程序中,所进行输入的参数