[root@tbwy02 ~]# cd /tools/
[root@tbwy02 tools]# yum install -y wget gcc make tcl
[root@tbwy02 tools]# wget http://download.redis.io/redis-stable.tar.gz
[root@tbwy02 tools]# wget http://download.redis.io/releases/redis-3.0.2.tar.gz
[root@tbwy02 tools]# tar -zxvf redis-4.0.8.tar.gz
[root@tbwy02 tools]# cd redis-4.0.8
[root@tbwy02 redis-4.0.8]# make
[root@tbwy02 redis-4.0.8]# make test

Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/tools/redis-4.0.8/src'

[root@tbwy02 redis-4.0.8]# make test

\o/ All tests passed without errors!
Cleanup: may take some time... OK
make[1]: Leaving directory `/tools/redis-4.0.8/src'

[root@tbwy02 redis-4.0.8]# make install
cd src && make install
make[1]: Entering directory `/tools/redis-4.0.8/src'

Hint: It's a good idea to run 'make test' ;)

INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
make[1]: Leaving directory `/tools/redis-4.0.8/src'
[root@tbwy02 redis-4.0.8]# mkdir -p /etc/redis
[root@tbwy02 redis-4.0.8]# cp redis.conf /etc/redis/
[root@tbwy02 redis-4.0.8]# vim /etc/redis/redis.conf
# zkm 2018-3-23 15:30
daemonize yes
protected-mode no  要设置成no      (默认是设置成yes的, 防止了远程访问,在redis3.2.3版本后)
bind 127.0.0.1 (注释掉)
[root@tbwy02 redis-4.0.8]# /usr/local/bin/redis-server /etc/redis/redis.conf
25570:C 23 Mar 15:36:36.630 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
25570:C 23 Mar 15:36:36.630 # Redis version=4.0.8, bits=64, commit=00000000, modified=0, pid=25570, just started
25570:C 23 Mar 15:36:36.630 # Configuration loaded
[root@tbwy02 redis-4.0.8]# ps -ef |grep redis
root     25571     1  0 15:36 ?        00:00:00 /usr/local/bin/redis-server 127.0.0.1:6379       
root     25577 19689  0 15:37 pts/0    00:00:00 grep redis
[root@tbwy02 redis-4.0.8]# redis-cli
127.0.0.1:6379> set name david
OK
127.0.0.1:6379> get name
"david"
127.0.0.1:6379> quit

11.关闭客户端
[root@tbwy02 redis-4.0.8]# redis-cli shutdown

或者

pkill redis-server

-A INPUT -p tcp -m state --state NeW -m tcp --dport 6379 -j ACCEPT

12、开机启动配置

echo "/usr/local/bin/redis-server /etc/redis/redis.conf &" >> /etc/rc.local

开机启动要配置在 rc.local 中,而 /etc/profile 文件,要有用户登录了,才会被执行。

Centos6-编译安装Redis的更多相关文章

  1. 转:Centos6.5_x86安装Redis。

    Redis是一个高性能的,开源key-value型数据库.是构建高性能,可扩展的Web应用的完美解决方案,可以内存存储亦可持久化存储.因为要使用跨进程,跨服务级别的数据缓存,在对比多个方案后,决定使用 ...

  2. 在centos6编译安装http-2.4

    在centos6 编译安装httpd-2.4 安装httpd-2.4 Ü 依赖于apr-1.4+, apr-util-1.4+, [apr-iconv] Ü apr: : apache portabl ...

  3. CentOS6编译安装php5.3

    一.CentOS6编译安装php5.3 1.安装扩展 yum install -y openssl-devel traceroute libtool unzip gcc gcc-c++ autocon ...

  4. 【centos6】安装redis + phpredis 以及 常用配置参数

    1.redis-server和redis-cli安装文章:http://www.cnblogs.com/skyessay/p/6429988.html 1.前置条件:查看是否安装gcc,命令:gcc ...

  5. 20190418 CentOS7实用技能综合:系统安装 + WinScp客户端连接 + 防火墙端口号iptables + Nginx编译安装 + MySQL编译安装 + Redis编译安装 + MongoDB编译安装 + ActiveMQ/RocketMQ/RabbitMQ编译安装 + ...各类常用生产环境软件的编译安装

    系统安装 + WinScp客户端连接 + 防火墙端口号iptables + Nginx编译安装 + MySQL编译安装 + Redis编译安装 + MongoDB编译安装 + ActiveMQ/Roc ...

  6. CentOS 7.4 源码编译安装 Redis

    一.CentOS 7.4  源码编译安装 Redis 1.下载源码并解压 wget http://download.redis.io/releases/redis-4.0.10.tar.gz tar ...

  7. Docker容器编译安装Redis

    Docker容器编译安装Redis 1.创建容器 -i 交互模式 -d 后端运行 -h 容器的hostname --name 容器名 --network 网卡 --ip IP地址 -p 端口映射 -- ...

  8. CentOS6.5编译安装Redis

    一.首先要检测是否安装gcc yum install gcc-c++ yum install -y tcl 进入redis目录 cd /usr/local/redis .编译安装 make make ...

  9. CentOS6编译安装PHP7+Nginx

    本文属于动手搭建PHP开发环境的一部分,更多点击链接查看. 本文以centos6为例. 安装PHP 下载 http://cn2.php.net/distributions/php-5.6.22.tar ...

  10. CentOS6.9安装redis

    目录 Centos6.9下的Redis安装和配置(最简易方式) redis客户端登录方式 Centos6.9下的Redis安装和配置(最简易方式) 在服务器上创建一个目录/service,然后下载re ...

随机推荐

  1. Wp检查手机网络状态

    /// <summary> /// 检查网络状态 /// </summary> private void CheckNetworkState() { if (DeviceNet ...

  2. STM32F407 I2C 个人笔记

    源代码;https://github.com/YuQiao0303/STM32F407-Examples/tree/master/24.IIC 概述 I2C (IIC, Inter-Integrate ...

  3. OSPF 提升 一 ----基础

    ospf  ccnp内容   一  link-state protocols      IGP   开放式的最短路径优先协议     公有协议 支持中到大型的网络    spf算法 链路状态协议 1. ...

  4. Linux下dpkg的用法

    转自:http://blog.csdn.net/fireblue1990/article/details/52627952 dpkg是一个Debian的一个命令行工具,它可以用来安装.删除.构建和管理 ...

  5. “玲珑杯”ACM比赛 Round #19

    A -- A simple math problem Time Limit:2s Memory Limit:128MByte Submissions:1599Solved:270 DESCRIPTIO ...

  6. 【FFT求卷积】Problem D. Duel

    [AC] #include <stdio.h> #include <iostream> #include <string.h> #include <algor ...

  7. eclipse中AXIS2发布过程

    Axis2服务端研究好几个小时,终于解决了 需要下载: 地址1: 可以从镜像站下载: 上海大学开源镜像站 地址2: 链接:从百度网盘下载; 密码:8nwu 其中第二个可以不用下: 解压后 将3,4解压 ...

  8. 二分图最小覆盖的Konig定理及其证明,最小的覆盖证明

    [转http://www.cppblog.com/abilitytao/archive/2009/09/02/95147.html  ->  http://yejingx.ycool.com/p ...

  9. 转 Linux中常用操作命令

    http://blog.csdn.net/ljianhui/article/details/11100625 初窥Linux 之 我最常用的20条命令 玩过Linux的人都会知道,Linux中的命令的 ...

  10. zoj 3812 We Need Medicine (dp 状压)

    先贴一下转载的思路和代码,,,:http://blog.csdn.net/qian99/article/details/39138329 状压dp博大精深啊,以后看到n<=50都可以往状压上想, ...