diff --git a/pkg/cluster/manager/check.go b/pkg/cluster/manager/check.go index b6452d4333..f8aa399625 100644 --- a/pkg/cluster/manager/check.go +++ b/pkg/cluster/manager/check.go @@ -632,6 +632,15 @@ func fixFailedChecks(host string, res *operator.CheckResult, t *task.Builder) (s "", true) msg = fmt.Sprintf("will try to %s, please check again after reboot", color.HiBlueString("disable THP")) + case operator.CheckNameSwap: + // not applying swappiness setting here, it should be fixed + // in the sysctl check + // t.Sysctl(host, "vm.swappiness", "0") + t.Shell(host, + "swapoff -a || exit 0", // ignore failure + "", true, + ) + msg = "will try to disable swap, please also check /etc/fstab manually" default: msg = fmt.Sprintf("%s, auto fixing not supported", res) } diff --git a/pkg/cluster/operation/check.go b/pkg/cluster/operation/check.go index 25b0881d4d..08e6a0c3df 100644 --- a/pkg/cluster/operation/check.go +++ b/pkg/cluster/operation/check.go @@ -297,6 +297,7 @@ func checkMem(opt *CheckOptions, memInfo *sysinfo.Memory) []*CheckResult { if memInfo.Swap > 0 { results = append(results, &CheckResult{ Name: CheckNameSwap, + Warn: true, Err: fmt.Errorf("swap is enabled, please disable it for best performance"), }) }