Centos7安装redis5.0.7
1. 安装依赖包(Redis是C语言开发,需要安装gcc依赖环境)
yum install -y gcc gcc-c++
2. 下载最新版redis安装包并解压安装
cd /usr/local/src
wget http://download.redis.io/releases/redis-5.0.7.tar.gz tar -zxvf redis-5.0.7.tar.gz
mkdir -p /usr/local/redis/{etc,data}
cd redis-5.0.7/ #指定redis使用哪种内存分配器,目前有jemalloc,tcmalloc,libc
#jemalloc是facebook推出的,https://github.com/jemalloc/jemalloc#tcmalloc是Google推出的,https://github.com/gperftools/gperftools#libc是标准的内存分配库malloc和free
#具体使用哪种自己可以调整下面参数对比下
make MALLOC=libc
make install PREFIX=/usr/local/redis ln -s /usr/local/src/redis-5.0.7/redis.conf /usr/local/redis/redis.conf #创建日志文件
touch /var/log/redis/6379.log
3. 打开 redis.conf 并更改配置文件
更改密码
# requirepass foobared
requirepass xxx 允许后台静默运行
#daemonize no
daemonize yes 更改日志文件
#logfile ""
logfile "/var/log/redis/6379.log"
4. 增加启动服务脚本
新增配置文件
touch /usr/lib/systemd/system/redis.service redis.service内容如下:
[Unit]
Description=Redis
After=syslog.target network.target
[Service]
Type=forking
PrivateTmp=yes
Restart=always
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf
ExecStop=/usr/local/redis/bin/redis-cli -h 127.0.0.1 -p -a jcon shutdown User=root Group=root LimitCORE=infinity LimitNOFILE= LimitNPROC= [Install] WantedBy=multi-user.target
重新加载redis服务配置文件systemctl daemon-reload
启动redis
systemctl start redis
停止redis
systemctl stop redis
重启redis
systemctl restart redis
加入开机启动
systemctl enable redis
禁止开机启动
systemctl disable redis
查看状态
systemctl status redis
Centos7安装redis5.0.7的更多相关文章
- CentOS7安装redis5.0
下载好redis5.0后解压在/tmp目录 cd /tmp/redis-/ make make过程中可能出现make[1]: *** [adlist.o] 错误 127,这是因为CentOS7默认没有 ...
- centos7安装Redis5.0.5
1.下载redismkdir /home/redis/cd /home/redis/wget http://download.redis.io/releases/redis-5.0.5.tar.gzt ...
- Centos7安装Redis5.0.5并加入Systemd服务
1. 安装gcc-c++, tcl yum install gcc-c++ tcl 2. 解压缩, 编译, 测试 tar zxvf redis-5.0.5.tar.gz make make test ...
- Centos7安装Redis5.0.3
1.切换目录 cd tmp 2.下载 wget http://download.redis.io/releases/redis-5.0.3.tar.gz 3.解压,删除压缩包 tar xzf redi ...
- CentOS7下编译安装redis-5.0.9
CentOS7下编译安装redis-5.0.9 本文地址http://yangjianyong.cn/?p=171转载无需经过作者本人授权 下载redis #code start wget https ...
- CentOS7.6下安装Redis5.0.7
此次安装是在CentOS7下安装Redis5.0.7 一.首先准备Redis安装包 这里下载的是 redis-5.0.7.tar.gz 安装包,并将其直接放在了 root ⽬录下 压缩包下载地址:ht ...
- CentOS7源码安装Redis5.0.4非关系型数据库
源码安装redis-5.0.4 一. 下载redis 1. 需要连接网络 二. 案例(另一种安装方法) [root@localhost ~]# wget http://download.redis.i ...
- centos7安装redis3.0和phpredis扩展详细教程(图文)
整理一下centos7安装redis3.0和phpredis扩展的过程,有需要的朋友可以拿去使用. 一.安装redis3.0 1.安装必要的包 yum install gcc 2.centos7安装r ...
- CentOS6.10安装redis5.0
1.以安装redis5.0.0为例 下载安装包:http://redis.io 安装非常简单! [root@centos6 ~]#yum install gcc #需要先安装GCC,如果已安装请忽略 ...
随机推荐
- 第三方软件 Serv-u提权
Serv-U FTP Server,是一种被广泛运用的FTP服务器端软件,支持3x/9x/ME/NT/2K等全Windows系列.可以设定多个FTP服务器.限定登录用户的权限.登录主目录及空间大小等 ...
- linux-scp命令及如何设置免密登录
部署测试环境时经常在两台服务器间copy文件,那么如何设置免密登录? 场景:源服务器A(如172) -> 目标服务器B(如71) 实现将服务器A的文件copy到服务器B 实现方式有两种: 在源 ...
- Vue躬行记(4)——组件
组件是可复用的Vue实例,拥有属于自己的数据.模板.脚本和样式,可避免繁重的重复性开发.由于组件都是独立的,因此其内部代码不会影响其它组件,但可以包含其它组件,并且相互之间还能通信. 一.注册 在使用 ...
- ggstatsplot绘图|统计+可视化,学术科研神器
本文首发于“生信补给站”公众号,https://mp.weixin.qq.com/s/zdSit97SOEpbnR18ARzixw 更多关于R语言,ggplot2绘图,生信分析的内容,敬请关注小号. ...
- CSS 阴影动画优化技巧一则
本技巧来自这篇文章 -- How to animate box-shadow with silky smooth performance 本文不是直译,因为觉得这个技巧很有意思很有用,遂起一文. bo ...
- Element filtername is not allowed here-web.xml version="3.0"-intellij idea
Element filtername is not allowed here-web.xml version="3.0"-intellij idea Intellij IDEA 报 ...
- Unity常用协程功能封装
# 1.前言unity开发过程中,经常用到一些特定的协程功能,比如延时触发.等待触发.重复操作等.unity自带Invoke以及InvokeRepeating方法,但这些方法均采用反射机制,性能消耗, ...
- django-表单之手动渲染(五)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Unity资源加载路径及加载方式小结
Unity3D中的资源路径路径属性 路径说明Application.dataPath 此属性用于返回程序的数据文件所在文件夹的路径.例如在Editor中就是Assets了.Application.st ...
- xss代码集
</script>"><script>prompt(1)</script> </ScRiPt>"><ScRiPt& ...