From 96e62223b407e676754d55c46f234ffe04e0260e Mon Sep 17 00:00:00 2001 From: Gaius Date: Wed, 20 Jul 2022 18:51:52 +0800 Subject: [PATCH] feat: dfdaemon add default healthy config (#1472) Signed-off-by: Gaius --- client/config/constants.go | 1 + client/config/peerhost_darwin.go | 16 ++++++++++++++++ client/config/peerhost_linux.go | 16 ++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/client/config/constants.go b/client/config/constants.go index 7c1eab659..0bbcdacde 100644 --- a/client/config/constants.go +++ b/client/config/constants.go @@ -92,4 +92,5 @@ const ( DefaultPeerStartPort = 65000 DefaultUploadStartPort = 65002 DefaultObjectStorageStartPort = 65004 + DefaultHealthyStartPort = 40901 ) diff --git a/client/config/peerhost_darwin.go b/client/config/peerhost_darwin.go index b881240e2..74d0f4ac7 100644 --- a/client/config/peerhost_darwin.go +++ b/client/config/peerhost_darwin.go @@ -157,6 +157,22 @@ var peerHostConfig = func() *DaemonOption { Multiplex: false, DiskGCThresholdPercent: 95, }, + Health: &HealthOption{ + ListenOption: ListenOption{ + Security: SecurityOption{ + Insecure: true, + TLSVerify: false, + }, + TCPListen: &TCPListenOption{ + Listen: net.IPv4zero.String(), + PortRange: TCPListenPortRange{ + Start: DefaultHealthyStartPort, + End: DefaultEndPort, + }, + }, + }, + Path: "/server/ping", + }, Reload: ReloadOption{ Interval: util.Duration{ Duration: time.Minute, diff --git a/client/config/peerhost_linux.go b/client/config/peerhost_linux.go index 22713e92a..be720f58c 100644 --- a/client/config/peerhost_linux.go +++ b/client/config/peerhost_linux.go @@ -156,6 +156,22 @@ var peerHostConfig = func() *DaemonOption { Multiplex: false, DiskGCThresholdPercent: 95, }, + Health: &HealthOption{ + ListenOption: ListenOption{ + Security: SecurityOption{ + Insecure: true, + TLSVerify: false, + }, + TCPListen: &TCPListenOption{ + Listen: net.IPv4zero.String(), + PortRange: TCPListenPortRange{ + Start: DefaultHealthyStartPort, + End: DefaultEndPort, + }, + }, + }, + Path: "/server/ping", + }, Reload: ReloadOption{ Interval: util.Duration{ Duration: time.Minute,