Linux中安装Redis

redis中的安装

下载连接:

  • Redis的官方位置
  • Redis的中文位置
//使用wget命令下载(默认下载当前路径使用"-P"指定下载位置)
wget http://download.redis.io/releases/redis-4.0.6.tar.gz

解压命令:

tar -zxvf redis-4.0.6.tar.gz -C /usr/myapp/

执行编译

make

安装测试

make test //注意在redis的src目录中执行

出现错误如下:
You need tcl 8.5 or newer in order to run the Redis tes
解决如下:

wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz     //下载文件

tar -zxvf tcl8.6.1-src.tar.gz  -C /usr/myapp                     //解压

cd  /usr/local/tcl8.6.1/unix/                                    //进入安装位置

./configure         //解析编译命令

make                //编译

make install        //安装

再去执行make test命令;成功编译等待(等待可能有些久)安装,如下图:

Linux中安装Redis_第1张图片
link

安装位置:

make PREFIX=/usr/myapp/redis4.0 install

运行服务器

cd src
./redis-server

运行结果如下:


Linux中安装Redis_第2张图片
image

修改后台启动:damemonize修改为"yes"

[图片上传失败...(image-589ebd-1513261932468)]

vim /usr/myapp/redis-4.0.6/redis.conf        // vim编辑配置文件
/daemonize                                   // 查找命令

重新启动redis服务器:

./bin/redis-server ./redis.conf

运行客户端

/redis-cli 
Linux中安装Redis_第3张图片
image

你可能感兴趣的:(Linux中安装Redis)