How do i perform a compile installation of redis?



  • Here the latest version is being used.

    Make a directory for the installation.

    $ cd $HOME
    $ mkdir redis
    $ cd redis
    

    Download the latest redis tar package.

    $ wget http://download.redis.io/releases/redis-4.0.10.tar.gz 
    --2018-07-18 07:01:03--  http://download.redis.io/releases/redis-4.0.10.tar.gz
    Resolving download.redis.io (download.redis.io)... 109.74.203.151
    Connecting to download.redis.io (download.redis.io)|109.74.203.151|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1738465 (1.7M) [application/x-gzip]
    Saving to: ‘redis-4.0.10.tar.gz’
    
    redis-4.0.10.tar.gz 100%[===================>]   1.66M  5.00MB/s    in 0.3s    
    
    2018-07-18 07:01:03 (5.00 MB/s) - ‘redis-4.0.10.tar.gz’ saved [1738465/1738465]
    

    Extract the tar archive.

    $ redis ls
    redis-4.0.10.tar.gz
    $ tar zxvf redis-4.0.10.tar.gz 
    redis-4.0.10/
    redis-4.0.10/.gitignore
    redis-4.0.10/00-RELEASENOTES
    redis-4.0.10/BUGS
    redis-4.0.10/CONTRIBUTING
    redis-4.0.10/COPYING
    redis-4.0.10/INSTALL
    redis-4.0.10/MANIFESTO
    ...
    ...
    ...
    
    $ cd redis-4.0.10 
    $ ls
    00-RELEASENOTES  COPYING  Makefile   redis.conf       runtest-sentinel  tests
    BUGS             deps     MANIFESTO  runtest          sentinel.conf     utils
    CONTRIBUTING     INSTALL  README.md  runtest-cluster  src
    

    Make a conf directory and copy the default configuration file to it.

    $ mkdir conf
    $ cp redis.conf conf
    $ ls conf
    redis.conf
    

    Compile the dependencies. Then cd one level up.

    $ cd deps
    $ make hiredis lua jemalloc linenoise
    (cd hiredis && make clean) > /dev/null || true
    (cd linenoise && make clean) > /dev/null || true
    (cd lua && make clean) > /dev/null || true
    (cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
    (rm -f .make-*)
    (echo "" > .make-cflags)
    (echo "" > .make-ldflags)
    MAKE hiredis
    cd hiredis && make static
    make[1]: Entering directory '/home/training/redis/redis-4.0.10/deps/hiredis'
    cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  net.c
    cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  hiredis.c
    cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  sds.c
    cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  async.c
    cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb  read.c
    ar rcs libhiredis.a net.o hiredis.o sds.o async.o read.o
    make[1]: Leaving directory '/home/training/redis/redis-4.0.10/deps/hiredis'
    ...
    ...
    ...
    $ cd ..
    

    Run make to install the binaries.

    $ make PREFIX=/home/training/redis install
    cd src && make install
    make[1]: Entering directory '/home/training/redis/redis-4.0.10/src'
        CC Makefile.dep
    
    Hint: It's a good idea to run 'make test' ;)
    
        INSTALL install
        INSTALL install
        INSTALL install
        INSTALL install
        INSTALL install
    make[1]: Leaving directory '/home/training/redis/redis-4.0.10/src'
    

    Verify the binaries have been created.

    $ cd ../bin
    $ bin ls
    redis-benchmark  redis-check-rdb  redis-sentinel
    redis-check-aof  redis-cli        redis-server
    

Log in to reply
 

© Lightnetics 2024