ColdFusion:重置 JRun 服务器

发布于 2024-09-26 21:51:29 字数 40 浏览 1 评论 0原文

有没有办法从 ColdFusion 页面内重置 JRun 服务器?

Is there a way to reset the JRun server from within a ColdFusion page?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

驱逐舰岛风号 2024-10-03 21:51:29

是的,您可以重新启动任何您想要的服务。只需编写一个批处理文件并使用 cfexecute 运行即可。

<cfexecute name="#filepath#restartjrun.bat"></cfexecute>

在批处理文件中,类似:

net stop "Macromedia JRun CFusion Server"
net start "Macromedia JRun CFusion Server"

正如 Ciaran 提到的,解决性能问题总是比依赖这样的临时修复更好。

Yep, you can restart any service you want. Just write a batch file and run with cfexecute.

<cfexecute name="#filepath#restartjrun.bat"></cfexecute>

In the batch file something like:

net stop "Macromedia JRun CFusion Server"
net start "Macromedia JRun CFusion Server"

As Ciaran mentioned though, it's always best to solve performance problems than rely of temporary fixes like this.

家住魔仙堡 2024-10-03 21:51:29

不,你不能那样做。

但如果可以的话,只是一个建议(我无意在这里听起来居高临下):

如果您由于服务器性能而尝试重新启动,我建议您在尝试实现类似的操作之前解决真正的问题。

  • 检查异常日志
  • 开始使用服务器监控
  • 检查系统资源

查看结果。

我们过去经常需要重新启动 CF 服务器,但通过仔细了解问题并进行后续修复,我们现在很少需要这样做。

我希望这有帮助。

No, you can't do that.

But just a suggestion if I may (and I don't mean to sound condescending here):

If you are trying to do a restart because of server performance I suggest you troubleshoot the real issue before even attempting to implement something like this.

  • Check your exception logs
  • Start using server monitoring
  • Check system resources

See where that leads you.

We used to have to restart our CF servers a lot, but with careful understanding of the problems and subsequent fixing we would very rarely need to do that now.

I hope that helps.

靖瑶 2024-10-03 21:51:29
<cfset myJrunObj = createObject("java", "jrunx.kernel.JRun")>
<cfset myJrunObj.restart(myJrunObj.getServerName())>
<cfset myJrunObj = createObject("java", "jrunx.kernel.JRun")>
<cfset myJrunObj.restart(myJrunObj.getServerName())>
命硬 2024-10-03 21:51:29

出于安全原因,我相信答案是否定的。从安全角度来看,应用程序能够修改其运行的 JVM 是很糟糕的……

I believe the answer is no for security reasons. It would be bad from a security stand point for an application to be able to modify the JVM that it was running in...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文