Docs Menu

Configure Self-Managed Sharded Cluster Health with Health Managers

This document describes how to use Health Managers to monitor and manage sharded cluster health issues.

a Health Manager runs health checks on a 상태 관리자 패싯 at a specified intensity level. Health Manager checks run at specified time intervals. A Health Manager can be configured to move a failing mongos out of a cluster automatically. Progress Monitor ensures that Health Manager checks do not become stuck or unresponsive.

The following table shows the available Health Manager facets:

패싯
상태 관리자가 확인하는 사항

configServer

config 서버에 대한 연결과 관련된 클러스터 상태 문제.

dns

DNS 가용성 및 기능과 관련된 클러스터 상태 문제.

ldap

LDAP 가용성 및 기능과 관련된 클러스터 상태 문제.

The following table shows the available Health Manager intensity levels:

강도 수준
설명

critical

이 패싯의 상태 관리자는 활성화되어 있으며 오류가 발생하면 실패한 mongos를 클러스터 밖으로 옮길 수 있습니다. 상태 관리자는 activeFaultDurationSecs(으)로 지정된 시간 동안 기다렸다가 mongos를 자동으로 중지하고 클러스터 밖으로 이동합니다.

non-critical

이 패싯의 상태 관리자가 활성화되어 있고 오류를 기록하지만 오류가 발생하면 mongos 클러스터에 남아 있습니다.

off

이 패싯의 상태 관리자는 비활성화되어 있습니다. mongos는 이 패싯에 대해 상태 확인을 수행하지 않습니다. 이것이 기본 강도 수준입니다.

When a failure is detected and the Health Manager intensity level is set to critical, the Health Manager waits the amount of time specified by activeFaultDurationSecs before stopping and moving the mongos out of the cluster automatically.

Progress Monitor runs tests to ensure that Health Manager checks do not become stuck or unresponsive. Progress Monitor runs these tests in intervals specified by interval. If a health check begins but does not complete within the timeout given by deadline, Progress Monitor stops the mongos and removes it from the cluster.

필드
설명
단위

interval

상태 관리자가 정체되거나 응답하지 않는지 확인하는 빈도입니다.

밀리초

deadline

mongos가 상태 관리자 검사를 통과하지 못할 경우 자동으로 실패하기 전의 타임아웃을 설정합니다.

The following examples show how Health Managers can be configured. For information on Health Manager parameters, see 상태 관리자 매개변수.

예를 들어 dns Health Manager 패싯을 critical 강도 수준으로 설정하려면 시작 시 다음을 실행하십시오.

mongos --setParameter 'healthMonitoringIntensities={ values:[ { type:"dns", intensity: "critical"} ] }'

또는 실행 중인 mongos에 연결된 mongosh 세션에서 setParameter 명령을 사용하는 경우입니다.

db.adminCommand(
{
setParameter: 1,
healthMonitoringIntensities: { values: [ { type: "dns", intensity: "critical" } ] } } )
}
)

setParameter 로 설정된 파라미터는 재시작 시에도 유지되지 않습니다. 자세한 내용은 SetParameter 페이지를 참조하십시오.

이 설정을 영구적으로 healthMonitoringIntensities 유지하려면 setParameter 다음 예시에서와 같이 옵션을 사용하여 mongos 구성 파일에서 을 설정합니다.

setParameter:
healthMonitoringIntensities: "{ values:[ { type:\"dns\", intensity: \"critical\"} ] }"

healthMonitoringIntensitiesvalues 문서 배열을 받아들입니다. values의 각 문서에는 두 개의 필드가 있습니다.

  • type, 상태 관리자 패싯

  • intensity, 강도 수준

See healthMonitoringIntensities for details.

예를 들어, 30초마다 상태 확인을 실행하도록 ldap Health Manager 패싯을 설정하려면 시작 시 다음을 실행하십시오.

mongos --setParameter 'healthMonitoringIntervals={ values:[ { type:"ldap", interval: "30000"} ] }'

또는 실행 중인 mongos에 연결된 mongosh 세션에서 setParameter 명령을 사용하는 경우입니다.

db.adminCommand(
{
setParameter: 1,
healthMonitoringIntervals: { values: [ { type: "ldap", interval: "30000" } ] } } )
}
)

setParameter 로 설정된 파라미터는 재시작 시에도 유지되지 않습니다. 자세한 내용은 SetParameter 페이지를 참조하십시오.

이 설정을 영구적으로 healthMonitoringIntervals 유지하려면 setParameter 다음 예시에서와 같이 옵션을 사용하여 mongos 구성 파일에서 을 설정합니다.

setParameter:
healthMonitoringIntervals: "{ values: [{type: \"ldap\", interval: 200}] }"

healthMonitoringIntervalsvalues 문서 배열을 받아들입니다. values의 각 문서에는 두 개의 필드가 있습니다.

  • type, 상태 관리자 패싯

  • interval, 실행되는 시간 간격(밀리초)

See healthMonitoringIntervals for details.

예를 들어, 실패부터 충돌까지의 기간을 5분으로 설정하려면 시작 시 다음을 실행하십시오.

mongos --setParameter activeFaultDurationSecs=300

또는 실행 중인 mongos에 연결된 mongosh 세션에서 setParameter 명령을 사용하는 경우입니다.

db.adminCommand(
{
setParameter: 1,
activeFaultDurationSecs: 300
}
)

setParameter 로 설정된 파라미터는 재시작 시에도 유지되지 않습니다. 자세한 내용은 SetParameter 페이지를 참조하십시오.

이 설정을 영구적으로 activeFaultDurationSecs 유지하려면 setParameter 다음 예시에서와 같이 옵션을 사용하여 mongos 구성 파일에서 을 설정합니다.

setParameter:
activeFaultDurationSecs: 300

See activeFaultDurationSecs for details.

Progress Monitor runs tests to ensure that Health Manager checks do not become stuck or unresponsive. Progress Monitor runs these tests in intervals specified by interval. If a health check begins but does not complete within the timeout given by deadline, Progress Monitor stops the mongos and removes it from the cluster.

interval 시간을 1000밀리초로 설정하고 deadline 를 300초로 설정하려면 시작 시 다음을 실행하십시오.

mongos --setParameter 'progressMonitor={"interval": 1000, "deadline": 300}'

또는 실행 중인 mongos에 연결된 mongosh 세션에서 setParameter 명령을 사용하는 경우입니다.

db.adminCommand(
{
setParameter: 1,
progressMonitor: { interval: 1000, deadline: 300 } )
}
)

setParameter 로 설정된 파라미터는 재시작 시에도 유지되지 않습니다. 자세한 내용은 SetParameter 페이지를 참조하십시오.

이 설정을 영구적으로 progressMonitor 유지하려면 setParameter 다음 예시에서와 같이 옵션을 사용하여 mongos 구성 파일에서 을 설정합니다.

setParameter:
progressMonitor: "{ interval: 1000, deadline: 300 }"

See progressMonitor for details.