1、下载Redis3.2.5安装包

2、解压、编译、安装redis-3.2.5:
tar -zxvf redis-3.2.5.tar.gz -C /usr/src/
cd /usr/src/redis-3.2.5/
make && make install

3、创建redis相关目录:
mkdir -p /home/redis/bin
mkdir -p /home/redis/log
mkdir -p /home/redis/pid
mkdir -p /home/redis/db

4、将可执行文件复制到自己的安装目录:/home/redis/
          ln -s /usr/local/bin/redis-*   /home/redis/bin/

5、复制配置文件到自己的安装目录:/home/redis/
          cp redis.conf /home/redis/

6、进入自己的安装目录,编辑redis.conf配置文件:
cd /home/redis/

vim /home/redis/redis.conf

 
根据实际需要修改配置文件,以下仅供参考
daemonize yes
pidfile /home/redis/pid/redis.pid
logfile /home/redis/log/redis.log
dir /home/redis/db
port 6379
tcp-backlog 511
timeout 600
tcp-keepalive 0
loglevel notice
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dbfilename dump.rdb
slave-serve-stale-data yes
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes
# vm-enabled no
# maxmemory 4G

7、创建redis服务脚本,并赋予权限:
vim /etc/init.d/redis
#!/bin/sh
#
# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.
PATH=/home/redis/bin:/sbin:/usr/bin:/bin
REDISPORT=6379
EXEC=/home/redis/bin/redis-server
CLIEXEC=/home/redis/bin/redis-cli
PIDFILE=/home/redis/pid/redis.pid
CONF="/home/redis/redis.conf"
case "$1" in
    start)
        if [ -f $PIDFILE ]
        then
                echo "$PIDFILE exists, process is already running or crashed"
        else
                echo "Starting Redis server..."
                $EXEC $CONF
        fi
        ;;
    stop)
        if [ ! -f $PIDFILE ]
        then
                echo "$PIDFILE does not exist, process is not running"
        else
                PID=$(cat $PIDFILE)
                echo "Stopping ..."
                $CLIEXEC -p $REDISPORT shutdown
                while [ -x /proc/${PID} ]
                do
                    echo "Waiting for Redis to shutdown ..."
                    sleep 1
                done
                echo "Redis stopped"
        fi
        ;;
    *)
        echo "Please use start or stop as first argument"
        ;;
esac

8、添加redis服务开机启动:
chmod a+x /etc/init.d/redis

9、启动redis服务:
service redis start
ps -ef | grep redis
netstat -anptu | grep 6379

10、测试OK
          redis-cli
          set key1 hello
          get key1
          quit

(防火墙启用6379端口:iptables -A INPUT -p tcp --dport 6379 -j ACCEPT)

CentOS6.8安装Redis3.2.5的更多相关文章

  1. Centos6.5安装Redis3.0备忘记录

    Centos6.5安装Redis3.0 1. 安装C编译环境 首先需要安装编译Redis的C环境,在命令行执行以下命令: [root@itzhouq32 tools] yum install gcc- ...

  2. Centos6.5安装Redis3.2.8

    1 - Redis安装 redis安装 在网上一搜一大把,但是还是在这里想要能够统一吧,所以这个安装步骤是在Centos6.5 Minimal 上安装redis3.4.8,本次安装是在root 用户下 ...

  3. centos6.5_64bit安装Redis3.2.8

    一.去官网下载最新稳定版 https://redis.io/   二.打开redis需要的端口 /sbin/iptables -I INPUT -p tcp --dport 6379 -j ACCEP ...

  4. 【redis】之centos6.x安装redis3.0.x

    centos6.9_x86_64 1.下载redis安装包 http://download.redis.io/releases/redis-3.2.9.tar.gz 2.解压 编译到指定得目录 mak ...

  5. CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

    CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0 原文链接:https://www.toutiao.com/i6481931577499582990/ 一.上 ...

  6. vmware Centos6.6安装64位

    Centos6.6安装64位 必须开启BIOS中的虚拟化技术 首先开机进入BIOS,一般机器是按F2,我的T420是按F1,然后进入Security,Virtualization,选择Enable即可 ...

  7. CentOS 6.5 安装 Redis-3.2.6

    到官网下载最新版的 Redis-3.2.6, 我把它放到文件夹:/usr/local/src/centos-sdk/source2/redis 安装脚本 redis-3.2.6.sh #!/bin/b ...

  8. Gitlab完美安装【CentOS6.5安装gitlab-6.9.2】

    摘要: 拆腾了几天,终于在今天找到了快速安装Gitlab的方法.CentOS6.5安装gitlab-6.9.2 参考网址:https://gitlab.com/gitlab-org/omnibus-g ...

  9. CentOS6.5安装Tomcat

    安装说明 安装环境:CentOS-6.4 安装方式:源码安装 软件:apache-tomcat-7.0.56.tar.gz 下载地址:http://tomcat.apache.org/download ...

随机推荐

  1. OGRE 2.1 Windows 编译

    版权所有,转载请注明链接 OGRE 2.1 Windows 编译 环境: Windows 7 64Bit Visual Studio 2012 OGRE 2.1 CMake 2.8.12.1 OGRE ...

  2. Core Java Volume I — 4.1. Introduction to Object-Oriented Programming

    4.1. Introduction to Object-Oriented ProgrammingObject-oriented programming, or OOP for short, is th ...

  3. 完美解决IE6不支持position:fixed的bug

    示例代码: <!DOCTYPE html><html><head><meta http-equiv="Content-Type" cont ...

  4. (进阶篇)浅谈COOKIE和SESSION关系和区别

    COOKIE介绍 cookie 常用于识别用户.cookie 是服务器留在用户计算机中的小文件.每当相同的计算机通过浏览器请求页面时,它同时会发送 cookie.通过 PHP,您能够创建并取回 coo ...

  5. Java 正则表达式学习总结和一些小例子

    从Java1.4起,Java核心API就引入了java.util.regex程序包,它是一种有价值的基础工具,可以用于很多类型的文本处理, 如匹配,搜索,提取和分析结构化内容. java.util.r ...

  6. 滚动条滚动事件 js

    <div class="xiangxix">                <ul>                    <li class=&qu ...

  7. 使用Spring Aop验证方法参数是否合法

    先定义两个注解类ValidateGroup 和 ValidateFiled ValidateGroup .java package com.zf.ann; import java.lang.annot ...

  8. hdu 1548 (dijkstra解法)(一次AC就是爽)

    恭喜福州大学杨楠获得[BestCoder Round #4]冠军(iPad Mini一部) <BestCoder用户手册>下载 A strange lift Time Limit: 200 ...

  9. hdu3861 强连通+最小路径覆盖

    题意:有 n 个点,m 条边的有向图,需要将这些点分成多个块,要求:如果两点之间有路径能够互相到达,那么这两个点必须分在同一块:在同一块内的任意两点相互之间至少要有一条路径到达,即 u 到达 v 或 ...

  10. JS的prototype的共享机制分析

    function Super(){ } Super.prototype.aaa=[1,2,3]; Super.prototype.bbb=1; function Sub(){ Super.call(t ...