문서 메뉴

문서 홈애플리케이션 개발MongoDB 매뉴얼

flushRouterConfig

이 페이지의 내용

  • 정의
  • 구문
  • 고려 사항
flushRouterConfig

flushRouterConfig 은(는) 샤드 클러스터의 캐시된 라우팅 테이블을 오래된 것으로 표시하여 라우팅 테이블을 요청하는 다음 작업이 캐시를 새로 고치도록 합니다. 라우팅 테이블 캐시 관리는 일반적으로 클러스터에서 자동으로 처리됩니다.고려 사항 에 표시된 대로 flushRouterConfig특정 인스턴스에서만 명령을 수동으로 실행해야 합니다.

참고

또는 flushRouterConfig movePrimary 명령을 실행한 후에는 더 dropDatabase 이상 를 실행할 필요가 없습니다. 이제 이 두 명령은 실행 시 필요에 따라 샤드 클러스터의 라우팅 테이블을 자동으로 새로 고칩니다.

MongoDB 4 부터 시작.0.6 ( 3.6.11), flushRouterConfig mongosmongod 인스턴스 모두에서 사용할 수 있으며 구문은 다음과 같습니다.

  • 컬렉션 네임스페이스 매개 변수를 전달하면 지정된 컬렉션에 대한 캐시를 플러시합니다.

    db.adminCommand({ flushRouterConfig: "<db.collection>" } )
  • 데이터베이스 네임스페이스 매개변수로 전달될 때 지정된 데이터베이스 및 모든 해당 컬렉션에 대한 캐시를 플러시합니다.

    db.adminCommand({ flushRouterConfig: "<db>" } )
  • 매개 변수 없이 실행되거나 문자열이 아닌 스칼라 값(예: 1):

    db.adminCommand("flushRouterConfig")
    db.adminCommand( { flushRouterConfig: 1 } )

참고

MongoDB 4.0.5 이하( 3.6.10 이하) 에서 flushRouterConfigmongos 인스턴스에서만 사용할 수 있으며 모든 데이터베이스 및 해당 컬렉션의 캐시만 플러시할 수 있습니다.

db.adminCommand("flushRouterConfig")
db.adminCommand( { flushRouterConfig: 1 } )

Generally, a sharded cluster's routing table is automatically refreshed as needed as part of normal operation. However, you should manually issue the flushRouterConfig command before running the db.collection.getShardDistribution() command. This ensures that the command returns the most up-to-date information.

← enableSharding

이 페이지의 내용