mirror of
https://github.com/HDT3213/godis.git
synced 2025-09-26 21:01:17 +08:00
156 lines
5.7 KiB
Plaintext
156 lines
5.7 KiB
Plaintext
|
|
####################### 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
|
|
|
|
|
|
################################### 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 |