Permalink
Browse files

add upgrade method for upgrading clusters that are built from source

  • Loading branch information...
1 parent 3522136 commit 22c12a1015ab8d7a529475cd5b580ac2882ecd2d @nathanmarz committed Jun 6, 2012
Showing with 20 additions and 0 deletions.
  1. +1 −0 conf/storm.yaml
  2. +19 −0 src/clj/backtype/storm/provision.clj
View
@@ -0,0 +1 @@
+storm.local.dir: "/mnt/storm"
@@ -85,6 +85,23 @@
(start-with-nodes! aws name (node/nimbus-server-spec name release) (node/supervisor-server-spec name release) (node/zookeeper-server-spec))
)
+(defn upgrade-with-nodes! [aws name nimbus supervisor zookeeper]
+ (let [nimbus (node/nimbus* name nimbus)
+ supervisor (node/supervisor* name supervisor)
+ zookeeper (node/zookeeper name zookeeper)]
+; (authorize-group aws (my-region) (jclouds-group "nimbus-" name) (jclouds-group "supervisor-" name))
+; (authorize-group aws (my-region) (jclouds-group "supervisor-" name) (jclouds-group "nimbus-" name))
+
+; (lift zookeeper :compute aws :phase [:configure])
+; (lift nimbus :compute aws :phase [:configure :post-configure :exec])
+ (lift supervisor :compute aws :phase [:configure :post-configure :exec])
+ (println "Upgrade Complete.")))
+
+
+(defn upgrade! [aws name release]
+ (println "Upgrading cluster with release" release)
+ (upgrade-with-nodes! aws name (node/nimbus-server-spec name release) (node/supervisor-server-spec name release) (node/zookeeper-server-spec))
+ )
(defn stop! [aws name]
(println "Shutting Down nodes...")
@@ -109,13 +126,15 @@
[[start? "Start Cluster?"]
[stop? "Shutdown Cluster?"]
[attach? "Attach to Cluster?"]
+ [upgrade? "Upgrade existing cluster"]
[ips? "Print Cluster IP Addresses?"]
[name "Cluster name" "dev"]
[release "Release version" nil]]
(cond
stop? (stop! aws name)
start? (start! aws name release)
+ upgrade? (upgrade! aws name release)
attach? (attach! aws name)
ips? (print-all-ips! aws name)
:else (println "Must pass --start or --stop or --attach"))))))

0 comments on commit 22c12a1

Please sign in to comment.