clearsnapshot — 스냅샷 제거

clearsnapshot — 스냅샷 제거

nodetool clearsnapshot 명령은 이름이 주어진 스냅샷을 지정한 키스페이스에서 제거하는 명령이에요. 모든 스냅샷을 한꺼번에 지우거나, 특정 시점보다 오래된 스냅샷만 지울 수도 있어요.

출처: nodetool clearsnapshot

본문

clearsnapshot은 더 이상 필요 없는 스냅샷을 디스크에서 정리하는 명령이에요. snapshot으로 생성한 백업 스냅샷을 이름(-t)으로 지정해 지우거나, --all로 전부, --older-than/--older-than-timestamp로 일정 기준보다 오래된 것만 골라 지울 수 있어요. 아래는 완전한 사용법이에요.

NAME
        nodetool clearsnapshot - Remove the snapshot with the given name from
        the given keyspaces

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>)] clearsnapshot [--all]
                [--older-than <older_than>]
                [--older-than-timestamp <older_than_timestamp>] [-t <snapshot_name>]
                [--] [<keyspaces>...]

OPTIONS
        --all
            Removes all snapshots

        -h <host>, --host <host>
            Node hostname or ip address

        --older-than <older_than>
            Clear snapshots older than specified time period.

        --older-than-timestamp <older_than_timestamp>
            Clear snapshots older than specified timestamp. It has to be a
            string in ISO format, for example '2022-12-03T10:15:30Z'

        -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

        -t <snapshot_name>
            Remove the snapshot with a given name

        -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

        [<keyspaces>...]
            Remove snapshots from the given keyspaces

--older-than-timestamp 값은 ISO 형식 문자열이어야 해요, 예를 들어 '2022-12-03T10:15:30Z'처럼요. 키스페이스를 지정하지 않으면 모든 키스페이스에서 해당 스냅샷을 제거해요.

더 알아보기 (Learn more)