Skip to content

Commit

Permalink
[hotfix][tests] Shut down HDFS and YARN cleanly.
Browse files Browse the repository at this point in the history
Use provided scripts to shut down HDFS and YARN instead of grepkill! function.
Using grepkill! one can run situations where flink and hadoop processes are
killed concurrently, which results in an exception.
  • Loading branch information
GJL committed Apr 10, 2019
1 parent c3bd1bd commit cc3c2d6
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion flink-jepsen/src/jepsen/flink/hadoop.clj
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,37 @@
(info "Start DataNode")
(c/exec (str install-dir "/sbin/hadoop-daemon.sh") :--config hadoop-conf-dir :--script :hdfs :start :datanode)))

(defn stop-data-node!
[]
(c/exec (str install-dir "/sbin/hadoop-daemon.sh") :--config hadoop-conf-dir :--script :hdfs :stop :datanode))

(defn start-resource-manager!
[test node]
(when (= node (resource-manager (:nodes test)))
(info "Start ResourceManager")
(c/exec (str install-dir "/sbin/yarn-daemon.sh") :--config hadoop-conf-dir :start :resourcemanager)))

(defn stop-resource-manager!
[]
(c/exec (str install-dir "/sbin/yarn-daemon.sh") :--config hadoop-conf-dir :stop :resourcemanager))

(defn start-node-manager!
[test node]
(when (some #{node} (data-nodes (:nodes test)))
(info "Start NodeManager")
(c/exec (str install-dir "/sbin/yarn-daemon.sh") :--config hadoop-conf-dir :start :nodemanager)))

(defn stop-node-manager!
[]
(c/exec (str install-dir "/sbin/yarn-daemon.sh") :--config hadoop-conf-dir :stop :nodemanager))

(defn stop-all!
[]
(stop-name-node!)
(stop-data-node!)
(stop-resource-manager!)
(stop-node-manager!))

(defn db
[url]
(reify db/DB
Expand All @@ -143,7 +162,7 @@
(teardown! [_ _ _]
(info "Teardown Hadoop")
(c/su
(cu/grepkill! "hadoop")
(stop-all!)
(c/exec :rm :-rf install-dir)))

db/LogFiles
Expand Down

0 comments on commit cc3c2d6

Please sign in to comment.