Library Search
结果页redis
在 技术栈 中找到 8 个匹配结果。
技术栈
技术栈
8 个 Redis ## 目标
通过 `redis-cli` 和 Python `redis` 库,完成 Redis 五种核心数据结构的操作,体验缓存加速效果。
## 环境准备
```bash
redis-cli ping # 确保返回 PONG
pip install redis
```
## 第一步:redis-cli 方式
```bash
redis-cli
```
```redis
# === St… 3% Celery hon 版本**: 3.8 及以上(推荐 3.10+)
- **消息代理**: Redis(推荐)或 RabbitMQ
- **结果后端(可选)**: Redis / PostgreSQL / 等
## 安装命令
```bash
# 基础安装
pip install celery
# 安装 Celery + Redis 全套
pip install celery redis
# 安装监控面… 3% Docker ronment:
- ENV=production
- REDIS_URL=redis://redis:6379
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
networks:
- app-network
re… 3% FastAPI cpg://user:pass@db:5432/fastapi
- REDIS_URL=redis://redis:6379/0
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
db:
image: po… 3% Flask he
cache = Cache(config={"CACHE_TYPE": "RedisCache", "CACHE_REDIS_URL": "redis://localhost:6379/2"})
@main_bp.route("/hot-posts")
@cache.cached(timeout=300) # 缓存 5 分钟
def hot_posts():
return jso… 3% Fiber api.Post("/users", func(c fiber.Ctx) error {
user := new(User)
if err := c.Bind().JSON(user); err != nil {
return c.Status(400).JSON(fiber.Map{"error": "JSON 解析失败"})
}
if user.Name == "" ||… 1% etcd y-resource
EOF
```
---
## 第三章:etcd vs Redis vs ZooKeeper vs Consul
| 特性 | etcd | Redis | ZooKeeper | Consul |
|------|------|-------|-----------|--------|
| CAP | CP | AP | CP | CP |
| 共识算法 | Raft… 1% Prometheus ## Prometheus
Prometheus 是 SoundCloud 于 2012 年开源的**系统监控和告警工具包**,现为 CNCF 毕业项目。它已成为云原生监控的事实标准。
**核心价值**:基于多维时间序列数据的 Pull 模型监控。通过 PromQL 灵活查询,配合 Alertmanager 实现告警路由。
**关键特性**:
- 多维数据模型(Metric 名 + Key/… 1%