In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "what is the way to deploy application?". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the way to deploy application?"
Run-application mode
(this method saves resources and isolates data once and for all, and the clusters will not influence each other.)
①, combine your project jar package with flink image to generate a new image (the default jdk is 1.8.If there is a jdk version, you can type the home directory of jdk into the image together, and then specify jdk by adding the parameter env.java.home: / opt/flink/jdk-11.0.10+0 in the configuration file)
Dockerfile:
FROM flinkRUN mkdir-p / opt/flink/usrlibCOPY matest.jar / opt/flink/usrlib/matest.jarCOPY jdk-11.0.10+0 / opt/flink/jdk-11.0.10+0 / / RUN echo "env.java.home=/opt/flink/jdk-11.0.10+0" > / opt/flink/conf/flink-conf.yaml
②, build an image
Docker build-t wordcount:1.0 (your image custom name). /
③, if there is a push from the local warehouse to the local warehouse, then the nodes of other kubernetes do not need to manually copy the image
Docker tag wordcount:1.0 192.168.xx.xx:30002/gtcom/wordcount:1.0docker push 192.168.xx.xx:30002/gtcom/wordcount:1.0
④, creating the kubernets namespace
Kubectl create namespace flink-application-cluster
⑤, the user who created the space flink (custom)
Kubectl create serviceaccount flink- n flink-application-cluster
⑥, which empowers the user (does not create a user and will report a permission error when starting up with authorization)
Kubectl create clusterrolebinding flink-role-binding-flink\-clusterrole=edit\-serviceaccount=flink-application-cluster:flink
⑦, go to the home directory of your server flink and start the cluster with the flink command
Bin/flink run-application-- target kubernetes-application\-- Dkubernetes.cluster-id=gtcom-application-cluster (custom task name Otherwise, it will be created automatically)\-Dkubernetes.namespace=flink-application-cluster\-Dkubernetes.service-account=flink\-Dkubernetes.container.image= 192.168.xx.xx:30002/gtcom/wordcount:1.0\ local:///opt/flink/usrlib/gtcom-governance-2.3.0.jar-- driverType AccessGovern-- flow news-- topicName flink-index-- kafkaParallelism 3-- sinkParallelism 3
(starting with "--driverType" are some custom parameters that your jar package needs to pass.)
Provide some pictures:
At this point, I believe that you have a deeper understanding of "what is the way to deploy application?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.