本文以Centos6.8为例子,来进行演示。

1:下载最新版的Redis,比如我们安装在根目录下的redis文件下中

tar zxvf http://download.redis.io/releases/redis-5.0.4.tar.gz

2:解压安装Redis

tar zxvf redis-5.0..tar.gz
cd redis-5.0.
make
make install

3:设置redis.cof配置文件

cp /redis-5.0./redis.conf /redis-5.0./.conf 

4:修改配置文件,改为守护进程模式

vim /redis-5.0./.conf

136行 daemonize no 改为 daemonize yes

5:作为系统服务启动

cp utils/redis_init_script /etc/init.d/redis

6:修改init.d/redis配置文件

15行
修改/redis-5.0./src/redis-server路径为自己的路径
EXEC=/redis-5.0./src/redis-server
16行
修改/redis-5.0./src/redis-cli路径为自己的路径
CLIEXEC=/redis-5.0./src/redis-cli
19行
修改CONF="/redis-5.0.4/${REDISPORT}.conf"为自己的路径
CONF="/redis-5.0.4/${REDISPORT}.conf"
28行
在$EXEC $CONF 的后面添加 & ,$EXEC $CONF &
$EXEC $CONF

7:开启、关闭

开启
service redis start
关闭
service redis stop

8:进入redis

redis-cli

9:完成

常见问题:

因为设置密码,所以关闭失败

采用下面的方法进行让安装文件启动

redis-server /redis-5.0.4/6379.conf

然后已经启动了

使用密码进行登陆,看是否正确

redis-cli -h 127.0.0.1 -p  -a  password

Centos 6.x 安装 Redis的更多相关文章

  1. Redis学习笔记(1)- CentOS 6.4 安装Redis

    Redis学习笔记(1)- CentOS 6.4 安装Redis 2013.10.13     学习环境 vm 10.1 + 默认.新装的干净 CentOS 6.4  64BIT系统     准备 1 ...

  2. CentOS 7.3 安装redis 4.0.2服务

    CentOS 7.3 安装redis 4.0.2服务 1.下载解压 下载地址:/home/xiaoming/ wget http://download.redis.io/releases/redis- ...

  3. centos上如何安装redis?|centos傻瓜式安装redis教程

    本文介绍centos安装redis,请不要安装2.4.3,是有问题的. 首先安装gcc yum -y install gcc yum -y install gcc-c++ yum install ma ...

  4. 如何在 CentOS 7 上安装 Redis 服务器

    大家好,本文的主题是 Redis,我们将要在 CentOS 7 上安装它.编译源代码,安装二进制文件,创建.安装文件.在安装了它的组件之后,我们还会配置 redis ,就像配置操作系统参数一样,目标就 ...

  5. CentOS 7 服务器配置--安装Redis

    #下载Redis wget -r -np -nd http://download.redis.io/releases/redis-3.2.8.tar.gz #解压文件 tar zxvf redis-3 ...

  6. [从零开始搭网站八]CentOS使用yum安装Redis的方法

    1.由于centOS官方yum源里面没有Redis,这里我们需要安装一个第三方的yum源,这里用了fedora的epel仓库 yum install epel-release 安装过程中会有让你确认的 ...

  7. CentOS 7 yum 安装redis(更简单)

    一.安装redis 1.检查是否有redis yum 源 1 yum install redis 2.下载fedora的epel仓库 1 yum install epel-release 3.安装re ...

  8. redis学习之——CentOS 6 下载安装redis

    一.检查当前环境: 安装过程中没有这些,命令,在CentOS 6,最小安装导致..如果执行完命令,Noting  to  do...字样说明环境正常. yum -y install rpm gcc w ...

  9. CentOS 7 下安装redis步骤

    1. 从redis官网下载redis源码,本例安装在/usr/opt下 [root@localhost opt]# pwd /usr/opt [root@localhost opt]# wget ht ...

  10. centos 6.5 安装 redis

    下载软件: wget wget http://download.redis.io/releases/redis-2.8.7.tar.gz 2.解压软件并编译安装: tar -zxvf redis-2. ...

随机推荐

  1. Linux-3.14.12内存管理笔记【kmalloc与kfree实现】【转】

    本文转载自:http://blog.chinaunix.net/uid-26859697-id-5573776.html kmalloc()是基于slab/slob/slub分配分配算法上实现的,不少 ...

  2. C# nunit 单元测试

    1. 引包 nunit.framework.dll

  3. ZOJ - 3430 Detect the Virus —— AC自动机、解码

    题目链接:https://vjudge.net/problem/ZOJ-3430 Detect the Virus Time Limit: 2 Seconds      Memory Limit: 6 ...

  4. 创建一个HTML5与JQuery结合的幻灯片

    1. [代码][JavaScript]代码 $(window).load(function(){    //我们监听了 window.load 事件,因此我们确定幻灯片上的所有图片都能够正确进行加载. ...

  5. codeforces 569B B. Inventory(水题)

    题目链接: B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  6. leetcode 102 Binary Tree Level Order Traversal(DFS||BFS)

    Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...

  7. 从结果推断过程----->使用System.out和Root Device

    刚才解决了一个App中更新的逻辑问题.出问题之后发现,有很多处调用了更新,后来都不知道是哪里改写了SharedPreferences. 然后一直在挨个寻找每一处更新的地方,花了很多时间. 最后直接使用 ...

  8. poj3017 Cut the Sequence[平衡树+单调队列优化]

    这里已经讲得很清楚了. 本質上是決策點與區間最大值有一定關係,於是用单调队列来维护决策集合(而不是常规的),然后在决策集合中选取最小值. 然后觉得这题方法还是很重要的.没写平衡树,用优先队列(堆)来维 ...

  9. ACM学习历程——HDU2227 Find the nondecreasing subsequences(线段树 && dp)

    Description How many nondecreasing subsequences can you find in the sequence S = {s1, s2, s3, ...., ...

  10. DCloud-HTML5+:barcode

    ylbtech-DCloud:barcode&camera 1.返回顶部 1. http://www.html5plus.org/doc/zh_cn/barcode.html 2. Barco ...