Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Shutdown Gigaspaces Properly

Hi,

May I know is there any command in gs.sh or any admin script to shutdown gsc / gsm properly, instead of using kill command? I am using it in Unix environment.

Thanks!

Best Regards, Guang Sheng

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3190]{quote}

asked 2009-07-28 03:10:16 -0500

deepblueli gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
0

Guang,
You can use the kill -9 to do that.
If you start the GSC/GSM via the GSA (XAP 7.0) you can use the GS-UI to terminate the GSC/GSM.
We will introduce relevant CLI in future releases to terminate GSC/GSM.

Shay

answered 2009-07-28 05:05:43 -0500

shay hassidim gravatar image
edit flag offensive delete link more
0
  1. If you want you can write a small utility which finds the container and calls shutdown. which u can run remotely as well. space.getContainer().shudown()

  2. If you are looking for proper clean up before spaces go down you can use Runtime.getRuntime().addShutdownHook

http://www.java2s.com/Code/JavaAPI/ja...

Write a worker and on init method register for shutdownhook and on shutdown you should be getting a call back. After all you clean up you can call space.getContainer().Shutdown();

  1. If are not using any multi threaded structure You can use gigaspaces shutdown hook. Here is the example http://www.gigaspaces.com/wiki/displa...

Thanks Venkat

answered 2009-07-28 09:56:18 -0500

venkatg gravatar image
edit flag offensive delete link more
0

If using scripts to start and stop GigaSpaces processes then pkill -9 -P $pkill_id

may work for you, too. Supposedly -9 allows the process to terminate "gracefully".

In very rare occasions, though, the process may not stop. So after the pkill command the shutdown script we have sleeps for few seconds and then checks if the process is still listening on the JMX port that we affix at startup. Maybe not the best solution but seems to work for us.

HTH -- Vanio

answered 2009-08-06 12:55:21 -0500

vanio gravatar image
edit flag offensive delete link more

Comments

shay hassidim gravatar imageshay hassidim ( 2009-08-06 13:43:55 -0500 )edit

Hi,

Thanks for all the responses. I guess I have to use kill. "kill -9" I think doesn't gracefully shutdown the process, using just "kill" will gracefully shutdown (but may not able to terminate the process).

In Gigaspaces 6.5, gs.sh got a "destroy" command to shutdown the space. but it is taken out in Gigaspace 7

deepblueli gravatar imagedeepblueli ( 2009-08-17 20:30:19 -0500 )edit

Correct, kill -9 (SIGKILL) does not allow the process to shutdown gracefully. I use kill -15 (SIGTERM) to stop my GigaSpaces processes and that works fine.

Regards,

Johan Stuyts

jstuyts gravatar imagejstuyts ( 2009-08-19 02:49:44 -0500 )edit

My bad. -9 is the "last resort" if -15 didn't work.

-- Vanio

vanio gravatar imagevanio ( 2009-08-23 08:00:18 -0500 )edit

Hi,

I'm running Gigaspaces inside JBoss and I've tried using the shutdown hook thread method to clean up, but I still find GS has shutdown before I can clean up.

dncheu gravatar imagedncheu ( 2009-08-25 07:53:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2009-07-28 03:10:16 -0500

Seen: 388 times

Last updated: Aug 06 '09