Created
November 1, 2018 09:46
-
-
Save oivoodoo/4c1ef67544b2c5023c249f21813392af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts('[spark] remove marker file by ensuring to trigger graceful stop spark-etl jobs') | |
`hadoop fs -rm -r /tmp/datalake.marker.*` | |
while true | |
app_id = `yarn application -list | grep datalake.Main | awk -F " " '{print $1}'`.strip | |
status = `yarn application -list | grep datalake.Main | awk -F " " '{print $6}'`.strip | |
puts("[spark] application status: #{status}") | |
if status == "ACCEPTED" | |
puts("[spark] killing #{app_id}") | |
`yarn application -kill #{app_id}` | |
break | |
end | |
if status != 'RUNNING' | |
puts("[spark] application '#{app_id}' was stopped") | |
break | |
end | |
puts("[spark] application '#{app_id}' waiting graceful shutdown...") | |
sleep(20) | |
end | |
puts('[spark] remove checkpoint directory because of rolling out the new application version') | |
`hadoop fs -rm -r /tmp/spark-etl/` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment