Choas Monkey - How to Terminate instances immdiatley after setting up and starting the server

331 views
Skip to first unread message

Srikanth Penukonda

unread,
Aug 20, 2014, 8:14:01 AM8/20/14
to simianar...@googlegroups.com


Hi,
       I have setup the Simian Army and wanted check for termination of instances in AWS immdiatley after starting the Jetty server.
                 
                 Followed the steps below to check for Instance termination but i was not able to see that instance getting terminated.
                      
AWS - US-WEST and one ASG created

                         1. Setup SimianArmy.
                         2. Updated the Chaos properties file with the following
                                    simianarmy.chaos.enabled = true

simianarmy.chaos.leashed = false

simianarmy.chaos.ASG.enabled = true

simianarmy.chaos.ASG.probability = 6.0

simianarmy.chaos.ASG.maxTerminationsPerDay = 100.0

     3. Restart the Jetty server


Can anyone please let me know what other changes need to be made for the instance to be terminated immdiatley.
 
Thanks,
Srikanth

Nir Alfasi

unread,
Aug 20, 2014, 12:45:00 PM8/20/14
to simianar...@googlegroups.com
This question has been answered two threads ago in simianarmy-users group

hope this helps!
Nir



--
You received this message because you are subscribed to the Google Groups "Simian Army Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simianarmy-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Srikanth p

unread,
Aug 20, 2014, 1:27:17 PM8/20/14
to simianar...@googlegroups.com
Hi Nir,
               I followed the steps as per the quickstart guide by updating the required configurations but still was unable to see the inatance getting terminated.
 
              How can we configure the properties such a way that termination happens immdiatley after the start of the server.
 
Thanks,
Srikanth.

Nir Alfasi

unread,
Aug 20, 2014, 7:49:10 PM8/20/14
to simianar...@googlegroups.com
Look at ChaosMonkeyResource.java

You can submit a POST request to:
 /api/v1/chaos

with eventType=CHAOS_TERMINATION

and also provide the parameters: groupTypegroupName and chaosType

in order to create an "on-demand" termination event.

Hope this helps,
Nir





--

Srikanth p

unread,
Aug 21, 2014, 11:58:01 AM8/21/14
to simianar...@googlegroups.com
Thanks for reply Nir.
Can you please let me know what details i need to provide for parameters: groupTypegroupName and chaosType and to locate the file ChaosMonkeyResource.java
Would help if you can share the exact steps to be followed.
 
Once i start the server and access the URL - http://localhost:8080/simianarmy/api/v1/chaos , i get an empty braces [ ]  in response .
 
 
Thanks,
Srikanth.

Nir Alfasi

unread,
Aug 21, 2014, 12:28:07 PM8/21/14
to simianar...@googlegroups.com
groupType is either 'application' or 'cluster'
groupName is the name of the application/cluster
chaosType you probably want 'ShutdownInstance'  (you can see all the types in BasicChaosMonkey.java)

The reason that you're getting `[]` when you browse the resource http://localhost:8080/simianarmy/api/v1/chaos is that your browser sends a GET request and you should send a POST request. You can use a tool like FF poster to do that.

Good luck!
Nir

Srikanth p

unread,
Aug 21, 2014, 1:53:14 PM8/21/14
to simianar...@googlegroups.com
Hi Nir,
        When do a POST , i get the following response. Can you please help me to figure out.
        Also, please let me know where i can locate the file BasicChaosMonkey.java
 
 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 500 No content to map to Object due to end of input</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /simianarmy/api/v1/chaos. Reason:
<pre>    No content to map to Object due to end of input</pre></p><h3>Caused by:</h3><pre>java.io.EOFException: No content to map to Object due to end of input
 at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2766)
 at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2709)
 at org.codehaus.jackson.map.ObjectMapper.readTree(ObjectMapper.java:1533)
 at com.netflix.simianarmy.resources.chaos.ChaosMonkeyResource.addEvent(ChaosMonkeyResource.java:166)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
 at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
 at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
 at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
 at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
 at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
 at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
 at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
 at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
 at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
 at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
 at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
 at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
 at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:708)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
 at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
 at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
 at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
 at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
 at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
 at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
 at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
 at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
 at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
 at org.mortbay.jetty.Server.handle(Server.java:326)
 at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
 at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:926)
 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
 at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
 at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
 at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
 at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
</pre>
<hr /><i><small>Powered by Jetty://</small></i><br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
<br/>                                               
</body>
</html>

Nir Alfasi

unread,
Aug 21, 2014, 2:32:51 PM8/21/14
to simianar...@googlegroups.com
It looks like the parameters were not send in the POST request.
As to finding a class in the project - any good IDE will help you with that.
In order to move forward from here you'll have to debug - I can't help you with that, sorry.

Good luck!
Nir


Zhenxiao Hao

unread,
Dec 21, 2014, 9:16:10 PM12/21/14
to simianar...@googlegroups.com
Hi,
Why I always got group type not found? I tried group types with 'application', 'cluster' and 'ASG', none of them worked. 
And in the aws console I didn't see any parameter which specifies the group type.
Thank you in advance.

Nir Alfasi

unread,
Dec 22, 2014, 1:12:33 AM12/22/14
to simianar...@googlegroups.com
Hi Zhenxiao,

When you write:
"I tried group types with 'application', 'cluster' and 'ASG', none of them worked."
you don't provide enough information - which makes it impossible to help you.

"I tried" - where ? how ? config file ? which one ? what exactly did you configure ? what was the key and what was the value ?
"none of them worked." - how did you call it ? did it run ? crash on startup ? returned an error or an unexpected (but valid) response ? which error ? did you get a stacktrace ?

Regards,
Nir


Zhenxiao Hao

unread,
Dec 22, 2014, 9:06:52 AM12/22/14
to simianar...@googlegroups.com
Hi, 
Thank you for reading my question, the previous problem has been solved. Now when I run curl http://localhost:8080/simianarmy/api/v1/chaos, I got four events, then I used poster to post a new event which is different from all the previous four events,
I got 200OK response of the posts, when I run curl again, I expect my new post appear in the json I got, but it was the same as before I send the new post. I have enabled terminateOndemand, is my understanding correct? Under which situation will I see the
new event I just posted?
Best regards.

Nir Alfasi

unread,
Dec 23, 2014, 4:48:23 PM12/23/14
to simianar...@googlegroups.com

Which data storage are you using? SDB? When you post the new event can you see the new record gettong updated in the persistant storage?

Zhenxiao Hao

unread,
Dec 24, 2014, 12:30:33 PM12/24/14
to simianar...@googlegroups.com
Hi,
Where can I view the SDB records? I have done the Setup SimpleDB Table step in the quick start guide, but I didn't see any databases in the AWS console, and
in the SimpleDB console, I was only able to create new database but didn't see any exsiting databases.
Best regards.

Zhenxiao Hao

unread,
Dec 24, 2014, 12:49:59 PM12/24/14
to simianar...@googlegroups.com
By the way, what I meant by the SimpleDB console is the RSD dashboard, I created a postgresql database there.


On Tuesday, December 23, 2014 10:48:23 PM UTC+1, Nir Alfasi wrote:

Mirtneh Mengesha

unread,
Oct 13, 2015, 7:27:54 PM10/13/15
to Simian Army Users
Remove the brackets from the post payload if you are using tools like postman or Advanced Rest Client
{"monkeyType":"CHAOS","eventType":"CHAOS_TERMINATION","eventTime":1343344105651,"region":"us-west-2","groupType":"ASG","groupName":"monkey-target"}
Reply all
Reply to author
Forward
0 new messages