热部署上的码头404错误页面 [英] jetty 404 error page on hot deployment

查看:328
本文介绍了热部署上的码头404错误页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在Windows上使用Jetty 9.1.4.

I am currently using Jetty 9.1.4 on Windows.

当我在没有热部署配置的情况下部署war文件时,然后重新启动Jetty服务.在5-10秒的启动过程中,所有与我的Jetty服务器的客户端连接都在等待服务器完成加载.这样客户就可以查看内容了.

When I deploy the war file without hot deployment config, and then restart the Jetty service. During that 5-10 seconds starting process, all client connections to my Jetty server are waiting for the server to finish loading. Then clients will be able to view the contents.

现在,启用热部署配置后,默认的Jetty 404错误页面将在5-10秒的加载间隔内显示.

Now with hot deployment config on, the default Jetty 404 error page shows within that 5-10 second loading interval.

无论如何,我是否可以使热部署具有与完全重新启动相同的行为-客户端连接将等待,而不是看到404错误页面?

Is there anyway I can make the hot deployment has the same behavior as the complete restart - clients connections will wait instead seeing the 404 error page ?

推荐答案

不幸的是,在与IRC #jetty上的Jetty开发人员交谈后,目前看来这不可能.

Unfortunately this does not seem to be possible currently after talking with the Jetty developers on IRC #jetty.

我将尝试使用的一种解决方案是在它们之前有两个具有负载平衡反向代理(例如nginx)的Jetty实例,并撤下一个实例进行部署.

One solution I will try to use are two Jetty instances with a loadbalancing reverse proxy (e.g. nginx) before them and taking one instance down for deployment.

当然,这将立即导致需要处理的新要求(会话持久性/共享).因此,总而言之:在Java世界中要做很多工作,以实现零停机部署.

Of course this will instantly lead to new requirements (session persistence/sharing) which need to be handled. So in conclusion: much work to do in the Java world for zero downtime on deployments.

我将尝试一下,这似乎是一个简单的解决方案 http://rafaelsteil.com/zero-downtime-deploy-script-for-jetty/ Github:

I will try this, seems like a simple enough solution http://rafaelsteil.com/zero-downtime-deploy-script-for-jetty/ Github: https://github.com/rafaelsteil/jetty-zero-downtime-deploy

这篇关于热部署上的码头404错误页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆