7

Linux 下安装新版本 Redis 遇到的坑

 3 years ago
source link: https://geekvic.top/post/755670ae.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

什么是 Redis?

Remote Dictionary Server (Redis) 是一个由 Salvatore Sanfilippo 写的 key-value 存储系统。

Redis 是一个开源的使用 ANSI C 语言编写、遵守 BSD 协议、支持网络、可基于内存亦可持久化的日志型、Key-Value 数据库,并提供多种语言的 API。

与传统数据库不同的是 Redis 的数据是存在内存中的,所以存写速度非常快,因此 Redis 被广泛应用于缓存方向。

数据类型有哪些?

它通常被称为数据结构服务器,因为值(value)可以是 字符串 (String), 哈希 (Hash), 列表 (list), 集合 (sets) 和 有序集合 (sorted sets) 等类型。

官网下载最新版本,并解压到 /usr/local,并将文件夹重命名为 redis

执行 make 命令时遇到的报错

1
2
3
make[1]: *** [server.o] 错误 1
make[1]: 离开目录“/usr/local/redis/src”
make: *** [all] 错误 2

解决方法,升级 gcc 版本

1
2
3
4
gcc -v     
yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash

再次 make,安装成功后,Hint: It’s a good idea to run ‘make test’

查看安装目录

1
cd /usr/local/bin
  • redis-benchmark 性能测试工具
  • redis-check-aof 检查 aof 日志工具
  • redis-check-rdb 检查 rdb 日志工具
  • redis-cli redis 客户端
  • redis-server redis 服务端
  • redis-sentinel redis 哨兵服务

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK