# where to write logging data.systemLog: quiet: true destination: file logAppend: true path: /data/mongodb4/log/mongod.log # Where and how to store data.storage: dbPath: /data/mongodb4/data journal: enabled: true commitIntervalMs: 500 # how the process runsprocessManagement: fork: true # fork and run in background pidFilePath: /data/mongodb4/run/mongod.pid # location of pidfile timeZoneInfo: /usr/share/zoneinfo # network interfacesnet: port: 27017 bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting. #security:# authorization: enabled #replca setreplication: replSetName: "prod01"
2、mongod.service
代码语言:javascript代码运行次数:0运行复制
[Unit]Description=MongoDB Database ServerDocumentation=https://docs.mongodb.org/manualAfter=network.target [Service]User=mongodGroup=mongodEnvironment="OPTIONS=-f /data/mongodb4/conf/mongod.conf"EnvironmentFile=-/etc/sysconfig/mongodExecStart=/data/mongodb4/bin/mongod $OPTIONSPermissionsStartOnly=truePIDFile=/data/mongodb4/run/mongod.pidType=forking# file sizeLimitFSIZE=infinity# cpu timeLimitCPU=infinity# virtual memory sizeLimitAS=infinity# open filesLimitNOFILE=64000# processes/threadsLimitNPROC=64000# locked memoryLimitMEMLOCK=infinity# total threads (user+kernel)TasksMax=infinityTasksAccounting=false# Recommended limits for for mongod as specified in# http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings [Install]WantedBy=multi-user.target