Skip to main content
REDIS 기초
charsyam@naver.com
빌드 및 실행
Redis
In Memory
Single Thread
자료구조 제공
Why Redis?
설치가 쉽다.
다양한 기능.
시작하기 전에
http://redis.io 의 글들을 읽어보세요.
Build
단순히 make
Redis는 다른 라이브러리 의존성이 적
다.
의존성 라이브러리들도 deps 에 전부
포함됨.
Build 실패
빌드 중에 여러가지 이유로 실패를 하
고나면 make로 정상적으로 빌드가 되
지 않는 경우가 발생
Build 실패
charsyam@108:~/redis-2.8.7$ make
cd src && make all
make[1]: Entering directory `/home/charsyam/redis-2.8.7/src'
CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
compilation terminated.
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/home/charsyam/redis-2.8.7/src'
make: *** [all] Error 2
Build
Redis는 make 시에 다음 두 개의 파일
을 생성한다.
.make-prerequisites
.make-settings
.make-settings
STD=-std=c99 -pedantic
WARN=-Wall
OPT=-O2
MALLOC=jemalloc
……
……
Build – 해결책 #1
rm src/.make-settings
make
.make-settings 가 있으면, 의존성 모
듈을 모두 받은걸로 생각해서, src 폴더
의 빌드만 실행
Build – 해결책 #2
make distclean
실행
src/redis-server
실행
src/redis-server
이러면 디폴트 옵션으로 동작.
실행
src/redis-server ./redis.conf
redis.conf 의 설정으로 동작
redis.conf
src/redis-server
이러면 디폴트 옵션으로 동작.
redis.conf
port, bind, maxclients
save, appendonly, appendfsync, stop-writes-on-bgsave-error
slave-read-only, slave-priority
maxmemory
slaveof
……
Thank you!