-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graceful restart can not achieve zero-down #66
Comments
You must use the overseer.State.Listener to receive zero-down time restarts
…On 29 Dec 2020 at 7:38:08 pm, Dev-Jabin ***@***.***> wrote:
My project is built on the *Beego*, Now I want to graceful restart my
project with Overseer. When I send *kill -SIGUSR2 PID*. I found that the
current process was closed first, and then fork a new process. This will
lead to a period of no work process in the middle, resulting in service
denial of access. Unable to achieve zero-down
My project code
`
func main() {
overseer.Run(overseer.Config{
Program: prog,
Debug: true,
})
}
func prog(state overseer.State) {
beego.BConfig.RecoverPanic = true
beego.BConfig.Listen.Graceful = false
beego.Run()
}
`
Overseer log
`
2020/12/29 16:36:31 [overseer master] graceful restart triggered
2020/12/29 16:36:31 [overseer master] restart success
2020/12/29 16:36:31 [overseer slave#2] graceful shutdown requested
2020/12/29 16:36:31 [overseer slave#2] timeout. forceful shutdown
2020/12/29 16:36:31 [overseer master] prog exited with 1
2020/12/29 16:36:31 [overseer master] starting /Users/Demo
2020/12/29 16:36:34 [overseer slave#3] run
2020/12/29 16:36:34 [overseer slave#3] start program
`
Looking forward to your reply, Thank you!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#66>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE2X4ZB2EUPQZTQGTAO73TSXGIPBANCNFSM4VM6U4WQ>
.
|
Thanks for your replay. main code
Ps: 8020 is my project listen port prog code
But I have another problem, How can I use my previous routers. e.g. beego.Router("/soccer/biz/ping", &soccer_biz.IndexController{}, "Get:GetPong") Now I curl http://127.0.0.1:8020/soccer/biz/ping return 404. How to solve this problem? Thank you! |
http.Serve(state.Listener, nil)
Will run the global HTTP server (nil router), provide your router in the
place of nil
…On 29 Dec 2020 at 10:00:22 pm, Dev-Jabin ***@***.***> wrote:
You must use the overseer.State.Listener to receive zero-down time restarts
… <#>
On 29 Dec 2020 at 7:38:08 pm, Dev-Jabin *@*.***> wrote: My project is
built on the *Beego*, Now I want to graceful restart my project with
Overseer. When I send *kill -SIGUSR2 PID*. I found that the current
process was closed first, and then fork a new process. This will lead to a
period of no work process in the middle, resulting in service denial of
access. Unable to achieve zero-down My project code func main() {
overseer.Run(overseer.Config{ Program: prog, Debug: true, }) } func
prog(state overseer.State) { beego.BConfig.RecoverPanic = true
beego.BConfig.Listen.Graceful = false beego.Run() } Overseer log 2020/12/29
16:36:31 [overseer master] graceful restart triggered 2020/12/29 16:36:31
[overseer master] restart success 2020/12/29 16:36:31 [overseer slave#2]
graceful shutdown requested 2020/12/29 16:36:31 [overseer slave#2] timeout.
forceful shutdown 2020/12/29 16:36:31 [overseer master] prog exited with 1
2020/12/29 16:36:31 [overseer master] starting /Users/Demo 2020/12/29
16:36:34 [overseer slave#3] run 2020/12/29 16:36:34 [overseer slave#3]
start program Looking forward to your reply, Thank you! — You are
receiving this because you are subscribed to this thread. Reply to this
email directly, view it on GitHub <#66
<#66>>, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAE2X4ZB2EUPQZTQGTAO73TSXGIPBANCNFSM4VM6U4WQ
.
Thanks for your replay.
Now I update my project code as follows
main code
func main() {
overseer.Run(overseer.Config{
Program: prog,
Address: ":8020",
Debug: true, //display log of overseer actions
})
}
*Ps: 8020 is my project listen port*
prog code
func prog(state overseer.State) {
http.Serve(state.Listener, nil)
beego.BConfig.RecoverPanic = true
beego.BConfig.Listen.Graceful = false
beego.Run()
}
But I have another problem, How can I use my previous routers. e.g.
*beego.Router("/soccer/biz/ping", &soccer_biz.IndexController{},
"Get:GetPong")*
Now I *curl http://127.0.0.1:8020/soccer/biz/ping
<http://127.0.0.1:8020/soccer/biz/ping>* return *404*.
How to solve this problem? Thank you!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE2X45RMV2P7IJS4XAAJ6TSXGZENANCNFSM4VM6U4WQ>
.
|
My project is built on the Beego, Now I want to graceful restart my project with Overseer. When I send kill -SIGUSR2 PID. I found that the current process was closed first, and then fork a new process. This will lead to a period of no work process in the middle, resulting in service denial of access. Unable to achieve zero-down
My project code
func main() {
overseer.Run(overseer.Config{
Program: prog,
Debug: true,
})
}
func prog(state overseer.State) {
beego.BConfig.RecoverPanic = true
beego.BConfig.Listen.Graceful = false
beego.Run()
}
Overseer log
2020/12/29 16:36:31 [overseer master] graceful restart triggered
2020/12/29 16:36:31 [overseer master] restart success
2020/12/29 16:36:31 [overseer slave#2] graceful shutdown requested
2020/12/29 16:36:31 [overseer slave#2] timeout. forceful shutdown
2020/12/29 16:36:31 [overseer master] prog exited with 1
2020/12/29 16:36:31 [overseer master] starting /Users/Demo
2020/12/29 16:36:34 [overseer slave#3] run
2020/12/29 16:36:34 [overseer slave#3] start program
Looking forward to your reply, Thank you!
The text was updated successfully, but these errors were encountered: