$ yum install centos-release-scl devtoolset-7
$ scl enable devtoolset-7 bash
$ yum install gcc
$ yum install jemalloc
[karim@localhost redis]# wget http://download.redis.io/releases/redis-6.0.7.tar.gz
--2021-12-16 17:25:11-- http://download.redis.io/releases/redis-6.0.7.tar.gz
Resolving download.redis.io (download.redis.io)... 45.60.125.1
Connecting to download.redis.io (download.redis.io)|45.60.125.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2240490 (2.1M) [application/octet-stream]
Saving to: ‘redis-6.0.7.tar.gz’
100%[=========================>] 2,240,490 1.08MB/s in 2.0s
2021-12-16 17:25:14 (1.08 MB/s) - ‘redis-6.0.7.tar.gz’ saved [2240490/2240490]
$ tar -zxvf redis-6.0.7.tar.gz
[karim@localhost redis]$ tar -zxvf redis-6.0.7.tar.gz
redis-6.0.7/
...
redis-6.0.7/utils/tracking_collisions.c
redis-6.0.7/utils/whatisdoing.sh
$ cd deps/
$ make hiredis jemalloc linenoise lua
[root@localhost deps]# make hiredis jemalloc linenoise lua
MAKE hiredis
cd hiredis && make static
make[1]: Entering directory `/home/karim/redis/redis-
...
ATIC='' -c -o print.o print.c
cc -o luac luac.o print.o liblua.a -lm
make[1]: Leaving directory `/home/karim/redis/redis-6.0.7/deps/lua/src'
$ make
[root@localhost redis-6.0.7]# make
cd src && make all
make[1]: 디렉터리 '/home/karim/redis/redis-6.0.7/src' 들어감
CC Makefile.dep
rm -rf redis-server redis-sentinel redis-cli redis-benchmark rb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-htmp dict-benchmark
rm -f adlist.d quicklist.d ae.d anet.d dict.d server.d sds.d zc.d lzf_d.d
...
CC redis-cli.o
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
INSTALL redis-check-rdb
INSTALL redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: 디렉터리 '/home/karim/redis/redis-6.0.7/src' 나감
$ mkdir bin
$ mkdir conf
$ mkdir data
$ mkdir logs
$ mkdir pid
실행
$ cd src
$ cp redis-server ../bin/
cli
$ cd src
$ cp redis-cli ../bin
.conf
$ cd redis-6.0.7
$ cp redis.conf bin/conf
$ nohup ./redis-server ./conf/redis_1111.conf --bind 0.0.0.0 --port 1111 --pidfile ./pid/redis_1111.pid --dir ./data --logfile ./logs/redis_1111.log --loglevel notice --appendfilename append_1111.aof --maxmemory "0" &
$ ./redis-server ./conf/redis_1111.conf
📌 여담
📚 참고