这篇文章主要介绍“Flink 1.10Container环境怎么配置”,在日常操作中,相信很多人在Flink 1.10Container环境怎么配置问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Flink 1.10Container环境怎么配置”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
容器管理系统的演变
如资源隔离,因为 YARN 是以 Java 为基础开发的,所以它很多资源方面的隔离有一些受限。
另外对 GPU 支持不够,当然现在的 YARN 3.0 已经对 GPU 的调度和管理有一定支持,但之前版本对GPU 支持不是很好。
Flink on K8S intro
部署集群
kubectl create -f flink-configuration-configmap.yamlkubectl create -f jobmanager-service.yamlkubectl create -f jobmanager-deployment.yamlkubectl create -f taskmanager-deployment.yaml
作业提交
./bin/flink run -m : ./examples/streaming/WordCount.jar
优点是无需修改 Flink 源码,仅仅只需预先定义一些yaml 文件,集群就可以启动,互相之间的通信完全不经过 K8S Master;
缺点是资源需要预先申请无法动态调整,而 Flink on YARN 是可以在提交作业时声明集群所需的 JM 和 TM 的资源。
Flink on K8S 实战分享
日志搜集
Metrics
性能
OOM killed
Demo
apiVersion: apps/v1kind: Deploymentmetadata: name: flink-taskmanagerspec: replicas: 2 selector: matchLabels: app: flink component: taskmanager template: metadata: labels: app: flink component: taskmanager spec: containers: - name: taskmanager image: reg.docker.alibaba-inc.com/chagan/flink:latest workingDir: /opt/flink command: ["/bin/bash", "-c", "$FLINK_HOME/bin/taskmanager.sh start; \ while :; do if [[ -f $(find log -name '*taskmanager*.log' -print -quit) ]]; then tail -f -n +1 log/*taskmanager*.log; fi; done"] ports: - containerPort: 6122 name: rpc livenessProbe: tcpSocket: port: 6122 initialDelaySeconds: 30 periodSeconds: 60 volumeMounts: - name: flink-config-volume mountPath: /opt/flink/conf/ - name: state-volume mountPath: /dump/1/state securityContext: runAsUser: 9999 # refers to user _flink_ from official flink image, change if necessary volumes: - name: flink-config-volume configMap: name: flink-config items: - key: flink-conf.yaml path: flink-conf.yaml - key: log4j.properties path: log4j.properties - name: state-volume hostPath: path: /dump/1/state type: DirectoryOrCreate
Q&A 问答
到此,关于“Flink 1.10Container环境怎么配置”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。
原文链接:https://my.oschina.net/u/2828172/blog/4387515