1. redis 설치
다운로드 : http://redis.io
wget http://download.redis.io/releases/redis-3.0.1.tar.gz
tar zxvpf redis-3.0.1.tar.gz
cd redis-3.0.1
make PREFIX=/usr/local/redis install
mkdir -p /usr/local/redis/etc
난 redis를 /usr/local/redis 하단에 설치하기 위해서 make 명령에 부가 옵션을 준것이고, 통상적으로 /usr/local/bin 하단에 들어가게 하려면 그냥 make 명령만 사용하면 된다.
어디까지나 개인의 취향적인 부분이고… 굳이 왜 저렇게 했는가를 묻는다면….
redis는 시스템의 기본 패키지가 아니라, 특정 목적을 가진 서비스용 패키지 이기 때문에
* 이것(redis)이 설치되어있다.
* 다른 파일 & 디렉토리와 구분을 했으면 좋겠다.
* 이것(redis) 업그레이드시 해당 디렉토리만 갈아 치우면 된다.
* 이것(redis) 삭제해 해당 디렉토리만 삭제 하면 된다.
라는 생각으로 /usr/local/redis 를 사용했다.
2. 설정파일
redis 소스 디렉토리에 있는 것을 복사해서 사용하자
cp redis.conf /usr/local/redis/etc/6379.conf
3. 구동스크립트(redis init)
redis 소스 디렉토리에 있는 것을 복사해서 사용하자.
cp utils/redis_init_script /etc/init.d/redis_6379
다만, 나는 /usr/local/redis 로 위치를 강제 지정했기 때문에 init 스크립트 역시 약간의 수정을 해줘야 한다…
REDISPORT=6379
EXEC=/usr/local/redis/bin/redis-server
CLIEXEC=/usr/local/redis/bin/redis-cli
PIDFILE=/var/run/redis_${REDISPORT}.pid
CONF=”/usr/local/redis/etc/${REDISPORT}.conf”
4. redis 시작
/etc/init.d/redis_6379 start
redis 시작시 출력되는 메세지
27150:M 03 Jun 17:54:55.589 # Server started, Redis version 3.0.1
27150:M 03 Jun 17:54:55.589 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ’vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ’sysctl vm.overcommit_memory=1’ for this to take effect.
27150:M 03 Jun 17:54:55.589 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ’echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
27150:M 03 Jun 17:54:55.589 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
27150:M 03 Jun 17:54:55.589 * The server is now ready to accept connections on port 6379
자 한줄한줄 처리를 해봅시다..
* rc.local 에 등록할 내용 (해당 내용은 쉘에서 한번 실행 하자)
# for redis
echo never > /sys/kernel/mm/transparent_hugepage/enabled
* sysctl.conf 에 등록할 내용
# for redis
vm.overcommit_memory = 1
net.core.somaxconn = 65535
sysctl -p
다시 redis를 재시작 하면..
/etc/init.d/redis_6379 stop
/etc/init.d/redis_6379 start
아까 봤던 에러 메세지는 더이상 나오지 않는것을 확인 할 수 있다.
5. 제대로 구동되고 있는가???
# /usr/local/redis/bin/redis-cli
127.0.0.1:6379> set myname choilha
OK
127.0.0.1:6379> get myname
”choilha”
127.0.0.1:6379>
된거임…
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
109 | Apache Tomcat Versions – Which Do I Want? | 관리자 | 2016.06.24 | 44 |
108 | mod_rpaf on aws elb | 관리자 | 2016.06.17 | 43 |
107 | termination protection on instances and instance protection on auto scaling | 관리자 | 2016.05.31 | 30 |
106 | 인터넷으로 서비스를 제공하기 위해 챙겨야 할 실용적인 보안 가이드 | 관리자 | 2016.05.24 | 33 |
105 | Optimizing NFS Performance | 관리자 | 2016.05.23 | 34 |
104 | Apache Benchmark apr_socket_recv error when performing a load test | 관리자 | 2016.05.23 | 299 |
103 | config static port for nfsd on centos7 | 관리자 | 2016.05.21 | 99 |
102 | config static port for nfsd on centos6 | 관리자 | 2016.05.21 | 56 |
101 | log timestamp timezone in mysql-5.7 | 관리자 | 2016.05.12 | 37 |
100 | apache ab failed requests length | 관리자 | 2016.05.10 | 39 |
99 | WordPress 4.5.2 Security Release | 관리자 | 2016.05.07 | 39 |
98 | jetpack 4.0 fatal error | 관리자 | 2016.04.22 | 22 |
97 | tcp-wrapper on proftpd (using mod_wrap2, mod_wrap2_file) | 관리자 | 2016.04.19 | 33 |
96 | Appendix D: Java Programming Cheatsheet | 관리자 | 2016.04.14 | 33 |
95 | WordPress 4.5 “Coleman” | 관리자 | 2016.04.13 | 36 |