flink_根据官网搭建项目_DataStream API

1 遇到的错误

  • 运行时会报类找不到:将pom.xml中的<scope>provided</scope>注释掉即可,还有一种办法,见官方说明

https://ci.apache.org/projects/flink/flink-docs-master/zh/getting-started/project-setup/dependencies.html

 

  • 构建时报错: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate

使用 mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 替换   mvn archetype:generate

2 编写代码

  • 官方文档-中文版

https://ci.apache.org/projects/flink/flink-docs-master/zh/getting-started/walkthroughs/datastream_api.html

  • 官方文档-英文版

https://ci.apache.org/projects/flink/flink-docs-master/getting-started/walkthroughs/datastream_api.html

3 将代码提交到github

  • 参考教程

https://github.com/FatliTalk/blog/issues/11

https://mp.weixin.qq.com/s?src=11&timestamp=1591498330&ver=2385&signature=1t3crGkTIHXXiy9Ro7fBnMwwONeRiKcU4O8Ee9svqu2bPvJdIWV3kysj1ofpAI1BPow2UNw3urDBV8Y0Z-IZmAbaWJ7943TJbda5JM89eHmb3lWJhJgOl3VUAeKohJkA&new=1

 

  • 提交项目失败,报错: unable to auto-detect email address,在终端中运行这两行命令,设置你的github的邮箱和用户名

  • 在github中删掉之前创建失败的仓库,进入仓库的settings,拉到最底部

 

  •  重新提交项目到github

4 部署(提交jar包到flink)

  • 官方文档

https://ci.apache.org/projects/flink/flink-docs-master/zh/ops/deployment/yarn_setup.html

原文地址:https://www.cnblogs.com/S-Mustard/p/13060096.html