CONFIG GET

Redis Server Course Redis Technical Support Redis Enterprise Server

레디스 서버 구성 정보 조회

실행중인 서버에서 구성 정보를 조회한다.
버전 2.6 부터 거의 모든 파라미터를 조회할 수 있다.
구성정보 또는 파라미터는 redis.conf 파일에 지정된 것을 말한다.
config get 다음에 파라미터 명을 입력하거나 glob-style로 *를 입력해서 조회할 수 있다.

Example

명령>config get save
결과>1) "save"
2) "900 1 300 10 60 10000"
명령>config get app*
결과>1) "appendonly"
2) "yes"
3) "appendfsync"
4) "everysec"

전체 파라미터 리스트를 보려면 config get * 를 하면 된다.

redis.conf 파일과 다른 점은 다음과 같다.

  • conf 파일에서 사용한 kb, mb 같은 단위로 표시되지 않고 bytes 단위로 표시된다.
  • save 파라미터는 값이 여러개 이므로 공백으로 구분해서 한 줄에 표시된다.

이 파라미터들은 config set 명령으로 변경(설정) 가능하다.

다음은 레디스 버전 3.0.2에서 config get 명령으로 얻을 수 있는 파라미터 리스트이고, redis.conf 파일과 다른 점이 설명되어 있다. Value는 대부분 기본값(디폴트)이지만 임의로 설정한 값들도 있다. 표의 마지막에 Config set Supported 가 있다. 이것은 config set 명령으로 변경 가능 여부를 표시한 것이다.
일반 파라미터 7개와 rdbchecksum, slaveof은 변경할 수 없다.
Slaveof는 config set 명령으로는 적용할 수 없지만, slaveof 명령이 있기 때문에 명령을 직접 실행하면 됩니다. Config get slaveof 로 ip port를 조회해 볼 수 있고, config rewrite 하면 redis.conf 파일에도 기록됩니다.

config get 파라미터 리스트

Redis version 3.0.2
분류Parameter nameValueConfig set
Supported
일반
General
databases16X
logfileredis.logX
pidfile/var/run/redis.pidX
daemonizeyesX
bindX
port5051X
tcp-backlog511X
AOFaof-load-truncatedyesO
aof-rewrite-incremental-fsyncyesO
appendfsynceverysecO
appendonlyyesO
auto-aof-rewrite-min-size67108864O
auto-aof-rewrite-percentage100O
no-appendfsync-on-rewritenoO
RDBdbfilenamedump.rdbO
rdbchecksumyesX
rdbcompressionyesO
saveO
stop-writes-on-bgsave-erroryesO
복제
Replication
slaveofX
slave-read-onlyyesO
slave-priority100O
slave-serve-stale-datayesO
repl-backlog-size1048576O
repl-backlog-ttl3600O
repl-disable-tcp-nodelaynoO
repl-diskless-syncnoO
repl-diskless-sync-delay5O
repl-ping-slave-period10O
repl-timeout60O
min-slaves-max-lag10O
min-slaves-to-write0O
메모리
Memory
maxmemory0O
maxmemory-policynoevictionO
maxmemory-samples5O
클러스터
Cluster
cluster-migration-barrier1O
cluster-node-timeout15000O
cluster-require-full-coverageyesO
cluster-slave-validity-factor10O
기타
Etc
dir/home/redis/redis-3.0.2/5051O
loglevelnoticeO
tcp-keepalive0O
timeout0O
client-output-buffer-limitnormal 0 0 0
slave 268435456 67108864 60
pubsub 33554432 8388608 60
O
maxclients10000O
list-max-ziplist-entries512O
list-max-ziplist-value64O
hash-max-ziplist-entries512O
hash-max-ziplist-value64O
set-max-intset-entries512O
zset-max-ziplist-entries128O
zset-max-ziplist-value64O
activerehashingyesO
hll-sparse-max-bytes3000O
hz10O
latency-monitor-threshold0O
requirepassO
masterauthO
notify-keyspace-eventsO
slowlog-log-slower-than10000O
slowlog-max-len128O
unixsocketX
unixsocketperm0X
lua-time-limit5000O
모니터watchdog-period0O

watchdog

조회된 파라미터 중 단 하나만 빼고 모두 redis.conf 파일에 있는 것이다. 그 하나는 마지막 빨간색으로 표시된 watchdog-period 이다.
워치독은 디버깅 목적으로 low level report를 발생시키며, 이미 실행중인 서버에만 적용할 수 있도록 설계되었기 때문에 redis.conf 파일의 파라미터로 활성화 시킬 수 없다.   워치독은 서버가 느려졌을 경우 문제를 추적하기 위해 개발되어 버전 2.6에서 소개되었다.   이 기능은 실험적인 기능으로 다른 방법으로 문제를 추적할 수 없을 경우에 마지막으로 사용하는 수단이고, 활성화 했을 경우 예기치 않은 문제가 발생할 수 있으므로 운용중인 서버에 적용할 때는 미리 데이터를 백업해야 한다.

127.0.0.1:6379> config set watchdog-period 500

이와 같이 활성화 할 수 있고 시간은 밀리초이다. 즉 서버가 500 밀리초 동안 멈추어 있으면 로그 파일에 row level report를 남긴다. 최소값은 200이다. 200 미만으로 설정해도 에러가 발생하지 않지만 명령 실행 즉시 report가 생성된다.   문제가 해결되면 비활성화 시킬 것을 권한다. 값을 0으로 설정하면 비활성화된다.
-1을 입력하면 아래와 같이 에러가 발생한다.

127.0.0.1:6379> config set watchdog-period -1
(error) ERR Invalid argument '-1' for CONFIG SET 'watchdog-period'
아래는 watchdog-period 500 설정 후 DEBUG sleep 1 명령으로 생성된 리포트이다.

워치독에 대한 좀 더 자세한 내용은 Redis latency problems troubleshooting에서 watchdog을 찾아 보세요.

SLAVEOF

SLAVEOF 명령은 CONFIG get 명령으로 조회할 수 있고, redis.conf 파일에 넣어서 실행할 수 있으나, CONFIG set 명령으로 설정할 수 없다.   SLAVEOF는 명령으로 직접 실행하면 된다.

redis.conf에만 있는 파라미터들

마지막으로 다음 파라미터들은 redis.conf에는 있는데, CONFIG get으로 조회할 수 없고, CONFIG set으로 변경할 수 없는 파라미터들이다.   redis.conf에 넣어서 레디스 서버 시작 시에만 적용할 수 있다.

appendfilename
cluster-enabled
cluster-config-file
syslog-enabled
syslog-ident
syslog-facility
include

명령문

CONFIG GET parameter

  • 이 명령은 version 2.0.0 부터 사용할 수 있다.
Clients for C Hiredis

<< CONFIG RESETSTAT CONFIG GET CONFIG SET >>

조회수 :

Email 답글이 올라오면 이메일로 알려드리겠습니다.