[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
DSO-enabled processes termination (Terracotta Maven plugin)  XML
Forum Index -> Terracotta Platform
Author Message
kishanov

journeyman

Joined: 05/26/2008 00:22:04
Messages: 15
Offline

Hi there,

I'm launching DSO-enabled processes using <processes> attribute and the following command:

Code:
mvn -DactiveNodes=<nodeName> tc:run-integration


Is it possible to terminate a particular node using some maven goal? (tc:terminate doesn't stop DSO processes)
amiller

ophanim

Joined: 08/29/2007 09:05:48
Messages: 722
Location: St. Louis, MO
Offline

You can see all the tc-maven-plugin goals at http://forge.terracotta.org/releases/projects/tc-maven-plugin/ - I don't believe any of the existing goals does what you want though. tc:stop will stop the Terracotta server, tc:terminate will stop web server processes started with tc:run and tc:terminate-integration is like tc:terminate + tc:stop. I think tc:terminate is close to what you want but I believe it stops all processes.

If you'd like, you can file a JIRA to add this functionality at http://jira.terracotta.org .

Alex Miller (Terracotta Engineer) - Want to post to the forums? Sign up here
[WWW]
ekulesho

master

Joined: 12/04/2006 08:49:08
Messages: 57
Offline

You can only terminate web application servers launched with cargo. Java processes started from a main class can't be terminated this way.

regards,
Eugene
[WWW]
kishanov

journeyman

Joined: 05/26/2008 00:22:04
Messages: 15
Offline

Thanks, Eugene,

Do you plan to add this functionality in the future releases of plugin?
tgautier

seraphim

Joined: 06/05/2006 12:19:26
Messages: 1781
Offline

I don't think we had any plans for this - if you'd like to see it please add a JIRA.

Thanks.
[WWW]
ekulesho

master

Joined: 12/04/2006 08:49:08
Messages: 57
Offline

kishanov wrote:
Do you plan to add this functionality in the future releases of plugin? 
It would require some kind of listener (e.g. on specific port or better on tcp broadcast) and use wrapper around your Java process that would terminate it on a command from the listener. As Taylor already suggested you can submit request for that in JIRA, or you can implement such wrapper yourself and use it to start your applications or even contribute it back to Terracotta Maven plugin. ;-)

regards,
Eugene
[WWW]
ddaniels

master

Joined: 11/13/2008 14:08:44
Messages: 52
Location: Austin, TX
Offline

I'm running into a similar issue where i have a bunch of custom java servers running as nodes and i want to be able to start/stop/restart them as easily as you could with a cluster of web servers that uses Cargo to manage them in the TC maven plugin.

i want to run

Code:
 mvn tc:run -DactiveNodes=myNode0 
 mvn tc:run -DactiveNodes=myNode1 
 ...
 mvn tc:run -DactiveNodes=myNodeN
 [/code
 
 Then to stop them
 [code]
 mvn tc:terminate -DactiveNodes=myNode0 
 mvn tc:terminate -DactiveNodes=myNode1
 ...
 mvn tc:terminate -DactiveNodes=myNodeN  
 



Before integrating with Terracotta I leveraged the TCP STOP.PORT/STOP.KEY idea from the Jetty server (http://www.mortbay.org/jetty/jetty-7/xref/org/mortbay/start/Monitor.html), where the Java process would listen to the specified -DSTOP.PORT=X only bound to the "127.0.0.1" loopback address for security, and then if you call the class with a stop parameter it would connect to localhost and send the -DSTOP.KEY.

e.g.

Starting:
Code:
 java -DSTOP.PORT=8961 -DSTOP.KEY=someKey com.stuff.MyServer start
 


Stopping:
Code:
 java -DSTOP.PORT=8961 -DSTOP.KEY=someKey com.stuff.MyServer stop
 


This works fine for a single node, but managing STOP.PORT numbers for a cluster would be a pain, it'd be better if we could leverage Terracotta's ClusterInfo

How does the Cargo/Web Container hook into tc:terminate and is there a way to provide something like a ClusterListener event listener interface that would allow custom Java applications to listen for termination notification?

The tim-jmx project already supports a bunch of connectivity cluster/node notifications maybe it could support more management type notifications like THIS_NODE_REQUEST_STOP. My question is, what would it take for the DSO server to support receiving that event and routing it to the appropriate node (based on nodeId String). Is there a security concern that this would be totally hacking through the intent of the Terracotta architecture?
 
Forum Index -> Terracotta Platform
Go to:   
Powered by JForum 2.1.7 © JForum Team