Redis edu 1

17
REDIS 기초 [email protected] 빌드 및 실행

Transcript of Redis edu 1

Page 1: Redis edu 1

REDIS 기초

[email protected]

빌드 및 실행

Page 2: Redis edu 1

Redis

In Memory

Single Thread

자료구조 제공

Page 3: Redis edu 1

Why Redis?

설치가 쉽다.

다양한 기능.

Page 4: Redis edu 1

시작하기 전에

http://redis.io 의 글들을 읽어보세요.

Page 5: Redis edu 1

Build

단순히 make

Redis는 다른 라이브러리 의존성이 적다.

의존성 라이브러리들도 deps 에 전부 포함됨.

Page 6: Redis edu 1

Build 실패

빌드 중에 여러가지 이유로 실패를 하고나면 make로 정상적으로 빌드가 되지 않는 경우가 발생

Page 7: Redis edu 1

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

Page 8: Redis edu 1

Build

Redis는 make 시에 다음 두 개의 파일을 생성한다. .make-prerequisites .make-settings

Page 9: Redis edu 1

.make-settings

STD=-std=c99 -pedantic WARN=-Wall OPT=-O2 MALLOC=jemalloc …… ……

Page 10: Redis edu 1

Build – 해결책 #1

rm src/.make-settings make

.make-settings 가 있으면, 의존성 모듈을 모두 받은걸로 생각해서, src 폴더의 빌드만 실행

Page 11: Redis edu 1

Build – 해결책 #2

make distclean

Page 12: Redis edu 1

실행

src/redis-server

Page 13: Redis edu 1

실행

src/redis-server

이러면 디폴트 옵션으로 동작.

Page 14: Redis edu 1

실행

src/redis-server ./redis.conf

redis.conf 의 설정으로 동작

Page 15: Redis edu 1

redis.conf

src/redis-server

이러면 디폴트 옵션으로 동작.

Page 16: Redis edu 1

redis.conf port, bind, maxclients

save, appendonly, appendfsync, stop-writes-on-bgsave-error

slave-read-only, slave-priority

maxmemory

slaveof

……

Page 17: Redis edu 1

Thank you!