Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the way to deploy application?

Shulou Source: shulou.com Published: 2022-06-03 06:43:51 11月15日 Update

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!

Tags: Images methods users repositories content parameters directories spaces empowerment clustering learning utility depth once and for all between tasks interests names names commands Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology OPPO Reno Docker Xiaomi MySQL