nodetool rebuild_index — 보조 인덱스 전체 재구축

nodetool rebuild_index — 보조 인덱스 전체 재구축

rebuild_index 명령은 주어진 테이블의 네이티브 보조 인덱스(secondary index)를 전체 재구축하는 nodetool 명령이에요. 인덱스가 손상되었거나 다시 만들어야 할 때 씁니다.

출처: nodetool rebuild_index

본문

이 명령은 지정한 테이블의 네이티브 2차 인덱스(sasi 등)를 전체 재구축해요. 키스페이스와 테이블, 그리고 재구축할 인덱스 이름 목록을 지정해야 해요.

원문의 사용법은 다음과 같습니다.

NAME
        nodetool rebuild_index - A full rebuild of native secondary indexes for
        a given table
SYNOPSIS
        nodetool [(-h <host> | --host <host>)] [(-p <port> | --port <port>)]
                [(-pp | --print-port)] [(-pw <password> | --password <password>)]
                [(-pwf <passwordFilePath> | --password-file <passwordFilePath>)]
                [(-u <username> | --username <username>)] rebuild_index [--] <keyspace>
                <table> <indexName...>
OPTIONS
        -h <host>, --host <host>
            Node hostname or ip address
        -p <port>, --port <port>
            Remote jmx agent port number
        -pp, --print-port
            Operate in 4.0 mode with hosts disambiguated by port number
        -pw <password>, --password <password>
            Remote jmx agent password
        -pwf <passwordFilePath>, --password-file <passwordFilePath>
            Path to the JMX password file
        -u <username>, --username <username>
            Remote jmx agent username
        --
            This option can be used to separate command-line options from the
            list of argument, (useful when arguments might be mistaken for
            command-line options
        <keyspace> <table> <indexName...>
            The keyspace and table name followed by a list of index names

옵션과 인자를 하나씩 살펴볼게요.

  • -h <host>, --host <host> — 대상 노드의 호스트명 또는 IP 주소를 지정해요.
  • -p <port>, --port <port> — 원격 JMX 에이전트 포트 번호를 지정해요.
  • -pp, --print-port — 호스트를 포트 번호로 구분하는 4.0 모드로 동작해요.
  • -pw <password>, --password <password> — 원격 JMX 에이전트 비밀번호를 지정해요.
  • -pwf <passwordFilePath>, --password-file <passwordFilePath> — JMX 비밀번호 파일의 경로를 지정해요.
  • -u <username>, --username <username> — 원격 JMX 에이전트 사용자 이름을 지정해요.
  • -- — 명령줄 옵션과 인자 목록을 구분할 때 써요.
  • <keyspace> <table> <indexName...> — 키스페이스와 테이블 이름, 그리고 인덱스 이름 목록을 지정해요.

더 알아보기