SlideShare ist ein Scribd-Unternehmen logo
1 von 63
Downloaden Sie, um offline zu lesen
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
SQL
ELB
TM
JobManager
TM
TM TM
TM/JM
Jenkins
S3
●
●
●
●
●
●
●
●
●
●
●
🔥
●
●
●
●
$ aws ec2 run-instances 
--image-id ami-xxxxxxxx 
--instance-type c5.xlarge
apiVersion: v1
kind: Pod
metadata:
name: wordcount
spec:
containers:
- image: lyft/wordcount:latest
name: wordcount
resources:
requests:
cpu: "16"
memory: 32Gi
$ aws ec2 run-instances 
--image-id ami-xxxxxxxx 
--instance-type c5.xlarge
●
●
●
●
●
●
4
●
●
●
●
●
●
●
●
●
apiVersion: flink.k8s.io/v1beta1
kind: FlinkApplication
metadata:
name: wordcount
spec:
image: lyft/wordcount:latest
jarName: "wordcount-1.0.0-SNAPSHOT.jar"
parallelism: 30
entryClass: "com.lyft.WordCount"
flinkVersion: "1.8"
flinkConfig:
state.backend: filesystem
jobManagerConfig:
resources:
requests:
memory: "8Gi"
cpu: "4"
taskManagerConfig:
resources:
requests:
memory: "8Gi"
cpu: "8"
$ flink run WordCount.jar
$ curl -XPUT
$ flink stop <jobid>
$ curl -XDELETE wordcount
1. Update jar on jobmanager
2. Cancel job with savepoint
3. Restart cluster
4. Submit job with savepoint
$ curl -XPATCH wordcount 
-d'{“spec/image”: “wordcount:v2”}'
apiVersion: flink.k8s.io/v1beta1
kind: FlinkApplication
metadata:
name: wordcount
spec:
image: lyft/wordcount:v1
jarName: "wordcount-1.0.0-SNAPSHOT.jar"
parallelism: 30
entryClass: "com.lyft.WordCount"
flinkVersion: "1.8"
flinkConfig:
state.backend: filesystem
jobManagerConfig:
resources:
requests:
memory: "8Gi"
cpu: "4"
taskManagerConfig:
resources:
requests:
memory: "8Gi"
cpu: "8"
apiVersion: flink.k8s.io/v1beta1
kind: FlinkApplication
metadata:
name: wordcount
spec:
image: lyft/wordcount:v2
jarName: "wordcount-1.0.0-SNAPSHOT.jar"
parallelism: 30
entryClass: "com.lyft.WordCount"
flinkVersion: "1.8"
flinkConfig:
state.backend: filesystem
jobManagerConfig:
resources:
requests:
memory: "8Gi"
cpu: "4"
taskManagerConfig:
resources:
requests:
memory: "8Gi"
cpu: "8"
$ flink cancel <jobid>
$ curl -XDELETE wordcount
$ flink cancel <jobid>
$ curl -XPATCH wordcount 
-d'{“spec/deleteMode”: “ForceCancel”}'
$ curl -XDELETE wordcount
$ sp restart
???
$ sp restart
$ curl -XPATCH wordcount 
-d'{“spec/restartNonce”: “xxx”}'
Status:
Deploy Hash: b6c4bb26
Failed Deploy Hash:
Job Status:
Completed Checkpoint Count: 3908
Entry Class: com.lyft.wordcount.WordCount
Failed Checkpoint Count: 0
Health: Green
Jar Name: wordcount-1.0-SNAPSHOT.jar
Job ID: 1ebd3cd9445dda09d1ebe5b28b1661ee
Job Restart Count: 1
Last Checkpoint Time: 2019-09-12T01:04:24Z
Last Failing Time: <nil>
Parallelism: 8
Restore Time: 2019-09-10T21:18:42Z
Start Time: 2019-09-10T21:18:40Z
State: RUNNING
Last Seen Error: <nil>
Last Updated At: 2019-09-12T01:04:38Z
Phase: Running
Retry Count: 0
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal CreatingCluster 2m29s flinkK8sOperator Creating Flink cluster for deploy a931a6c4
Normal CancellingJob 93s flinkK8sOperator Cancelling job 1ebd3cd9445dda09d1ebe5b28b1661ee with a
final savepoint
Normal CanceledJob 63s flinkK8sOperator Canceled job with savepoint
s3://streamingplatform/wordcount/savepoints/savepoint-1ebd3c-4e3f35489444
Normal JobSubmitted 59s flinkK8sOperator Flink job submitted to cluster with id
0c1790aa33fdc8dd2798bad1d55ddfa8
Normal ToreDownCluster 33s flinkK8sOperator Deleted old cluster with hash b6c4bb26
●
● sp
●
●
Execution (Fn API)
Apache
Flink
Apache
Spark
Pipeline Construction (Runner API)
Beam GoBeam Java
Beam
Python
Execution Execution
Cloud
Dataflow
Execution
p = beam.Pipeline(options=pipeline_options)
messages = (p | FlinkStreamingImpulseSource()
.set_message_count(known_args.count)
.set_interval_ms(known_args.interval_ms))
_ = (messages | 'decode' >> beam.Map(lambda x: ('', 1))
| 'window' >> beam.WindowInto(window.GlobalWindows())
| 'group' >> beam.GroupByKey()
| 'count' >> beam.Map(count)
| 'log' >> beam.Map(lambda x: logging.info("%d" % x[1])))
result = p.run()
result.wait_until_finish()
Kubernetes
Offline build
Beam on Kubernetes  (ApacheCon NA 2019)
Beam on Kubernetes  (ApacheCon NA 2019)
Beam on Kubernetes  (ApacheCon NA 2019)
Beam on Kubernetes  (ApacheCon NA 2019)

Weitere ähnliche Inhalte

Ähnlich wie Beam on Kubernetes (ApacheCon NA 2019)

ch6-pv2-device-drivers
ch6-pv2-device-driversch6-pv2-device-drivers
ch6-pv2-device-drivers
yushiang fu
 

Ähnlich wie Beam on Kubernetes (ApacheCon NA 2019) (20)

JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin StożekJDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
JDO 2019: Kubernetes logging techniques with a touch of LogSense - Marcin Stożek
 
Optimizing {Java} Application Performance on Kubernetes
Optimizing {Java} Application Performance on KubernetesOptimizing {Java} Application Performance on Kubernetes
Optimizing {Java} Application Performance on Kubernetes
 
K8s Pod Scheduling - Deep Dive. By Tsahi Duek.
K8s Pod Scheduling - Deep Dive. By Tsahi Duek.K8s Pod Scheduling - Deep Dive. By Tsahi Duek.
K8s Pod Scheduling - Deep Dive. By Tsahi Duek.
 
OSMC 2016 - ZMON Zalandos OS approach to monitoring in the cloud and DCs by J...
OSMC 2016 - ZMON Zalandos OS approach to monitoring in the cloud and DCs by J...OSMC 2016 - ZMON Zalandos OS approach to monitoring in the cloud and DCs by J...
OSMC 2016 - ZMON Zalandos OS approach to monitoring in the cloud and DCs by J...
 
OSMC 2016 | ZMON: Zalando's OS approach to monitoring in the cloud and DCs by...
OSMC 2016 | ZMON: Zalando's OS approach to monitoring in the cloud and DCs by...OSMC 2016 | ZMON: Zalando's OS approach to monitoring in the cloud and DCs by...
OSMC 2016 | ZMON: Zalando's OS approach to monitoring in the cloud and DCs by...
 
New Features of Kubernetes v1.2.0 beta
New Features of Kubernetes v1.2.0 betaNew Features of Kubernetes v1.2.0 beta
New Features of Kubernetes v1.2.0 beta
 
YAML Tips For Kubernetes by Neependra Khare
YAML Tips For Kubernetes by Neependra KhareYAML Tips For Kubernetes by Neependra Khare
YAML Tips For Kubernetes by Neependra Khare
 
Being agile with modern Java
Being agile with modern JavaBeing agile with modern Java
Being agile with modern Java
 
PGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander Kukushkin
PGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander KukushkinPGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander Kukushkin
PGConf.ASIA 2019 Bali - PostgreSQL on K8S at Zalando - Alexander Kukushkin
 
What Can I Get You? An Introduction to Dynamic Resource Allocation
What Can I Get You? An Introduction to Dynamic Resource AllocationWhat Can I Get You? An Introduction to Dynamic Resource Allocation
What Can I Get You? An Introduction to Dynamic Resource Allocation
 
Lessons Learnt from Running Thousands of On-demand Spark Applications
Lessons Learnt from Running Thousands of On-demand Spark ApplicationsLessons Learnt from Running Thousands of On-demand Spark Applications
Lessons Learnt from Running Thousands of On-demand Spark Applications
 
Optimizing Application Performance on Kubernetes
Optimizing Application Performance on KubernetesOptimizing Application Performance on Kubernetes
Optimizing Application Performance on Kubernetes
 
Docker in Production - IPC 2016
Docker in Production - IPC 2016Docker in Production - IPC 2016
Docker in Production - IPC 2016
 
K8s best practices from the field!
K8s best practices from the field!K8s best practices from the field!
K8s best practices from the field!
 
ch6-pv2-device-drivers
ch6-pv2-device-driversch6-pv2-device-drivers
ch6-pv2-device-drivers
 
Kubernetes - Starting with 1.2
Kubernetes  - Starting with 1.2Kubernetes  - Starting with 1.2
Kubernetes - Starting with 1.2
 
Iurii Antykhovych "Java and performance tools and toys"
Iurii Antykhovych "Java and performance tools and toys"Iurii Antykhovych "Java and performance tools and toys"
Iurii Antykhovych "Java and performance tools and toys"
 
Managed Container Orchestration with Amazon ECS
Managed Container Orchestration with Amazon ECSManaged Container Orchestration with Amazon ECS
Managed Container Orchestration with Amazon ECS
 
Deploying on Kubernetes - An intro
Deploying on Kubernetes - An introDeploying on Kubernetes - An intro
Deploying on Kubernetes - An intro
 
Replatforming Legacy Packaged Applications: Block-by-Block with Minecraft
Replatforming Legacy Packaged Applications: Block-by-Block with MinecraftReplatforming Legacy Packaged Applications: Block-by-Block with Minecraft
Replatforming Legacy Packaged Applications: Block-by-Block with Minecraft
 

Kürzlich hochgeladen

scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Kürzlich hochgeladen (20)

scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 

Beam on Kubernetes (ApacheCon NA 2019)

  • 1.
  • 3.
  • 4.
  • 5.
  • 8. SQL
  • 9.
  • 10.
  • 11.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. $ aws ec2 run-instances --image-id ami-xxxxxxxx --instance-type c5.xlarge
  • 26. apiVersion: v1 kind: Pod metadata: name: wordcount spec: containers: - image: lyft/wordcount:latest name: wordcount resources: requests: cpu: "16" memory: 32Gi $ aws ec2 run-instances --image-id ami-xxxxxxxx --instance-type c5.xlarge
  • 31.
  • 32.
  • 34.
  • 35. apiVersion: flink.k8s.io/v1beta1 kind: FlinkApplication metadata: name: wordcount spec: image: lyft/wordcount:latest jarName: "wordcount-1.0.0-SNAPSHOT.jar" parallelism: 30 entryClass: "com.lyft.WordCount" flinkVersion: "1.8" flinkConfig: state.backend: filesystem jobManagerConfig: resources: requests: memory: "8Gi" cpu: "4" taskManagerConfig: resources: requests: memory: "8Gi" cpu: "8"
  • 36.
  • 37.
  • 38. $ flink run WordCount.jar $ curl -XPUT
  • 39.
  • 40. $ flink stop <jobid> $ curl -XDELETE wordcount
  • 41.
  • 42. 1. Update jar on jobmanager 2. Cancel job with savepoint 3. Restart cluster 4. Submit job with savepoint $ curl -XPATCH wordcount -d'{“spec/image”: “wordcount:v2”}'
  • 43. apiVersion: flink.k8s.io/v1beta1 kind: FlinkApplication metadata: name: wordcount spec: image: lyft/wordcount:v1 jarName: "wordcount-1.0.0-SNAPSHOT.jar" parallelism: 30 entryClass: "com.lyft.WordCount" flinkVersion: "1.8" flinkConfig: state.backend: filesystem jobManagerConfig: resources: requests: memory: "8Gi" cpu: "4" taskManagerConfig: resources: requests: memory: "8Gi" cpu: "8" apiVersion: flink.k8s.io/v1beta1 kind: FlinkApplication metadata: name: wordcount spec: image: lyft/wordcount:v2 jarName: "wordcount-1.0.0-SNAPSHOT.jar" parallelism: 30 entryClass: "com.lyft.WordCount" flinkVersion: "1.8" flinkConfig: state.backend: filesystem jobManagerConfig: resources: requests: memory: "8Gi" cpu: "4" taskManagerConfig: resources: requests: memory: "8Gi" cpu: "8"
  • 44.
  • 45.
  • 46. $ flink cancel <jobid> $ curl -XDELETE wordcount
  • 47. $ flink cancel <jobid> $ curl -XPATCH wordcount -d'{“spec/deleteMode”: “ForceCancel”}' $ curl -XDELETE wordcount
  • 49. $ sp restart $ curl -XPATCH wordcount -d'{“spec/restartNonce”: “xxx”}'
  • 50. Status: Deploy Hash: b6c4bb26 Failed Deploy Hash: Job Status: Completed Checkpoint Count: 3908 Entry Class: com.lyft.wordcount.WordCount Failed Checkpoint Count: 0 Health: Green Jar Name: wordcount-1.0-SNAPSHOT.jar Job ID: 1ebd3cd9445dda09d1ebe5b28b1661ee Job Restart Count: 1 Last Checkpoint Time: 2019-09-12T01:04:24Z Last Failing Time: <nil> Parallelism: 8 Restore Time: 2019-09-10T21:18:42Z Start Time: 2019-09-10T21:18:40Z State: RUNNING Last Seen Error: <nil> Last Updated At: 2019-09-12T01:04:38Z Phase: Running Retry Count: 0
  • 51. Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal CreatingCluster 2m29s flinkK8sOperator Creating Flink cluster for deploy a931a6c4 Normal CancellingJob 93s flinkK8sOperator Cancelling job 1ebd3cd9445dda09d1ebe5b28b1661ee with a final savepoint Normal CanceledJob 63s flinkK8sOperator Canceled job with savepoint s3://streamingplatform/wordcount/savepoints/savepoint-1ebd3c-4e3f35489444 Normal JobSubmitted 59s flinkK8sOperator Flink job submitted to cluster with id 0c1790aa33fdc8dd2798bad1d55ddfa8 Normal ToreDownCluster 33s flinkK8sOperator Deleted old cluster with hash b6c4bb26
  • 53.
  • 54.
  • 55.
  • 56.
  • 57. ● ● Execution (Fn API) Apache Flink Apache Spark Pipeline Construction (Runner API) Beam GoBeam Java Beam Python Execution Execution Cloud Dataflow Execution
  • 58. p = beam.Pipeline(options=pipeline_options) messages = (p | FlinkStreamingImpulseSource() .set_message_count(known_args.count) .set_interval_ms(known_args.interval_ms)) _ = (messages | 'decode' >> beam.Map(lambda x: ('', 1)) | 'window' >> beam.WindowInto(window.GlobalWindows()) | 'group' >> beam.GroupByKey() | 'count' >> beam.Map(count) | 'log' >> beam.Map(lambda x: logging.info("%d" % x[1]))) result = p.run() result.wait_until_finish()