Centos7 linux下通过源码安装redis以及使用
下载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以及使用的更多相关文章
- linux下通过源码安装git
1.移除旧版本git [root@Git ~]# git --version ## 查看自带的版本git version 1.8.3.1 [root@Git ~]# yum remove git ## ...
- Linux下通过源码编译安装程序
本文简单的记录了下,在linux下如何通过源码安装程序,以及相关的知识.(大神勿喷^_^) 一.程序的组成部分 Linux下程序大都是由以下几部分组成: 二进制文件:也就是可以运行的程序文件 库文件: ...
- 在CentOS7(虚拟机)下通过源码安装Postgresql10以及基本配置
操作系统:CentOS7 安装文件:postgresql-10.0.tar.gz 系统环境:gcc.Python 1:源码安装 [postgres@localhost ~]# tar zxvf pos ...
- Linux下通过源码编译安装程序(configure/make/make install的作用,然后在/etc/profile文件里修改PATH环境变量)
一.程序的组成部分 Linux下程序大都是由以下几部分组成: 二进制文件:也就是可以运行的程序文件 库文件:就是通常我们见到的lib目录下的文件 配置文件:这个不必多说,都知道 帮助文档:通常是我们在 ...
- 通过源码安装PostgresSQL
通过源码安装PostgresSQL 1.1 下载源码包环境: Centos6.8 64位 yum -y install bison flex readline-devel zlib-devel yum ...
- 在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 从 ...
- linux下python3源码安装及卸载
Linux下Python3的源码编译安装和卸载方法 [日期:2019-06-21] 来源:博客园 作者:wuli潇萧 [字体:大 中 小] (一)Linux下软件的源码编译安装和卸载方法 L ...
- Ubuntu 14.04 卸载通过源码安装的库
cd cere-solvermkdir buildcd buildcmake ..sudo makesudo make install 卸载通过以上方式源码安装的库 再次进入buildsudo mak ...
- 【Git】CentOS7 通过源码安装Git
yum源仓库里的Git版本更新不及时,最新版的Git是1.8.3,但是官方的最新版早已经更新到2.9.5.想要安装最新版本Git,只能下载源码进行安装 建议最好更新git为较新版本,便于使用 1.查看 ...
随机推荐
- Pony 编程语言介绍
Pony,一种“Rust 遇上 Erlang”的语言,让开发快捷.安全.高效.高并发的程序更简单. 在 Wallaroo Labs,我是工程副总裁,我们正在构建一个用 Pony 编程语言编写的 高性能 ...
- 了解Redis过期策略及实现原理
我们在使用redis时,一般会设置一个过期时间,当然也有不设置过期时间的,也就是永久不过期. 当我们设置了过期时间,redis是如何判断是否过期,以及根据什么策略来进行删除的. redis设置过期时间 ...
- java-工厂方法模式学习笔记
1.工厂模式分三种 1.1 普通工厂模式:就是建立一个工厂类,对实现了同一接口的一些类进行实例创建,如下图所示: 就以老司机开车(土豪开奔驰,宝马:屌丝骑自行车)为例,说明一下普通工厂模式: 首先,创 ...
- P3366 【模板】最小生成树(boruvka/sollin)
P3366 [模板]最小生成树 boruvka/sollin 复杂度$O(mlogn)$ 简要说明一下过程 引入一个数组$link[i]$表示连通块$i$下一步可更新的最短的边的编号 1.每次枚举所有 ...
- golang中tcp socket粘包问题和处理
转自:http://www.01happy.com/golang-tcp-socket-adhere/ 在用golang开发人工客服系统的时候碰到了粘包问题,那么什么是粘包呢?例如我们和客户端约定数据 ...
- 11: python中的轻量级定时任务调度库:schedule
1.1 schedule 基本使用 1.schedule 介绍 1. 提到定时任务调度的时候,相信很多人会想到芹菜celery,要么就写个脚本塞到crontab中. 2. 不过,一个小的定时脚本,要用 ...
- nginx的stream反向代理mysql配置
这里主要记录一下nginx的负载代理stream模块,首先编译的时候需要加上--with-stream, 就像这样 然后nginx.conf里面的配置是在http选项上面加上 #Mysql Rever ...
- php 常用代码片断
参考: https://www.jianshu.com/p/f5303225ef92 http://www.phpxs.com/code/php/
- shell脚本之 给PNG图片添加后缀@3x
1,给png图片加上后缀@3x #!/bin/sh #root_src=$(dirname $(PWD)) #echo ${root_src} image_path=${root_src}/image ...
- topcoder srm 315 div1
problem1 link 直接模拟即可. import java.util.*; import java.math.*; import static java.lang.Math.*; publi ...