centos下安装,简单配置redis

下载:

wget http://download.redis.io/releases/redis-3.0.2.tar.gz

解压:

tar xzvf redis-3.0.2.tar.gz

安装编译环境:

yum install -y gcc

编译安装依赖:

进入redis的deps目录

编译安装hiredis:

make
make install

编译安装jemalloc:

./configure
make
make install

编译安装linenoise:

make

编译安装lua:

yum install -y readline-devel ncurses-devel
make linux
make install

编译安装:

make

此时报错:

collect2: ld 返回 1

需要安装最新的tcl

wget http://jaist.dl.sourceforge.net/project/tcl/Tcl/8.6.4/tcl8.6.4-src.tar.gz
./configure
make
make test
make install

然后,做以下两步:
在src/Makefile开头加 CFLAGS= -march=x86-64
编辑src/.make-settings里的OPT,改为OPT=-O2 -march=x86-64

重新编译redis:

make
make test
make install

简单配置:

vim redis.conf

修改密码:requirepass xxx

启动:

nohup ./redis-server ../redis.conf &

Leave a Reply

Your email address will not be published. Required fields are marked *