Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mongodb3.2 configuration file yaml format

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

After mongodb3.x version is to yaml syntax format configuration file, the following is the yaml configuration file format is as follows:

Official yaml profile options reference: docs.mongodb.org/manual/reference/configuration-options/#configuration-file

Only spaces can be used, tab key is not supported, remember, you know the reason......

systemLog: destination: file//Specify a file path: /data/logs/mongod.log//Log storage location logAppend: true//Generate log content appended to file # quiet: true//Output information will be limited in quiet mode # timeStampFormat: iso8601-utc /Default is iso8601-local, log information also has other timestamp formats: ctime,iso8601-utc,iso8601-localprocessManagement: fork: true//Run MongoDB as a daemon to create the server processpidFilePath: "/data/mongo-data/mongod.pid"//pid file path net:# bindIp: 192.168.33.131//bind ip addresses to access mongodb, multiple ip comma-separated port: 27017//port maxIncomingConnections: 10000//Default 65535, Maximum number of connections accepted by mongodb instance, invalid if higher than maximum number of threads accepted by operating system.# http:# enabled: true//http port is best turned off #RESTInterfaceEnabled: false//Even if http interface option is turned off, if this option is turned on, there will be more insecure factors storage: dbPath: "/data/mongo-data"//data file storage path engine: wiredTiger//data engine wiredTiger: engineConfig://wt Engine Configuration cacheSizeGB: 1//depends on the server to set directoryForIndexes: true//Whether indexes are stored separately by database name collectionConfig: blockCompressor: zlib//Compression Configuration indexConfig: prefixCompression: true//index configuration journal: enabled: true//Log operations to prevent data loss. directoryPerDB: true//Specifies that each database file is stored in a separate data directory. If you use this option on an existing system, you need to move existing data files to the directory beforehand. operationProfiling: slowOpthresholdMs: 100 //Specify the slow query time in milliseconds. If the function is enabled, write data to the system.profile collection mode: "slowOp"//off, slowOp, all, respectively. Turn on only slow query and record all operations. security: keyFile: "/data/mongodb-keyfile"//Specifies the key file storage location for authentication between shard set or replica set members clusterAuthMode: "keyFile"//Cluster authentication mode, default is keyFile authorization: "disabled"//User role authentication for accessing database and performing operations

Copy the relevant configuration of the set. Configure it as follows according to the above configuration file.

replication: oplog SizeMB: 50//Default is 5% of disk, specifies maximum size of oplog. Specify invalid replSetName: "rs_zxl"//Specify the name of the replica set secondaryIndexPrefetch: "all"//Specify whether replica set members load indexes into memory before accepting oplog for a database that already has oplog. rs. By default, all indexes are loaded into memory. none load none;all load all;_id_only load_id only

Sharded cluster configuration, sharded replication set configuration (on a single instance node basis)

replication: oplogSizeMB:50 replSetName: "rs_zxl"sharding: clusterRole: shardsvr

config server configuration (on a single instance node basis)

sharding: clusterRole: configsvr

mongos configuration,(different from single instance)

systemLog: destination: file path: /data/logs/mongos.log logAppend: truenet: port: 27019sharding: configDB: 192.168.33.131:30000

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report