Hi Werner -

Even if the cluster state is not recorded you can still terminate the
cluster - Whirr will remove all the nodes from the group based on the info
from the ClusterSpec.

See: ClusterController.destroyCluster:
https://github.com/apache/whirr/blob/trunk/core/src/main/java/org/apache/whirr/ClusterController.java#L223

Regards,

-- Andrei Savu / axemblr.com


On Mon, Jun 3, 2013 at 12:56 PM, Werner Buck <[email protected]> wrote:

> Hi,
>
> I am currently using the internal Java Whirr API and it is going well. My
> only concern though is that if the program exist or crashes for some reason
> during BootstrapClusterAction, orphaned instance(s) are launched without
> there being a way to remove them.
> This is because the ClusterStateStore is only activated after "Nodes
> started" which can be seen in the following log:
>
> 10:37:17.058 [ForkJoinPool-1-worker-1] INFO
>  o.a.w.actions.BootstrapClusterAction - Bootstrapping cluster
> 10:37:50.283 [pool-4-thread-2] INFO  org.apache.whirr.compute.NodeStarter
> - Starting 1 node(s) with roles [noop]
> 10:39:19.196 [pool-4-thread-2] INFO  org.apache.whirr.compute.NodeStarter
> - Nodes started: [{id=us-east-1/i-810698e3, providerId=i-810698e3,
> name=whirrtest-1-810698e3, ......]
> 10:39:19.200 [ForkJoinPool-1-worker-1] WARN
>  o.a.w.state.ClusterStateStoreFactory - No cluster state is going to be
> persisted. There is no easy way to retrieve instance roles after launch.
>
> Note that i purposely activated no cluster state to get the warning.
>
> So is there a way to fetch nodes and destroy them based only on the
> ClusterSpec?
> This way I can save my ClusterSpec before launching, and when an error or
> crash occurs, I can call a method like: nukeCluster(clusterSpec). It would
> look for instances matching the CloudSpec (maybe introduce some unique
> identifier), and destroy the instances.
>
> With kind regards,
>
> Werner
>
>

Reply via email to