[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. linux 使用mail 发送邮件

    配置: /etc/mail.rc 追加配置参数 set from=lynctest@iclinux.com smtp="mail.iclinux.com"smtp-auth-use ...

  2. 【02】xmind如何修改默认线条设置

    [02]xmind如何修改不同主题的默认线条设置 魔芋:每次都是曲线.更喜欢为直线.因为曲线的路线是不确定的,看起来就显示很凌乱. 用everything搜索defaultStyles.xml     ...

  3. android 之 菜单

    android的菜单主要分三类:选项菜单(Options Menu).上下文菜单(Context Menu).子菜单(Submenu). 1 选项菜单和子菜单 一个Menu对象代表一个菜单,Menu中 ...

  4. javascript异常cannot read property xx of null 的错误

    一般报这种异常或者错误,是因为试图从null中再读一个属性导致的. 比如:var myAttr=myObj.data.Name; 假如这个时候myObj.data是null,那么再试图读取data的N ...

  5. Python MySQLdb的execute和executemany的使用

    如果使用executemany对数据进行批量插入的话,要注意一下事项: conn = MySQLdb.connect(host = “localhost”, user = “root”, passwd ...

  6. PAT天梯赛练习题——L3-005. 垃圾箱分布(暴力SPFA)

    L3-005. 垃圾箱分布 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 大家倒垃圾的时候,都希望垃圾箱距离自己比较近,但是谁 ...

  7. [luoguP3317] [SDOI2014]重建(矩阵树定理)

    传送门 为了搞这个题又是学行列式,又是学基尔霍夫矩阵. 矩阵树定理 本题题解 无耻地直接发链接,反正我也是抄的题解.. #include <cstdio> #include <cma ...

  8. OS X 下iso刻录U盘(系统安装启动盘)

    1. 查看盘 $diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER : GUID_partition_scheme *320.1 GB disk ...

  9. UVa10491 Cows and Cars

    #include<iostream> #include<cstdio> #include<algorithm> int main(){ double a,b,c; ...

  10. poj 3083 dfs,bfs

    传送门    Children of the Candy Corn Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I6 ...