简体   繁体   English

如何在Google App Engine中停止Jetty Web服务器

[英]How to stop Jetty webserver in Google App Engine

If you are doing local development I want to know how we can stop/kill Jetty webserver? 如果您正在进行本地开发,我想知道我们如何停止/杀死Jetty Web服务器? I have to close my Eclipse IDE whenever I need to do that. 每当需要这样做时,我都必须关闭我的Eclipse IDE。 Is there any other way to do it? 还有其他方法吗? Or we have to kill the process? 还是我们必须终止进程?

Thanks. 谢谢。

You should see Jetty instance(s) running in one of the Console . 您应该看到在其中一个Console运行的Jetty实例。 Just press the Red Button . 只需按红色按钮

Jetty can be stopped in the following ways: 可以通过以下方式停止码头:

  • You can click the "red" button in the Eclipse console window 您可以在Eclipse控制台窗口中单击“红色”按钮
  • You can type "q" then hit enter in the console window (or "r" for restart) (This may only work for Run Jetty Run) 您可以键入“ q”,然后在控制台窗口中按Enter键(或单击“ r”重新启动)(这仅适用于Run Jetty Run)

If both of those fail, then if you're on linux or osx, you can open a terminal window and type the following to find the process id of Jetty and kill it. 如果这两个都失败了,那么如果您使用的是linux或osx,则可以打开终端窗口,然后键入以下内容以找到Jetty的进程ID并将其杀死。 The process id is the 2nd column shown in the results, and you'll need to be careful that you're not seeing some other process here as well: 进程ID是结果中显示的第二列,您需要注意不要在此处看到其他进程:

ps aux | grep jetty | grep java

then run the following to kill the process 然后运行以下命令杀死进程

kill process_id_from_above_call

You can run the above 2 commands in one shot by doing this: 通过执行以下操作,可以一次性运行以上2条命令:

kill $(ps aux | grep jetty | grep java | awk '{print $2}')

but be sure you're matching Jetty before you do this, as you may kill something you don't want to kill if it doesn't match correctly ;-) Note that if it still isn't killed by the above, you can force it to be killed by doing this: 但在执行此操作之前,请确保您与Jetty相匹配,因为如果不正确匹配,您可能会杀死不想杀掉的东西;-)请注意,如果上面仍然没有杀死它,您可以通过执行以下操作强制将其杀死:

kill -9 $(ps aux | grep jetty | grep java | awk '{print $2}')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM