Redis

来自牛奶河Wiki
阿奔讨论 | 贡献2024年5月21日 (二) 16:17的版本
跳到导航 跳到搜索

Redis(Remote Dictionary Server, 远程字典服务),是一个开源的使用 ANSI C 语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value 数据库。

Redis 的数据是存在内存中的,读写速度每秒可处理超过 10 万次读写操作。广泛应用在应用缓存领域,也经常用来做分布式锁。除此之外,Redis 支持事务、持久化、LUA 脚本、LRU 驱动事件、多种集群方案。

The open source, in-memory data store used by millions of developers as a database, cache, streaming engine, and message broker. Redis

Install

Install Redis Stack

curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
apt-get update
apt-get install redis-stack-server
systemctl start redis-stack-server.service 
外网访问
# /etc/redis-stack.conf
bind * -::* 
protected-mode no

Install Redis Enterprise

gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key EC5EC593D7D1529F: public key "Redis Labs Package Signing Key (2020) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
  • dpkg-sig --verify redislabs_7.4.2-129~focal_amd64.deb
Processing redislabs_7.4.2-129~focal_amd64.deb...
GOODSIG _gpgorigin 5E8EFA2409E5C44FB529BE20EC5EC593D7D1529F 1712603737
  • install.sh
  • start
# /opt/redislabs/bin/
redis-server

Passwd

redis-cli 
# 认证密码
auth "密码"
# 查看密码
config get requirepass
# 修改密码
config set requirepass "密码"