本文介绍了停止在Kestrel上运行的dotnet核心网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在部署现有.net核心网站的新版本时.如何首先安全停止运行的红k应用程序?

When deploying a new version of an existing .net core website. How do I first safely stop the old running kestrel app?

以下是我想写的内容(伪部署脚本)的一个例子:

Here is an exmaple of what I would like to write (Pseudo deployment script):

dotnet stop mysite/mysite.dll <---- this line here
mv mysite/ mysite.bak/
cp newly-published-mysite/ mysite/
dotnet run mysite/mysite.dll

killall dotnet似乎有点不安全.如果我在一个盒子上托管两个小型站点,那怎么办?

killall dotnet seems a little unsafe. How would it work if I were hosting two small sites on one box?

推荐答案

我已决定使用主管来监视和管理该过程. 这是一篇很棒的文章,介绍了如何进行设置.

I have decided to use supervisor to monitor and manage the process. Here is an excellent article on getting it set up.

它可以像这样简单地控制特定的dotnet应用程序:

It allows simple control over specific dotnet apps like this:

supervisorctl stop MyWebsiteName
supervisorctl start MyWebsiteName

它具有一个巨大的优势,因为它可以崩溃或尝试重启,无论出于何种原因,都可以尝试重新启动该进程.

And it has one huge advantage in that it can try restart the process if it falls over, or when the system reboots... for whatever reason.

这篇关于停止在Kestrel上运行的dotnet核心网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 08:26