1.首先上传安装包,这里我以 redis-5.0.8.tar.gz 为例子。

Linux下载redis地址:wget http://download.redis.io/releases/redis-5.0.8.tar.gz

先在opt目录下建立一个软件包上传文件夹  mkdir  /opt/software

把 redis-5.0.8.tar.gz 上传到 /opt/software/

2.下载Redis安装依赖编译环境

 yum -y install gcc gcc-c++ 安装gcc编译环境,用来执行make命令

3.在/opt/software/下使用命令

    tar -xzvf redis-5.0.8.tar.gz

4.把解压的redis源码文件移动到/usr/local/src/目录下

mv /opt/software/redis-5.0.8  /usr/local/src/

5.进入到 /usr/local/src/redis-5.0.8 目录下输入make命令进行源码的编译

 make

6.之后进入/usr/local/src/redis-5.0.8/src/下,输入如下命令,目的是给redis安装指定目录

make install PREFIX=/usr/local/redis

7.建立一个文件夹用来处方自定义的redis.conf 文件

mkdir /etc/redis/

8.把 /usr/local/src/redis-5.0.8/redis.conf 复制到 /etc/redis/

  cp  /usr/local/src/redis-5.0.8/redis.conf   /etc/redis/

9.修改 /etc/redis/redis.conf 配置文件

 vim  /etc/redis/redis.conf 

10.核心redis.conf 配置修改代码如下:

bind 0.0.0.0
protected-mode no
port
tcp-backlog
timeout
tcp-keepalive
daemonize yes
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile /var/log/redis/redis_master.log
databases
always-show-logo yes
save
save
save
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /opt/redis_data
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay
repl-disable-tcp-nodelay no
replica-priority
maxmemory 10000000kb
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit
slowlog-log-slower-than
slowlog-max-len
latency-monitor-threshold
notify-keyspace-events ""
hash-max-ziplist-entries
hash-max-ziplist-value
list-max-ziplist-size -
list-compress-depth
set-max-intset-entries
zset-max-ziplist-entries
zset-max-ziplist-value
hll-sparse-max-bytes
stream-node-max-bytes
stream-node-max-entries
activerehashing yes
client-output-buffer-limit normal
client-output-buffer-limit replica 256mb 64mb
client-output-buffer-limit pubsub 32mb 8mb
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes

可以把我的配置配置文件进行复制到你的配置文件中。

11.配置文件中有的路径需要建立相应目录

1.mkdir  /var/log/redis/

    2.mkdir  /opt/redis_data

12.开始运行redis

/usr/local/redis/bin/redis-server  /etc/redis/redis.conf 

13.检测后台进程是否存在

 ps -ef |grep redis

14.使用客户端可以进行测试了

 /usr/local/redis/bin/redis-cli   回车

15.关闭redis

redis-cli shutdown

16.强制关闭redis

  kill -9  PID(你的进程ID,通过这个命令进行查询ps -ef |grep redis )

或者 pkill redis

Redis在CentOS for LInux上安装详细教程的更多相关文章

  1. Centos(Linux)安装openoffice教程

    一.从官网下载openoffice软件 下载地址:http://www.openoffice.org/zh-cn/download/ 选择(RPM)类型进行下载,选择对应的版本,这里默认选择是最新的版 ...

  2. CentOS(Linux)安装KETTLE教程 并配置执行定时任务

    1,首先是安装jdk,并设置环境变量 采用yum安装可不设置环境变量 2,下载kettle https://sourceforge.net/projects/pentaho/files/Data%20 ...

  3. Linux上安装JDk教程

    使用如下命令 uname –a.如果输出结果中含有X86_64,表明系统是64位的,如果出现i686,证明系统是32位的. 没有安装包,就去官网下载 http://www.oracle.com/tec ...

  4. 记录CentOS 7.4 上安装MySQL&MariaDB&Redis&Mongodb

    记录CentOS 7.4 上安装MySQL&MariaDB&Redis&Mongodb 前段时间我个人Google服务器意外不能用,并且我犯了一件很低级的错误,直接在gcp讲服 ...

  5. Redis之在Linux上安装和简单的使用

    我只是一个搬运工 Redis之在Linux上安装和简单的使用https://blog.csdn.net/qq_20989105/article/details/76390367 一.安装gcc 1.R ...

  6. Linux系统下Redis单机版的安装详细教程

    Linux系统下Redis单机版的安装详细教程 1.下载软件安装包并上传到root目录 这里以旧版本的3.0进行安装,比较成熟稳定,具体软件可以通过qq群534073451文件下载

  7. CentOS Linux上安装Oracle11g笔记

    CentOS Linux上安装Oracle11g 到 otn.oracle.com 网站上下载 Linux版的oracle 11g 编辑 /etc/sysctl.conf : kernel.shmal ...

  8. linux上安装redis的踩坑过程2

    昨天在linux上安装redis后马上发现了其它问题,服务器很卡,cpu使用率上升,top命令查看下,原来有恶意程序在挖矿,此程序入侵了很多redis服务器,马上用kill杀掉它 然后开始一些安全策略 ...

  9. linux上安装redis的踩坑过程

    redis用处很广泛,我不再啰嗦了,我按照网上教程想在linux上安装下,开始了踩坑过程,网上买了一个linux centos7.3,滴滴云的,巨坑无比啊,不建议大家用这家的! redis 为4.0, ...

随机推荐

  1. hdu3861他的子问题是poj2762二分匹配+Tarjan+有向图拆点 其实就是求DAG的最小覆盖点

    The King’s Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Other ...

  2. ASP.NET Core on K8S学习之旅(14)Ingress灰度发布

    本篇已加入<.NET Core on K8S学习实践系列文章索引>,可以点击查看更多容器化技术相关系列文章. 之前一篇介绍了Ingress的基本概念和Nginx Ingress的基本配置和 ...

  3. web自动化之iframe操作

    from selenium import webdriver from selenium.webdriver.support.wait import WebDriverWait from seleni ...

  4. 哥德巴赫猜想 Java实现

    1.接口实现 package goldbach; /** * 输入一个大于6的偶数,请输出这个偶数能被分解为哪两个质数的和.如:10=3+7 12=5+7 * 此为按接口实现类完成 * * @auth ...

  5. Docker部署nginx,tomcat,es,可视化

    nginx [root@iz2zeaet7s13lfkc8r3e2kz /]# docker pull nginx #下载 Using default tag: latest latest: Pull ...

  6. [Android应用开发] 04.页面跳转和数据传输

    *:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...

  7. [PHP学习教程 - 系统]002.模拟守护进程(Daemon)-程序永远在后台运行

    引言:如何模拟那些自动轮循的服务,像守护进程(Daemon)那样,可以一直执行,永不停歇呢! Come on! Do it! Do! Do! Do!.... 使用接口: int ignore_user ...

  8. [JavaWeb基础] 015.Struts2 表单验证框架

    在web开发的过程中,我们经常要用到一些填写表单的操作,我们一般都要在提交表单信息的时候对表单的内容进行验证,struts2给我们提供了简单的实现接口,让我们可以很容易的对表单进行验证.下面讲解下最传 ...

  9. [PHP插件教程]002.代码包PHP Beautifier的使用

    This program reformat and beautify PHP source code files automatically. The program is Open Source a ...

  10. C/C++代码优化之求两个整型的平均值

    在 C/C++ 中, 直接利用 (x + y) >> 1 来计算 \(\left\lfloor {\left( {x + y} \right)/2} \right\rfloor\) (两个 ...