craaazy123 发表于 2014-07-19 16:36

redis linux 环境下编译安装

本帖最后由 craaazy123 于 2014-07-19 16:50 编辑

操作系统: CentOS 6.4 minimal, Ubuntu 12.04+
软件版本: redis-2.8.6
1. 安装必要软件
   CentOS下: $ yum install make gcc wget
   Ubuntu下: $ apt-get install -y gcc make
2. 下载redis
   $ wget http://download.redis.io/releases/redis-2.8.6.tar.gz
3. 解压redis-2.8.6.tar.gz
   $ tar -zxvf redis-2.8.6.tar.gz
4. 编译安装
   $ cd redis-2.8.6
   $ cd deps && make hiredis lua jemalloc linenoise
   $ cd ..
   $ make
5. 配置
   $ mkdir /etc/redis/
   $ cp redis.conf /etc/redis/
   $ cp src/redis-* /usr/local/bin/
   $ sysctl vm.overcommit_memory=1
6. redis.conf文件
   daemonize yes #默认为no

7. 启动redis
    $ redis-server /etc/redis/redis.conf

8. 使用客户端连接redis并设置密码
    $ redis-cli -p 6379
   

9. 配置相关
$ vi /etc/redis/redis.conf

设置dump.rdb目录: dir /redis/data
设置日志文件目录: logfile /var/log/redis/redis.log
   
页: [1]
查看完整版本: redis linux 环境下编译安装