nodetool rebuild — 데이터 재구축

nodetool rebuild — 데이터 재구축

rebuild 명령은 다른 노드에서 데이터를 스트리밍 받아 재구축하는 nodetool 명령이에요. 부트스트랩과 유사하게 동작하며, 데이터센터 추가나 노드 복구 시 씁니다.

출처: nodetool rebuild

본문

이 명령은 지정한 소스 데이터센터(DC)에서 데이터를 스트리밍 받아 현재 노드의 데이터를 재구축해요. -ks로 특정 키스페이스만, -ts로 특정 토큰 범위만 재구축할 수 있고, -s로 스트리밍 소스 호스트를 지정할 수 있어요.

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

NAME
        nodetool rebuild - Rebuild data by streaming from other nodes (similarly
        to bootstrap)
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
                [(-ks <specific_keyspace> | --keyspace <specific_keyspace>)]
                [(-s <specific_sources> | --sources <specific_sources>)]
                [(-ts <specific_tokens> | --tokens <specific_tokens>)] [--]
                <src-dc-name>
OPTIONS
        -h <host>, --host <host>
            Node hostname or ip address
        -ks <specific_keyspace>, --keyspace <specific_keyspace>
            Use -ks to rebuild specific keyspace.
        -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
        -s <specific_sources>, --sources <specific_sources>
            Use -s to specify hosts that this node should stream from when -ts
            is used. Multiple hosts should be separated using commas (e.g.
            127.0.0.1,127.0.0.2,...)
        -ts <specific_tokens>, --tokens <specific_tokens>
            Use -ts to rebuild specific token ranges, in the format of "(start_token_1,end_token_1],(start_token_2,end_token_2],...(start_token_n,end_token_n]".
        -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
        <src-dc-name>
            Name of DC from which to select sources for streaming. By default,
            pick any DC

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

  • -ks <specific_keyspace>, --keyspace <specific_keyspace> — 특정 키스페이스만 재구축할 때 써요.
  • -s <specific_sources>, --sources <specific_sources>-ts를 사용할 때 이 노드가 스트리밍을 받을 소스 호스트를 지정해요. 여러 호스트는 콤마로 구분해요 (예: 127.0.0.1,127.0.0.2,...).
  • -ts <specific_tokens>, --tokens <specific_tokens> — 특정 토큰 범위만 재구축할 때 써요. 형식은 "(start_token_1,end_token_1],(start_token_2,end_token_2],...(start_token_n,end_token_n]"이에요.
  • -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 에이전트 사용자 이름을 지정해요.
  • -- — 명령줄 옵션과 인자 목록을 구분할 때 써요.
  • <src-dc-name> — 스트리밍 소스를 선택할 DC 이름이에요. 기본값은 아무 DC나 선택해요.

더 알아보기