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.查看 ...
随机推荐
- node 读取多个文件、合并多个文件、读写多个文件
一.读取文件 1.找文件中匹配的内容 let fs = require('fs') let content = fs.readFileSync('/Users/**/desktop/Test.txt' ...
- nfs共享文件搭建
Linux NFS服务器的安装与配置详解 一.NFS服务简介 NFS是Network File System(网络文件系统).主要功能是通过网络让不同的服务器之间可以共享文件或者目录.NFS客户端 ...
- Django高级
一 登录装饰器 def login_required(view_func): '''登录判断装饰器''' def wrapper(request, *view_args, **view_kwargs) ...
- 在虚拟机上安装gho、esd(wim)系统镜像文件
gho.esd(wim)等文件不能被虚拟机识别,但如果把它们打包成iso就可以了. 另外,还需用到能在虚拟机上运行的WinPE的iso文件,本文用的是微PE. 注意:安装虚拟机提示operating ...
- P4577 [FJOI2018]领导集团问题
P4577 [FJOI2018]领导集团问题 我们对整棵树进行dfs遍历,并用一个multiset维护对于每个点,它的子树可取的最大点集. 我们遍历到点$u$时: 不选点$u$,显然答案就为它的所有子 ...
- P2709 小B的询问(莫队)
P2709 小B的询问 莫队模板 资磁离线询问 维护两个跳来跳去的指针 先分块,蓝后询问按块排序. 蓝后每次指针左右横跳更新答案 #include<iostream> #include&l ...
- bzoj2152 / P2634 [国家集训队]聪聪可可(点分治)
P2634 [国家集训队]聪聪可可 淀粉质点分治板子 边权直接 mod 3 直接点分治统计出所有的符合条件的点对再和总方案数约分 至于约分.....gcd搞搞就好辣 #include<iostr ...
- phpstorm激活大全--持续更新(支持2018最新版)
方法一. 通过Licence Server 激活PHPStorm(快速) 方法原理是通过搭建服务器激活,不过网上有许多搭建好的. http://idea.goxz.gq http://v2mc.net ...
- yum指定安装目录
纯粹做笔记 yum -c /etc/yum.conf --installroot=/opt/test/ --releasever=/ install lrzsz
- linux判断文件大小
第一条code ll -s | tail -n +2 | awk '$1 >= 10 {print $1,$10 "容量大于10"} $1 <= 9 {print $1 ...