1.下载和安装

在我安装的虚拟机中,我把所有自己安装的软件都放在了/ph/install 目录下,具体以自己实际情况为准。

[root@localhost ~]$ cd /ph/install    #进入到自己创建的安装目录下
#下载压缩包
[root@localhost ~]$ wget http://download.redis.io/releases/redis-5.0.0.tar.gz
#解压缩
[root@localhost ~]$ tar -zxvf redis-5.0.0.tar.gz -C /ph/install/ #安装gcc基础环境, 可以先查看是否安装过: gcc --version
[root@localhost ~]$ yum -y install gcc
[root@localhost ~]$ yum -y install gcc-c++ #编译redis
[root@localhost ~]$ cd /ph/install/redis-5.0.0
[root@localhost redis-5.0.0]$ make MALLOC=libc #安装
[root@localhost redis-5.0.0]$ cd src
[root@localhost src]$ make install #查看是否安装成功, 输入命令: "ll |grep redis-" 如果显示信息如下所示, 就是安装成功
[root@localhost src]$ ll |grep redis-
-rwxr-xr-x. 1 root root 353848 6月 26 18:30 redis-benchmark
-rw-rw-r--. 1 root root 29605 10月 17 2018 redis-benchmark.c
-rw-r--r--. 1 root root 109104 6月 26 18:30 redis-benchmark.o
-rwxr-xr-x. 1 root root 4016272 6月 26 18:30 redis-check-aof
-rw-rw-r--. 1 root root 7143 10月 17 2018 redis-check-aof.c
-rw-r--r--. 1 root root 28744 6月 26 18:30 redis-check-aof.o
-rwxr-xr-x. 1 root root 4016272 6月 26 18:30 redis-check-rdb
-rw-rw-r--. 1 root root 13541 10月 17 2018 redis-check-rdb.c
-rw-r--r--. 1 root root 65872 6月 26 18:30 redis-check-rdb.o
-rwxr-xr-x. 1 root root 771056 6月 26 18:30 redis-cli
-rw-rw-r--. 1 root root 249486 10月 17 2018 redis-cli.c
-rw-r--r--. 1 root root 871040 6月 26 18:30 redis-cli.o
-rwxr-xr-x. 1 root root 4016272 6月 26 18:30 redis-sentinel
-rwxr-xr-x. 1 root root 4016272 6月 26 18:30 redis-server
-rwxrwxr-x. 1 root root 3600 10月 17 2018 redis-trib.rb

2.配置文件修改

#进入到 /ph/install/redis-5.0.0/ 目录下
[root@localhost /]$ cd /ph/install/redis-5.0.0/ #创建配置文件的文件夹 和 数据的文件夹
[root@localhost redis-5.0.0]$ mkdir conf
[root@localhost redis-5.0.0]$ mkdir data #将默认配置文件复制一份到conf文件夹下, 同时备份一份
[root@localhost redis-5.0.0]$ cp redis.conf conf/
[root@localhost redis-5.0.0]$ cp redis.conf conf/redis.conf.back

3.redis启动

#进入到 redis-5.0.0/src 目录下, 启动redis服务, &符号表示后台运行, 能够看到如下图所示,启动成功
[root@localhost redis-5.0.0]$ cd src
[root@localhost src]$ ./redis-server ../redis.conf & 9818:M 26 Jun 2020 19:02:20.243 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.0 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 9818
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' 9818:M 26 Jun 2020 19:02:20.244 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. #ctrl + c 回退到命令行出, 查看进程, 如下所示就证明
[root@localhost src]$ ps -ef|grep redis
root 9818 7878 0 19:02 pts/0 00:00:00 ./redis-server 0.0.0.0:6379
root 9832 7878 0 19:02 pts/0 00:00:00 grep --color=auto redis

4.客户端连接

#本地连接, 如下表示连接成功
[root@localhost conf]$ redis-cli
127.0.0.1:6379>
127.0.0.1:6379>
127.0.0.1:6379> #连接远程redis
[root@localhost conf]$ redis-cli –h 61.129.65.248 –p 6384

5.配置文件修改和再次启动

#将redis-6379.conf中的注释等都处理掉
[root@localhost redis-5.0.0]$ cd conf
[root@localhost conf]$ cat redis.conf|grep -Ev '^$|#' > redis-6379.conf #进入到conf文件夹对redis-6379.conf文件进行修改
[root@localhost conf]$ vim redis-6379.conf #bind 127.0.0.1 允许外网访问
#bind 0.0.0.0
bind 192.168.23.129 #后台启动
daemonize yes #日志文件
logfile "redis-6379.log" #数据文件夹设置
dir /ph/install/redis-5.0.0/data #:wq 保存退出 #关闭redis 服务
[root@localhost conf]$ ps -ef|grep redis
root 9818 7878 0 19:02 pts/0 00:00:02 ./redis-server 0.0.0.0:6379
root 10675 7878 0 19:45 pts/0 00:00:00 grep --color=auto redis
[root@localhost conf]$
[root@localhost conf]$ kill -9 9818 #再次启动并加载修改后的配置 redis-6379.conf
[root@localhost conf]$ redis-server redis-6379.conf #查看进程是否存在, 如下启动成功
[root@localhost conf]$ ps -ef|grep redis
root 10734 1 0 19:47 ? 00:00:00 redis-server 0.0.0.0:6379
root 10739 7878 0 19:47 pts/0 00:00:00 grep --color=auto redis
[root@localhost conf]$

基于CentOS-7的redis下载和安装的更多相关文章

  1. CentOS 下 Java 的下载、安装、配置

    CentOS 下 Java 的下载.安装.配置 系统: CentOS 7 x86_64 Java 版本: 1.8.0_171 本文将 Java 目录放在 /usr/local/java 文件夹下,读者 ...

  2. 【转】CentOS 7.3 从下载到安装

    CentOS 7.3 从下载到安装  https://blog.csdn.net/sxy2475/article/details/75194142 [百度知道]图解CentOS 7.3安装步骤  ht ...

  3. Redis下载及安装部署

    官网介绍:Redis is an open source advanced key-value store.It is often referred to as a data structure se ...

  4. Windows上redis下载与安装

    一.redis是什么 非关系型内存数据库,以key-value的形式将数据储存在内存中.Mysql是关系型数据库,数据是保存在硬盘中 二.redis下载安装 1.要安装Redis,首先要获取安装包. ...

  5. Redis 下载与安装(Windows版)

    下载 1.Github下载地址:https://github.com/MicrosoftArchive/redis/releases 2.百度网盘下载地址:Redis-x64-3.2.100.zip  ...

  6. 基于CentOS系统下的Oracle的安装

    背景 最近的数据库的实验课,要求利用虚拟机安装CentOS系统,并在此系统上安装Oracle_11g软件实现监听,在windows系统上安装SQL Developer软件作为客户端 ,从而可以在SQL ...

  7. redis下载及安装服务

    1 . 要安装Redis,首先要获取安装包. Windows的Redis安装包需要到以下GitHub链接找到. 链接:https://github.com/MSOpenTech/redis 打开网站后 ...

  8. Redis下载及安装(windows版)

    下载地址1.Github下载地址:https://github.com/MicrosoftArchive/redis/releases2.百度网盘下载地址 https://pan.baidu.com/ ...

  9. 基于centos 创建stress镜像——源码安装stress

    上一篇文章进行了yum安装stress,这次对stress进行源码编译安装,并且生成新的镜像 创建Dockerfile目录 [vagrant@localhost ~]$ mkdir -p /tmp/s ...

随机推荐

  1. C/C++内存对齐详解

    1.什么是内存对齐 还是用一个例子带出这个问题,看下面的小程序,理论上,32位系统下,int占4byte,char占一个byte,那么将它们放到一个结构体中应该占4+1=5byte:但是实际上,通过运 ...

  2. CTFshow萌新赛-千字文

    打开靶机 下载完成后,为一张二维码图片 使用StegSolve 解出隐写图像 保存后使用PS或其他工具去除白边 然后使用脚本分割这个图像(25*25) from PIL import Image im ...

  3. 【九阳神功】Nessus 8_VM不限IP及AWVS破解版合体部署

    Nessus 8下载地址: https://moehu-my.sharepoint.com/personal/ximcx_moebi_org/_layouts/15/download.aspx?Sou ...

  4. powershell中的cmdlet命令

    Add-Computer 向域或工作组中添加计算机. Add-Content 向指定的项中添加内容,如向文件中添加字词. Add-History 向会话历史记录追加条目. Add-Member 向 W ...

  5. 05--Docker对DockerFile解析

    一.是什么: 1.1 DockerFile是用来构建Docker镜像的构建文件,是由一系列命令和参数构成的脚本 1.2 构建步骤: 1.2.1 编写Dockerfile文件 1.2.2 docker ...

  6. css animation @keyframes 动画

    需求:语音播放动态效果 方案:使用如下图片,利用 css animation @keyframes  做动画 html <span class="horn" :class=& ...

  7. 学习Python之路

    陆续学习python已经有一段时间了,但是真正的安下心来学习还是在最近的一个月时间里,虽然每天学习的时间很有限,但是通过点滴的学习让自己感到从未有过的充实,完全打掉了以往认学学习一门语言难于登天的心理 ...

  8. 洛谷P4180

    被教练安排讲题 可恶 这道题我是十月初上课时花了一下午做出来的,当时连倍增都不会,过程比较困难,现在看看还可以 本来想口胡一发,后来想了想可能以后要用,还是写成文章吧 Description 求一棵严 ...

  9. qbxt 学习笔记 10.2 晚

    目录 整除性 素数 组合数 Lucas 定理: 整除性 直接搬 ppt 特殊的整除性质 素数 素数定理: 线性筛: 原理:一个合数只由其最大素因子筛去. 代码: 组合数 Lucas 定理: \[\bi ...

  10. 五:SpringBoot-多个拦截器配置和使用场景

    SpringBoot-多个拦截器配置和使用场景 1.拦截器简介 1.1 拦截器中应用 2.拦截器用法 2.1 编写两个拦截器 2.1.1 OneInterceptor 拦截器 2.1.2 TwoInt ...