mongod.service 937 B

12345678910111213141516171819202122232425262728293031323334353637
  1. [Unit]
  2. Description=MongoDB Database Server
  3. After=multi-user.target
  4. Documentation=https://docs.mongodb.org/manual
  5. [Service]
  6. User=mongod
  7. Group=mongod
  8. Environment="OPTIONS=-f /etc/mongod.conf"
  9. EnvironmentFile=-/etc/sysconfig/mongod
  10. ExecStart=/usr/local/mongodb/bin/mongod $OPTIONS
  11. ExecStartPre=/bin/mkdir -p /var/run/mongodb
  12. ExecStartPre=/bin/chown mongod:mongod /var/run/mongodb
  13. ExecStartPre=/bin/chmod 0755 /var/run/mongodb
  14. PermissionsStartOnly=true
  15. PIDFile=/var/run/mongodb/mongod.pid
  16. Type=forking
  17. # file size
  18. LimitFSIZE=infinity
  19. # cpu time
  20. LimitCPU=infinity
  21. # virtual memory size
  22. LimitAS=infinity
  23. # open files
  24. LimitNOFILE=64000
  25. # processes/threads
  26. LimitNPROC=64000
  27. # locked memory
  28. LimitMEMLOCK=infinity
  29. # total threads (user+kernel)
  30. TasksMax=infinity
  31. TasksAccounting=false
  32. # Recommended limits for for mongod as specified in
  33. # http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
  34. [Install]
  35. WantedBy=multi-user.target