[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. Head First HTML5 Programming笔记--chapter2 介绍Javascript和DOM

    你已经了解了HTML标记(也称为结构),而且知道了CSS样式(也称为表示),剩下的就是Javascript(也称为行为). JavaScript的工作方式 1. 编写 你创建HTML标记和JavaSc ...

  2. 学习笔记7——wp版本更新需要注意的问题

    平时开发时应该避免修改wp的核心代码, 因为在升级wp版本时,核心代码都会被覆盖, wp升级时只有wp-content文件夹不会被覆盖.

  3. centos 7 安装vmware 12

    1.下载VMware 衔接地址 http://www.vmware.com/products/workstation/workstation-evaluation ,下载Linux版本的VMware. ...

  4. 【2018.9.20】JOI 2017 Final T3「JOIOI 王国 / The Kingdom of JOIOI」

    题目链接 题目描述 JOIOI 王国是一个 $H$ 行 $W$ 列的长方形网格,每个 $1\times 1$ 的子网格都是一个正方形的小区块.为了提高管理效率,我们决定把整个国家划分成两个省 $JOI ...

  5. PHP文件上传设置和处理(单文件)

    <!--upload.php内容--><?php /* 修改php.ini的设置 file_uploads必须是On upload_max_filesize 设置上传文件的大小,此值 ...

  6. Explosion at Cafebazaar

    Explosion at Cafebazaar 时间限制: 1 Sec  内存限制: 128 MB 题目描述 You are an engineer at Cafebazaar and your sp ...

  7. 看 nova

    本节重点介绍 nova-scheduler 的调度机制和实现方法:即解决如何选择在哪个计算节点上启动 instance 的问题. 创建 Instance 时,用户会提出资源需求,例如 CPU.内存.磁 ...

  8. 转 C++STL之string

    http://www.cnblogs.com/wangkangluo1/archive/2011/07/22/2114118.html string类的构造函数: string(const char ...

  9. 测试开发系列之Python开发mock接口(二)

    上一篇咱们已经把开发前的环境准备好了,还需要再做一点准备,你的账户信息是存在哪的呢,当然是存在数据库里的,咱们在去支付,扣钱的时候,肯定是从数据库里面操作的,去更新账户表里面的数据,所以咱们先要把数据 ...

  10. scott登陆PLSQL时候出现insufficient privileges的解决方法

    先用SYS登陆SQLPLUS,即: 再给scott授权: