Redis - Replication  Master/Slave 설정정보 모니터링 하기

     

     

     

     

    이번 포스팅에서는 Redis 서버에서 Replication 모니터링 하는방법에 대해서 알아보도록하겠습니다.

     

     

     

     

       Redis 이전글

     

     

     

     

    https://server-talk.tistory.com/471 - Redis - In-Memory - 알아보기​

     

     

    https://server-talk.tistory.com/472 - Redis - 서버 설치 및 기본설정 알아보기

     

     

    https://server-talk.tistory.com/473 - Redis - Redis-cli 기본 사용법

     

     

    https://server-talk.tistory.com/474 - Redis - Redis Desktop Manager Tool

     

     

    https://server-talk.tistory.com/475 - phpredis 설치 알아보기

     

     

    https://server-talk.tistory.com/496 - Redis - Replication(복제) 란?

     

     

    https://server-talk.tistory.com/499 - Redis - Replication 동기화 작동 방식 알아보기

     

     

     

     

       Redis - Replication Master Server 정보확인

     

     

     

     

    사용법 : info replication

     

    127.0.0.1:6379> info replication
    # Replication
    role:master
    connected_slaves:1
    slave0:ip=192.168.0.130,port=6390,state=online,offset=112,lag=1
    master_replid:4e08c61e6a2eef2df4be658708d669a17227cf52
    master_replid2:0000000000000000000000000000000000000000
    master_repl_offset:112
    second_repl_offset:-1
    repl_backlog_active:1
    repl_backlog_size:1048576
    repl_backlog_first_byte_offset:1
    repl_backlog_histlen:112

     

     

     

     

    1. Redis Replication - Master, Slave 서버 여부 확인

     

     

    role:[master or slave]

     

    Master 서버인지 Slave 서버인지 확인할 수 있습니다.

     

     

     

     

    2. Redis Replication - 연결된 Slave 서버 수 확인

     

     

    connected_slaves:[Slave 서버수]

     

     

     

     

    3. Redis Replication - 연결된 Slave 서버 정보 확인

     

     

    slave0:ip=[Slave 서버 IP],port=[Slave 서버 Port],state=online,offset=112,lag=1

     

    Slave 서버 정보를 확인할 수 있으며 Slave 서버가 여러대일 경우 아래에 추가로 표시됩니다.

     

     

     

     

    4. Redis Replication - Master 서버 Replication ID 확인

     

     

    master_replid:[Replication ID]

     

     

     

     

    5. Redis Replication - Master 서버 보조 Replication ID 확인

     

     

    master_replid2:[보조 Replication ID]

     

     

     

     

    6. Redis Replication - Replication backlog 활성화 여부를 확인

     

     

    repl_backlog_active:[1 or 0]

     

     

     

     

    7. Redis Replication - Replication backlog 크기 확인

     

     

    repl_backlog_size:[Byte]

     

     

     

     

    8. Redis Replication - Replication backlog 버퍼의 데이터 크기

     

    repl_backlog_histlen:[Byte]

     

     

     

     

     

       Redis - Replication Master Server 정보확인

     

     

     

     

    사용법 : info replication

     

    127.0.0.1:6390> info replication
    # Replication
    role:slave
    master_host:192.168.0.109
    master_port:6379
    master_link_status:up
    master_last_io_seconds_ago:1
    master_sync_in_progress:0
    slave_repl_offset:7431
    slave_priority:100
    slave_read_only:1
    connected_slaves:0
    master_replid:63d21ba4f2403a059467a4512fee853cd2c0b2b3
    master_replid2:0000000000000000000000000000000000000000
    master_repl_offset:7431
    second_repl_offset:-1
    repl_backlog_active:1
    repl_backlog_size:1048576
    repl_backlog_first_byte_offset:1
    repl_backlog_histlen:7431

     

     

     

     

    1. Redis Replication - Master, Slave 서버 여부 확인

     

    role:[slave or master]

     

     

     

     

    2. Redis Replication - Master 서버 IP 정보 확인

     

    master_host:[Master Server IP]

     

     

     

     

    3. Redis Replication - Master 서버 Port 정보 확인

     

    master_port:[Port]

     

     

     

     

    4. Redis Replication - Master 서버 실행상태 확인

     

    master_link_status:[up or down]

     

    Slave 서버에서 Master 서버 Redis가 실생되어 있을경우 up 중지되었을 경우 down으로 표시됩니다.

     

     

     

     

    5. Redis Replication - 마지막으로 Master 서버와 연결되고 경과시간

     

    master_last_io_seconds_ago:[Sec]

     

     

     

     

    6. Redis Replication - Master 서버와 동기화 여부 확인

     

    master_sync_in_progress:[1 or 0]

     

     

     

     

    7. Redis Replication - Master 서버장애시 연결될 Slave 서버 우선순위

     

    slave_priority:

     

     

     

     

    8. Redis Replication - Slave 서버가 읽기 전용 표시

     

    slave_read_only:[1 : 0]

     

     

     

     

    9. Redis Replication - 연결된 Replication 서버 수

     

    connected_slaves:

     

     

     

     

    10. Redis Replication - Master 서버 Replication ID 확인

     

    master_replid:[Replication ID]

     

     

     

     

    11. Redis Replication - Master 서버 보조 Replication ID 확인

     

    master_replid2:[보조 Replication ID]

     

     

     

     

    12. Redis Replication - Slave 서버 Replication backlog  활성화 여부를 확인

     

    repl_backlog_active:[1 or 0]

     

     

     

     

    13. Redis Replication - Slave 서버 Replication backlog 크기 확인

     

    repl_backlog_size:[Byte]

     

     

     

     

    14. Redis Replication - Slave 서버 Replication backlog 버퍼의 데이터 크기

     

    repl_backlog_histlen:[Byte]

     

    Posted by 서버이야기