下载redis安装包

wget http://download.redis.io/releases/redis-5.0.3.tar.gz

解压压缩包

tar -zxvf redis-5.0..tar.gz

yum安装gcc依赖

[root@iZwz991stxdwj560bfmadtZ local]# yum -y install gcc

跳转到redis解压目录下

cd redis-5.0.

编译

[root@iZwz991stxdwj560bfmadtZ redis-5.0.]# make MALLOC=libc

安装

[root@iZwz991stxdwj560bfmadtZ redis-4.0.]# cd src && make install
CC Makefile.dep Hint: It's a good idea to run 'make test' ;) INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install

测试是否能够启动redis

[root@iZwz991stxdwj560bfmadtZ src]# redis-server
:C Dec ::12.507 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
:C Dec ::12.507 # Redis version=4.0., bits=, commit=, modified=, pid=, just started
:C Dec ::12.507 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 4.0. (/) bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port:
| `-._ `._ / _.-' | PID: 18685
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' :M Dec ::12.508 # WARNING: The TCP backlog setting of cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of .
:M Dec ::12.508 # Server initialized
:M Dec ::12.508 # WARNING overcommit_memory is set to ! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
:M Dec ::12.508 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
:M Dec ::12.508 * Ready to accept connections

移动目录

sudo mv redis-5.0. /usr/local/redis

修改配置文件(后台运行)

sudo vi /usr/local/redis/redis.conf 

daemonize no

修改为

daemonize yes

使用配置文件启动

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

关闭redis

首先使用ps -aux | grep redis查看redis进程

[root@iZwz991stxdwj560bfmadtZ src]# ps -aux | grep redis
root 0.0 0.1 ? Ssl : : ./redis-server 127.0.0.1:
root 0.0 0.0 pts/ R+ : : grep --color=auto redis

使用kill命令杀死进程

[root@iZwz991stxdwj560bfmadtZ src]# kill -9 18714

客户端连接

[root@localhost bin]# redis-cli
127.0.0.1:>

参考:

https://www.cnblogs.com/zuidongfeng/p/8032505.html

Centos7 linux下通过源码安装redis以及使用的更多相关文章

  1. linux下通过源码安装git

    1.移除旧版本git [root@Git ~]# git --version ## 查看自带的版本git version 1.8.3.1 [root@Git ~]# yum remove git ## ...

  2. Linux下通过源码编译安装程序

    本文简单的记录了下,在linux下如何通过源码安装程序,以及相关的知识.(大神勿喷^_^) 一.程序的组成部分 Linux下程序大都是由以下几部分组成: 二进制文件:也就是可以运行的程序文件 库文件: ...

  3. 在CentOS7(虚拟机)下通过源码安装Postgresql10以及基本配置

    操作系统:CentOS7 安装文件:postgresql-10.0.tar.gz 系统环境:gcc.Python 1:源码安装 [postgres@localhost ~]# tar zxvf pos ...

  4. Linux下通过源码编译安装程序(configure/make/make install的作用,然后在/etc/profile文件里修改PATH环境变量)

    一.程序的组成部分 Linux下程序大都是由以下几部分组成: 二进制文件:也就是可以运行的程序文件 库文件:就是通常我们见到的lib目录下的文件 配置文件:这个不必多说,都知道 帮助文档:通常是我们在 ...

  5. 通过源码安装PostgresSQL

    通过源码安装PostgresSQL 1.1 下载源码包环境: Centos6.8 64位 yum -y install bison flex readline-devel zlib-devel yum ...

  6. 在centos6.7通过源码安装python3.6.7报错“zipimport.ZipImportError: can't decompress data; zlib not available”

    在centos6.7通过源码安装python3.6.7报错: zipimport.ZipImportError: can't decompress data; zlib not available 从 ...

  7. linux下python3源码安装及卸载

    Linux下Python3的源码编译安装和卸载方法 [日期:2019-06-21] 来源:博客园  作者:wuli潇萧 [字体:大 中 小]     (一)Linux下软件的源码编译安装和卸载方法 L ...

  8. Ubuntu 14.04 卸载通过源码安装的库

    cd cere-solvermkdir buildcd buildcmake ..sudo makesudo make install 卸载通过以上方式源码安装的库 再次进入buildsudo mak ...

  9. 【Git】CentOS7 通过源码安装Git

    yum源仓库里的Git版本更新不及时,最新版的Git是1.8.3,但是官方的最新版早已经更新到2.9.5.想要安装最新版本Git,只能下载源码进行安装 建议最好更新git为较新版本,便于使用 1.查看 ...

随机推荐

  1. SQL Server 2012中的AlwaysOn尝试

      简介 SQL Server2012中新增的AlwaysOn是一个新增高可用性解决方案.在AlwaysOn之前,SQL Server已经有的高可用性和数据恢复方案,比如数据库镜像,日志传送和故障转移 ...

  2. java初学者必看的学习路线

    不管在编程语言的排行榜中,还是在大多数企业应用的广泛程度来看,Java一直都是当之无愧的榜首.Java语言有着独特的魅力吸引着广大的年轻人去学习,每个人学习的方式方法不一样. 第一步:首先要做好学习前 ...

  3. 简单的图像显著性区域特征提取方法-----opencv实现LC,AC,FT

    https://blog.csdn.net/cai13160674275/article/details/72991049?locationNum=7&fps=1 四种简单的图像显著性区域特征 ...

  4. sitemap index

    https://docs.djangoproject.com/en/2.1/ref/contrib/sitemaps/ very good

  5. sqlalchemy 多对多关系

    # -*- coding: utf-8 -*- from sqlalchemy import Column, String, create_engine,ForeignKey,Text,Integer ...

  6. BeanUtils工具的使用

    beanutils的下载地址:http://commons.apache.org/proper/commons-beanutils/download_beanutils.cgi 该压缩包有测试的代码: ...

  7. MyBatis批量更新

    逐条更新 这种方式显然是最简单,也最不容易出错的,即便出错也只是影响到当条出错的数据,而且可以对每条数据都比较可控. 代码 updateBatch(List<MyData> datas){ ...

  8. mycat->oracle报java.sql.SQLException: 无法从套接字读取更多的数据

    今天下午,测试环境清算的时候又出现了之前的一个异常,这次把错误信息全部打出来了,java.sql.SQLException: 无法从套接字读取更多的数据,是使用mycat连接oracle的,如下所示: ...

  9. python之面向对象的高级进阶

    一 .isinstance(obj,cls)和issubclass(sub,super) isinstance(obj,cls)检查是否obj是否是类 cls 的对象 class Foo(object ...

  10. IIS W3C日志记录字段和HTTP状态代码的说明

    像新网的部分服务器ftp目录有这个文件,但是就是提示没权限查看也没有权限下载,还得必须给他们打电话才能要到. 做为网站拥有者,我们应该关注IIS日志,从里面我们不仅仅可以看到网站的访问记录和搜索引擎的 ...