[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. Service Broadcast简单音乐播放功能

    在Activity上有两个ImageButton,分别控制播放/暂停.停止. @Override    public void onCreate(Bundle savedInstanceState) ...

  2. Leetcode 372.超级次方

    超级次方 你的任务是计算 ab 对 1337 取模,a 是一个正整数,b 是一个非常大的正整数且会以数组形式给出. 示例 1: 输入: a = 2, b = [3] 输出: 8 示例 2: 输入: a ...

  3. 对拍程序(Win)

    代码如下: @echo off :again rand.exe echo "rand finish" asd.exe echo "1.exe finish" 未 ...

  4. 刷题总结——小z的袜子(bzoj2038)

    题目: Description 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿.终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命……具体来说,小Z把 ...

  5. linux 内核源码arch/ 目录的前世今生

    历史的痕迹:在最新的linux-2.6.31/arch/arm/文件夹下,仍然保留Linux最初向ARM处理器移植的痕迹,最初的移植由黑客完成,在老的移植的代码文件的头部保留着黑客的名字:最初的ARM ...

  6. OC-为何用copy修饰block

    简单来说,block就像一个函数指针,指向我们要使用的函数. 就和函数调用一样的,不管你在哪里写了这个block,只要你把它放在了内存中(通过调用存在这个block的方 法或者是函数),不管放在栈中还 ...

  7. webStorm汉化

    http://www.sdbeta.com/xiazai/2015/0603/35070.html 注册时选择“License server”输入“http://idea.imsxm.com/”点击“ ...

  8. vue之组件注册

    一.组件名 写组件之前你要明确你的目的,想要做一个什么样的组件,我们在注册一个组件的时候,需要给组件一个名字,对于命名,尽可能明确,使用 kebab-case (短横线分隔命名) 或 PascalCa ...

  9. 如何快速的知道Maven插件的命令行输入参数

    用命令行使用Maven的插件时,-D表示属性的输入,-P表示构建配置文件的输入. 比如要使用package生命周期阶段对Application项目进行打包jar时,查找方式如下: 1.由于packag ...

  10. 【Vue 学习系列 - 01】- 环境搭建(Win7)

    1. 根据系统下载Node.js 下载地址:http://nodejs.cn/download 2. 安装Node.js 点击安装Node.js,在安装目录D:\Program Files\nodej ...