-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.env.example
More file actions
90 lines (69 loc) · 2.64 KB
/
.env.example
File metadata and controls
90 lines (69 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# ==========================================
# Redis Proxy 配置示例文件
# ==========================================
# 使用说明:
# 1. 复制此文件为 .env: cp .env.example .env
# 2. 根据实际情况修改配置值
# 3. .env 文件不会被提交到 Git (已在 .gitignore 中)
# ==========================================
# ==================== Redis 单节点配置 ====================
# Redis 服务器地址
REDIS_HOST=127.0.0.1
# Redis 服务器端口
REDIS_PORT=6379
# Redis 密码 (如果没有密码可以留空或删除此行)
REDIS_PASSWORD=password
# Redis 数据库编号 (0-15)
REDIS_DB=0
# ==================== Redis 集群配置 ====================
# 如果使用集群模式,请使用逗号分隔多个节点地址
# 注意: 集群模式下所有节点的端口必须相同
# Redis 集群节点地址 (逗号分隔,取消注释以启用集群模式)
# REDIS_HOST=192.168.1.1,192.168.1.2,192.168.1.3
# Redis 集群端口 (所有节点使用相同端口)
# REDIS_PORT=6379,6379,6379
# Redis 集群密码
# REDIS_PASSWORD=your_cluster_password
# 集群模式下 DB 参数将被忽略
# REDIS_DB=0
# ==================== 代理服务器配置 ====================
# 代理服务器监听端口: 16379 (在代码中硬编码)
# 如需修改,请在 main.go 中修改 NewServer 的参数
# ==========================================
# 配置示例
# ==========================================
# 示例 1: 本地开发环境
# REDIS_HOST=localhost
# REDIS_PORT=6379
# REDIS_PASSWORD=
# REDIS_DB=0
# 示例 2: 远程单节点
# REDIS_HOST=redis.example.com
# REDIS_PORT=6379
# REDIS_PASSWORD=strong_password_here
# REDIS_DB=0
# 示例 3: Docker 环境
# REDIS_HOST=redis-container
# REDIS_PORT=6379
# REDIS_PASSWORD=dockerpassword
# REDIS_DB=0
# 示例 4: Redis 集群 (3 节点)
# REDIS_HOST=node1.redis.local,node2.redis.local,node3.redis.local
# REDIS_PORT=6379,6379,6379
# REDIS_PASSWORD=cluster123
# REDIS_DB=0
# 示例 5: Redis 集群 (6 节点: 3 主 3 从)
# REDIS_HOST=master1.redis.local,master2.redis.local,master3.redis.local,slave1.redis.local,slave2.redis.local,slave3.redis.local
# REDIS_PORT=6379,6379,6379,6379,6379,6379
# REDIS_PASSWORD=cluster123
# REDIS_DB=0
# ==========================================
# 重要提示
# ==========================================
# 1. 单节点模式: REDIS_HOST 填写单个地址
# 2. 集群模式: REDIS_HOST 使用逗号分隔多个地址
# 3. 集群模式要求所有节点端口相同
# 4. 集群模式不支持多数据库 (REDIS_DB 将被忽略)
# 5. 生产环境请使用强密码
# 6. 不要将包含真实密码的 .env 文件提交到版本控制
# ==========================================