广告位联系
返回顶部
分享到

CentOS7.9编译安装Redis6.2.5

Redis 来源:互联网 作者:佚名 发布时间:2026-08-18 22:10:39 人浏览
摘要

Gcc 11是自己编译安装的 所以Redis的Makefile找不到cc,需要手动造一个链接 1 2 cd /usr/bin sudo ln -s /usr/local/gcc-11.2.0/bin/gcc cc 编译 1 make -j7 USE_SYSTEMD=yes PREFIX=/opt/redis/ 安装 1 sudo make PREFIX=/opt/redis insta

Gcc 11是自己编译安装的

所以Redis的Makefile找不到cc,需要手动造一个链接

1

2

cd /usr/bin

sudo ln -s /usr/local/gcc-11.2.0/bin/gcc cc

编译

1

make -j7 USE_SYSTEMD=yes PREFIX=/opt/redis/

安装

1

sudo make PREFIX=/opt/redis install

卸载

1

sudo make uninstall

自带的systemd启动文件有点问题,改为如下

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

[Unit]

Description=Redis data structure server

Documentation=https://redis.io/documentation

#Before=your_application.service another_example_application.service

#AssertPathExists=/var/lib/redis

Wants=network-online.target

After=network-online.target

[Service]

ExecStart=/opt/redis/bin/redis-server /opt/redis/redis.conf --supervised systemd --daemonize no

## Alternatively, have redis-server load a configuration file:

#ExecStart=/usr/local/bin/redis-server /path/to/your/redis.conf

LimitNOFILE=10032

NoNewPrivileges=yes

#OOMScoreAdjust=-900

PrivateTmp=yes

Type=notify

TimeoutStartSec=15

TimeoutStopSec=15

UMask=0077

#User=redis

#Group=redis

#WorkingDirectory=/var/lib/redis

[Install]

WantedBy=multi-user.target

注意修改了timeout的值,否则会经常报timeout错误,例如

1

Job for redis.service failed because a timeout was exceeded. See "systemctl status redis.service" and "journalctl -xe" for details.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

# systemctl status redis.service

● redis.service - Redis data structure server

   Loaded: loaded (/usr/lib/systemd/system/redis.service; disabled; vendor preset: disabled)

   Active: failed (Result: timeout) since Mon 2021-08-30 17:11:25 CST; 6min ago

     Docs: https://redis.io/documentation

  Process: 52802 ExecStart=/opt/redis/bin/redis-server /opt/redis/redis.conf --supervised systemd --daemonize no (code=killed, signal=TERM)

 Main PID: 52802 (code=killed, signal=TERM)

Aug 30 17:11:25 elcndc2yfzx01t systemd[1]: Starting Redis data structure server...

Aug 30 17:11:25 elcndc2yfzx01t systemd[1]: redis.service start operation timed out. Terminating.

Aug 30 17:11:25 elcndc2yfzx01t systemd[1]: redis.service stop-sigterm timed out. Killing.

Aug 30 17:11:25 elcndc2yfzx01t systemd[1]: redis.service still around after SIGKILL. Ignoring.

Aug 30 17:11:25 elcndc2yfzx01t systemd[1]: Failed to start Redis data structure server.

Aug 30 17:11:25 elcndc2yfzx01t systemd[1]: Unit redis.service entered failed state.

Aug 30 17:11:25 elcndc2yfzx01t systemd[1]: redis.service failed.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

-- A session with the ID c87 has been terminated.

Aug 30 17:07:43 elcndc2yfzx01t polkitd[1042]: Registered Authentication Agent for unix-process:52658:218121463 (system bus name :1.8843 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/Authe

Aug 30 17:07:43 elcndc2yfzx01t systemd[1]: Starting Redis data structure server...

-- Subject: Unit redis.service has begun start-up

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unit redis.service has begun starting up.

Aug 30 17:07:43 elcndc2yfzx01t systemd[1]: redis.service start operation timed out. Terminating.

Aug 30 17:07:43 elcndc2yfzx01t systemd[1]: redis.service stop-sigterm timed out. Killing.

Aug 30 17:07:43 elcndc2yfzx01t systemd[1]: Failed to start Redis data structure server.

-- Subject: Unit redis.service has failed

-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unit redis.service has failed.

--

-- The result is failed.

Aug 30 17:07:43 elcndc2yfzx01t systemd[1]: Unit redis.service entered failed state.

Aug 30 17:07:43 elcndc2yfzx01t systemd[1]: redis.service failed.

Aug 30 17:07:43 elcndc2yfzx01t polkitd[1042]: Unregistered Authentication Agent for unix


版权声明 : 本文内容来源于互联网或用户自行发布贡献,该文观点仅代表原作者本人。本站仅提供信息存储空间服务和不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权, 违法违规的内容, 请发送邮件至2530232025#qq.cn(#换@)举报,一经查实,本站将立刻删除。
原文链接 :
相关文章
  • CentOS7.9编译安装Redis6.2.5
    Gcc 11是自己编译安装的 所以Redis的Makefile找不到cc,需要手动造一个链接 1 2 cd /usr/bin sudo ln -s /usr/local/gcc-11.2.0/bin/gcc cc 编译 1 make -j7 USE_SYST
  • 布隆过滤器是什么?如何用Redis防止缓存穿透
    一、什么是布隆过滤器 布隆过滤器(Bloom Filter)是一种空间效率极高的概率型数据结构,用于判断一个元素是否在一个集合中。 核心特性:
  • 解读Redis的持久化方式(RDB、AOF)
    一、核心概念回顾 RDB vs AOF 对比 特性 RDB (快照) AOF (日志) 原理 定时全量快照 记录每条写命令 文件格式 二进制 (.rdb) 文本日志 (.aof) 文件大
  • Redis的主从复制机制以及主从复制的实现方法

    Redis的主从复制机制以及主从复制的实现方法
    很多企业都没有使用 Redis 的集群,但是至少都做了主从。有了主从,当主节点(Master) 挂掉的时候,运维让从节点 (Slave) 过来接管,服务就可
  • 基于Redis实现登录功能思路介绍(手机号+验证码
    本文使用的是手机号+验证码的登录方式,其中验证码是通过在控制台输出,并没有真的发送到手机上(太麻烦,主要目的还是学习使用R
  • redis中session会话共享的三种方案
    在分布式系统架构中,用户请求可能被负载均衡器分发到不同的服务器节点。如果用户的第一次请求落在服务器A并创建了Session,而第二次请
  • shell脚本批量导出redis key-value方式
    1 背景 需求:工作中需要导出线上redis数据,但需避免使用keys命令全量扫描,导致瞬间响应卡顿,从而引发超时等问题 方法:最安全的方式
  • redis通用配置类的使用

    redis通用配置类的使用
    redis通用配置类 作用 处理Springboot使用 RedisTemplate过程中的编码问题 现象如下,看数据的时候不方便 所以添加一下的配置类之后,就可以了
  • linux部署redis集群遇到的问题及解决
    版本信息: redis:5.0.8 linux服务器:CentOS 7 不同版本问题处理方式可能有所不同 1、在java程序中,连接不上redisCluster 报错信息: no reachable
  • Redis中对大Key进行处理方式

    Redis中对大Key进行处理方式
    什么是大key 很多铁子可能会认为大key,是这个key的值很大其实不是,而是key的value值很大一般对于下面这些我们可以称为大key. String 类型值
  • 本站所有内容来源于互联网或用户自行发布,本站仅提供信息存储空间服务,不拥有版权,不承担法律责任。如有侵犯您的权益,请您联系站长处理!
  • Copyright © 2017-2022 F11.CN All Rights Reserved. F11站长开发者网 版权所有 | 苏ICP备2022031554号-1 | 51LA统计