mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-06-26 22:40:40 +08:00
52 lines
1.8 KiB
YAML
52 lines
1.8 KiB
YAML
# URI for database connection, leave empty if using address and credential settings directly
|
|
uri:
|
|
# List of MongoDB server addresses
|
|
address: [localhost:37017]
|
|
# Name of the database
|
|
database: openim_v3
|
|
# Username for database authentication
|
|
username: openIM
|
|
# Password for database authentication
|
|
password: openIM123
|
|
# Authentication source for database authentication, if use root user, set it to admin
|
|
authSource: openim_v3
|
|
# Maximum number of connections in the connection pool
|
|
maxPoolSize: 100
|
|
# Maximum number of retry attempts for a failed database connection
|
|
maxRetry: 10
|
|
# MongoDB Mode, including "standalone", "replicaSet"
|
|
mongoMode: "replicaSet"
|
|
|
|
# The following configurations only take effect when mongoMode is set to "replicaSet"
|
|
replicaSet:
|
|
name: rs0
|
|
hosts: [192.168.1.217:37011, 192.168.1.217:370180, 192.168.1.217:37019]
|
|
# Read concern level: "local", "available", "majority", "linearizable", "snapshot"
|
|
readConcern: majority
|
|
# maximum staleness of data in seconds
|
|
maxStaleness: 90s
|
|
|
|
# The following configurations only take effect when mongoMode is set to "replicaSet"
|
|
readPreference:
|
|
# Read preference mode, can be "primary", "primaryPreferred", "secondary", "secondaryPreferred", "nearest"
|
|
mode: primary
|
|
maxStaleness: 90s
|
|
# TagSets is an array of maps with priority based on order, empty map must be placed last for fallback tagSets
|
|
tagSets:
|
|
- datacenter: "cn-east"
|
|
rack: "1"
|
|
storage: "ssd"
|
|
- datacenter: "cn-east"
|
|
storage: "ssd"
|
|
- datacenter: "cn-east"
|
|
- {} # Empty map, indicates any node
|
|
|
|
# The following configurations only take effect when mongoMode is set to "replicaSet"
|
|
writeConcern:
|
|
# Write node count or tag (int, "majority", or custom tag)
|
|
w: majority
|
|
# Whether to wait for journal confirmation
|
|
j: true
|
|
# Write timeout duration
|
|
wtimeout: 30s
|