CentOS7下编译安装redis-5.0.9

本文地址http://yangjianyong.cn/?p=171转载无需经过作者本人授权

下载redis

#code start

wget https://download.redis.io/releases/redis-5.0.9.tar.gz

#code end

解压

#code start

tar -zxvf redis-5.0.9.tar.gz

#code end

安装

#code start

cd redis-5.0.9

make && make install

#code end

最后出现如下代码表示成功,路径根据自己的环境可能不同

#code start

Hint: It's a good idea to run 'make test' ;)

make[1]: Leaving directory `/docker_share/redis-5.0.9/src'
cd src && make install
make[1]: Entering directory `/docker_share/redis-5.0.9/src'
CC Makefile.dep
make[1]: Leaving directory `/docker_share/redis-5.0.9/src'
make[1]: Entering directory `/docker_share/redis-5.0.9/src' Hint: It's a good idea to run 'make test' ;) INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL install
make[1]: Leaving directory `/docker_share/redis-5.0.9/src' #code end

配置

复制配置文件到/etc/下

#code start

cp redis.conf /etc/

#code end

新建日志文件地址

#code start

cd /var/log

mkdir redis

cd redis

touch redis.log

#code end

复制redis执行文件到/usr/bin/下

#code start

cd src

cp redis-cli redis-benchmark redis-server /usr/bin

#code end

修改默认配置文件

#code start

vim /etc/redis.conf

#修改默认客户端最长连接时间。修改为30分钟
timeout 1800 #修改以守护进程的方式启动。默认为no
daemonize yes # 设置日志文件的地址,跟上面的设置地址一样
logfile "/var/log/redis/redis.log" #允许其他机器上的客户端连接当前redis
protected-mode no #修改redis密码
requirepass redisPassword #code end

设置开机启动

#code start

vim /usr/lib/systemd/system/redis.service

#启动代码
[Unit]
Description=Redis persistent key-value database
After=network.target
After=network-online.target
Wants=network-online.target [Service]
ExecStart=/usr/bin/redis-server /etc/redis.conf
ExecStop=/usr/bin/redis-cli shutdown
#Restart=always
Type=forking
#User=redis
#Group=redis
RuntimeDirectory=redis
RuntimeDirectoryMode=0755 [Install]
WantedBy=multi-user.target #code end

设置开机启动并启动redis

#code start

#开机启动
systemctl enable redis #启动redis
systemctl start redis #code end

启动redis

#code start

systemctl start redis

#code end

查看redis日志

#code start

cd /var/log/redis

cat redis.log

#code end

显示日志内容如下

#code start

8118:C 03 Apr 2021 04:38:52.898 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
8118:C 03 Apr 2021 04:38:52.898 # Redis version=5.0.9, bits=64, commit=00000000, modified=0, pid=8118, just started
8118:C 03 Apr 2021 04:38:52.898 # Configuration loaded
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.9 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 8119
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' 8119:M 03 Apr 2021 04:38:52.901 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
8119:M 03 Apr 2021 04:38:52.902 # Server initialized
8119:M 03 Apr 2021 04:38:52.902 # 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.
8119:M 03 Apr 2021 04:38:52.902 * Ready to accept connections #code end

欢迎来我的博客逛一逛 杨建勇的个人博客http://yangjianyong.cn

CentOS7下编译安装redis-5.0.9的更多相关文章

  1. centos7下编译安装nginx-1.16.0

    一.下载nginx源码 http://nginx.org/en/download.html 如:nginx-1.16.0.tar.gz 二.创建用户和组,并解压 groupadd www userad ...

  2. centos7下编译安装php-7.0.15(PHP-FPM)

    centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...

  3. 在CUDA8.0下编译安装OpenCV3.1.0来实现GPU加速(Compiling OpenCV3.1.0 with CUDA8.0 support)

    在CUDA8.0下编译安装OpenCV3.1.0 一.本人电脑配置:ubuntu 14.04, NVIDIA GTX1060. 二.编译OpenCV3.1.0前,读者需要成功安装CUDA8.0(网上有 ...

  4. Ubuntu16.04下编译安装OpenCV3.4.0(C++ & python)

    Ubuntu16.04下编译安装OpenCV3.4.0(C++ & python) 前提是已经安装了python2,python3 1)安装各种依赖库 sudo apt-get update ...

  5. centos7下编译安装redis5.05

    准备环境: 1.一台centos7机器,配置没有什么要求(能联网) 2.下载好redis压缩包 下载redis包: 1.登录redis官网: https://redis.io/download 2.选 ...

  6. CentOS7 下编译安装 Samba,什么是 SMB/CIFS 协议

    目录 一.关于 Samba 1. SMB 2. Samba 二.yum 安装 Samba 1. 安装 Samba 2. 查看版本 3. 查看配置文件 4. 启动服务 5. 本地客户端验证 6. Win ...

  7. 超详细 Linux 下编译安装Redis 以及php配套使用

    一.Linux 下安装Redis 下载地址:http://redis.io/download,下载最新文档版本. 把鼠标移到上图的绿色框上,就会显示下图提示:(直接右键复制链接就好) 本教程使用的旧版 ...

  8. Redhat5.8 环境下编译安装 Redis 并将其注册为系统服务

    系统环境: $ cat /etc/issueRed Hat Enterprise Linux Server release 5.8 (Tikanga)Kernel \r on an \m 1. 下载安 ...

  9. centos7下编译安装php7.3

    一.下载php7.3的源码 https://www.php.net/downloads.php 下载php-7.3.4.tar.gz 二.安装gcc,gcc-c++,kernel-devel yum ...

随机推荐

  1. Nginx配置websocket的安全协议wss

    //nginx配置wss访问方式 map $http_upgrade $connection_upgrade { default upgrade; '' close; } upstream webso ...

  2. CTF--[BJDCTF2020]Cookie is so stable 1(SSTI)

    从hint.php可以找到提示,要求观察cookies 打开flag.php可以看到需要输入用户名,多次试验后发现输入的用户名会以cookies的方式储存 使用dirsearch扫描没有发现什么有用的 ...

  3. STM32—SPI详解

    目录 一.什么是SPI 二.SPI协议 物理层 协议层 1.通讯时序图 2.起始和停止信号 3.数据有效性 4.通讯模式 三.STM32中的SPI 简介 功能框图 1.通讯引脚 2.时钟控制逻辑 3. ...

  4. CGO入门和OCR文字识别(非第三方API,有源码,效果好)实战

    这是我参与8月更文挑战的第5天,活动详情查看:8月更文挑战 系列文章见: [第四天] GDB调试指南:C++中如何调试生产环境的程序? [第三天] IM敏感词算法原理和实现 [第二天] 现代IM架构研 ...

  5. reduce使用技巧

    一.使用reduce同时执行map(循环)和filter(过滤) 例如,将数组中的项的值加倍,然后只选择那些大于50的项 const numbers = [10, 20, 30, 40]; const ...

  6. uwp 自定义语音识别规则

    xml  code ---------------------------------------------------- <Page x:Class="MyApp.MainPage ...

  7. 模拟文件上传(三):使用apache fileupload组件进行文件批量上传

    其中涉及到的jar包 jsp显示层: <%@ page language="java" import="java.util.*" pageEncoding ...

  8. CSS布局中最小高度的妙用

    CSS布局中最小高度的妙用 --最小高度可以设定一个BOX的最小高度,当其内容较少时时,也能保持BOX的高度为一定,超出就自动向下延伸最小高度可以设定一个BOX的最小高度,当其内容较少时时,也能保持B ...

  9. centos7 netstat

    netstat 是控制台命令,它可以显示路由表.实际的网络连接以及每一个网络接口设备的状态信息.Netstat 用于显示与 IP . TCP . UDP 和 ICMP 协议相关的统计数据,一般用于检验 ...

  10. [源码解析] 深度学习流水线并行 PipeDream(3)--- 转换模型

    [源码解析] 深度学习流水线并行 PipeDream(3)--- 转换模型 目录 [源码解析] 深度学习流水线并行 PipeDream(3)--- 转换模型 0x00 摘要 0x01 前言 1.1 改 ...