0. 설치 파일 다운로드
https://redis.io/download 사이트에서 Stable된 파일을 받는다. |
1. Redis 설치
[root@CMaria ~]# ls redis-4.0.6.tar.gz [root@CMaria ~]# tar xvfz redis-4.0.6.tar.gz [root@CMaria ~]# ls redis-4.0.6 redis-4.0.6.tar.gz [root@CMaria ~]# cd redis-4.0.6 [root@CMaria redis-4.0.6]# pwd /root/redis-4.0.6 [root@CMaria redis-4.0.6]# make ..... Hint: It's a good idea to run 'make test' ;)
[root@CMaria redis-4.0.6]# make install cd src && make install make[1]: Entering directory `/root/redis-4.0.6/src' CC Makefile.dep make[1]: Leaving directory `/root/redis-4.0.6/src' make[1]: Entering directory `/root/redis-4.0.6/src'
Hint: It's a good idea to run 'make test' ;)
INSTALL install INSTALL install INSTALL install INSTALL install INSTALL install make[1]: Leaving directory `/root/redis-4.0.6/src' |
2. Redis 실행/종료
[root@localhost ~]# /root/redis-stable/src/redis-server /root/redis-stable/redis.conf & [1] 2321 [root@localhost ~]# 2321:C 26 Dec 19:36:25.375 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 2321:C 26 Dec 19:36:25.375 # Redis version=4.0.6, bits=64, commit=00000000, modified=0, pid=2321, just started 2321:C 26 Dec 19:36:25.375 # Configuration loaded 2321:M 26 Dec 19:36:25.376 * Increased maximum number of open files to 10032 (it was originally set to 1024). _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 4.0.6 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | `-._ `._ / _.-' | PID: 2321 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-'
2321:M 26 Dec 19:36:25.380 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 2321:M 26 Dec 19:36:25.380 # Server initialized 2321:M 26 Dec 19:36:25.380 # 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. 2321:M 26 Dec 19:36:25.380 # 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. 2321:M 26 Dec 19:36:25.477 * DB saved on disk 2321:M 26 Dec 19:36:25.478 * DB loaded from append only file: 0.098 seconds 2321:M 26 Dec 19:36:25.478 * Ready to accept connections
[root@localhost ~]# ps -ef | grep redis root 2321 2198 0 19:36 pts/0 00:00:00 /root/redis-stable/src/redis-server 0.0.0.0:6379 root 2329 2198 0 19:41 pts/0 00:00:00 grep --color=auto redis [root@localhost ~]# [root@localhost ~]# /root/redis-stable/src/redis-cli shutdown 2321:M 26 Dec 19:41:42.345 # User requested shutdown... 2321:M 26 Dec 19:41:42.345 * Calling fsync() on the AOF file. 2321:M 26 Dec 19:41:42.382 * Saving the final RDB snapshot before exiting. 2321:M 26 Dec 19:41:42.424 * DB saved on disk 2321:M 26 Dec 19:41:42.424 * Removing the pid file. 2321:M 26 Dec 19:41:42.424 # Redis is now ready to exit, bye bye... [1]+ Done /root/redis-stable/src/redis-server /root/redis-stable/redis.conf
root 2332 2198 0 19:41 pts/0 00:00:00 grep --color=auto redis
|
3. 하나의 서버에서 포트를 다르게 해서 Redis 인스턴스 하나더 기동 시키기
설정 파일을 하나더 만들어서 포트/디렉토리 정보만 변경해서 기동 시키면 됨. 새로 기동 시킬 Redis의 포트는 6380 이고, 로그 파일의 경로는 /root/redis-stable6380으로 설정 할 예정임
1. 설정 파일 복사 및 수정
2. 설정 파일 편집 기본적으로 다음의 4개 설정 편집.
3. 레디스 기동
4. 레디스 접속
5. 레디스 종료
|