-
Notifications
You must be signed in to change notification settings - Fork 600
Expand file tree
/
Copy pathexample.conf
More file actions
181 lines (144 loc) · 6.91 KB
/
example.conf
File metadata and controls
181 lines (144 loc) · 6.91 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
####################### Godis Configuration Example ######################
#
#
# Godis use redis.conf in the working dir by default.
# You could use CONFIG environment to set your config file path.
# Godis 默认会使用当前目录下的 redis.conf 作为配置文件
# 你可以使用 CONFIG 环境变量来指定配置文件:
#
# CONFIG=my.conf ./godis
#
##########################################################################
# Bind ip address. At most one for now
bind 0.0.0.0
# Accept connections on the specified port
port 6399
# The working directory. Using current directory by default.
# Godis will write appendonly file, rdb file and raft database (in cluster mode) in this directory
#
# dir /opt/godis
# number of databases
databases 16
# use gnet tcp server for better performance
# 使用 gnet 库来提高 IO 性能
#
# use-gnet no
############################## PERSISTENCE ###############################
# Enable AOF persistence
# Please be advised, Godis's rdb is generated by aof rewriting.
# If you need any form of persistence or replication, you need to enable AOF.
# 启用 AOF 持久化
# Godis 的 rdb 基于 aof 重写产生,如果你需要使用 rdb 或者主从复制功能必须先启用 AOF
appendonly no
# The filename of the append only file.
# It is in the directory specified by the `dir` configuration
# aof 文件名, 文件位于 dir 项配置的工作目录里
appendfilename appendonly.aof
# Determine how often to fsync appendonly files
# - always: call fsync() after everywrite
# - everysec: call fsync() after every second
# - no: never call fsync() manually, let the OS determines.
#
# appendfsync always
appendfsync everysec
# appendfsync no
# AOF rewrite will produce RDB format. Also known as hybrid persistence
aof-use-rdb-preamble yes
# RDB filename
dbfilename test.rdb
################################## SECURITY ###################################
# Password of godis server
#
# requirepass yourpassword
################################### REPLICA ###################################
# If the master node set `requirepass`, set `masterauth` as the password of
# the master, then this node can pass the authentication of its master
# 如果主节点配置了密码,将它的密码填写在此处以便从节点可以通过认证
#
# masterauth masterpassword
# If a slave hasn't receives data from its master more than
# `repl-timeout` seconds, the replica will be stopped
# 如果从节点超过 repl-timeout 秒没有收到主节点的消息,主从复制将自动停止
#
# repl-timeout 60
# If the slave node is behind a NAT, which means its master cannot reach it by
# dial the peer address of the tcp connection, then you can set announce address.
#
# When announce address has been set, the master will dial the announce address
# to reach this node.
# 如果当前节点处于使用 NAT 的子网中导致主节点无法通过 tcp 连接中的地址找到它时可以配置此项
# 主节点将尝试连接 slave-announce-ip:slave-announce-port 来与它通信
#
# slave-announce-ip 5.5.5.5
# slave-announce-port 1234
################################## SLOW LOG ###################################
# The Godis Slow Log is a system to log queries that exceeded a specified
# execution time. The execution time does not include the I/O operations
# like talking with the client, sending the reply and so forth,
# but just the time needed to actually execute the command (this is the only
# stage of command execution where the thread is blocked and can not serve
# other requests in the meantime).
#
# You can configure the slow log with two parameters: one tells Godis
# what is the execution time, in microseconds, to exceed in order for the
# command to get logged, and the other parameter is the length of the
# slow log. When a new command is logged the oldest one is removed from the
# queue of logged commands.
# The following time is expressed in microseconds, so 1000000 is equivalent
# to one second. Note that a negative number disables the slow log, while
# a value of zero forces the logging of every command.
slowlog-log-slower-than 10000
# There is no limit to this length. Just be aware that it will consume memory.
# You can reclaim memory used by the slow log with SLOWLOG RESET.
slowlog-max-len 128
################################### CLUSTER ###################################
# Godis provides a Raft-based cluster, which is transparent to the client.
# You can use it like a standalone redis.
# Enable cluster mode.
# Other cluster configurations are effective only when `cluster-enable` is yes
# 启用集群模式
# 其它集群配置项仅在 cluster-enable 是 yes 时生效
#
# cluster-enable yes
# Raft server listen address
# Raft 服务器监听地址
#
# raft-listen-address 0.0.0.0:16666
# If the node is behind a NAT, which means other nodes cannot reach it by
# dial the peer address of the tcp connection, then you can set announce address.
#
# When announce address has been set, other nodes will dial the announce address
# to reach this node.
# 如果当前节点处于使用 NAT 的子网中导致其它节点无法通过 tcp 连接中的地址找到它时可以配置此项
# 其它节点将尝试连接 raft-advertise-address 来与它通信
#
# raft-advertise-address 4.4.4.4:16666
# Set to yes to start a create a new cluster.
# Nodes will persist the cluster metadata and will automatically rejoin the
# cluster after restart.
# This configuration takes effect only when there is no cluster data on the disk.
# 设为 yes 可以创建一个新集群
# 集群中的节点会持久化集群元信息并在重启后自动重新加入集群,因此此配置仅在磁盘上没有集群数据时生效
#
# cluster-as-seed yes
# This node will send request to cluster-seed to join a cluster.
# cluster-seed can be any node in the cluster.
# Use redis service address here! Do NOT use raft service address!
# After joined the cluster, node will obtain and persist complete metadata.
# This configuration only takes effect when joining the cluster
# and is invalid when the node is restarted.
# 当前节点启动时会向 cluster-seed 发送加入集群的请求
# 集群中的任何一个节点都可以充当 cluster-seed
# 应填写 Redis 服务的地址,不要使用 raft 服务的地址
# 节点成功加入集群后会持久化集群元信息,因此重启时不会再使用此配置
#
# cluster-seed 6.6.6.6:6399
# This node join cluster as a slave of `master-in-cluster`.
# The master-slave relationship will be automatically adjusted during cluster operation.
# This configuration only takes effect when joining the cluster.
# Use redis service address here! Do NOT use raft service address!
# 当前节点将作为 master-in-cluster 的从节点加入集群
# 集群运行过程中会自动调整主从关系,此配置仅在加入集群时生效
# 应填写 Redis 服务的地址,不要使用 raft 服务的地址
#
# master-in-cluster 6.6.6.6:6399