Mongodb中mongod启动参数说明
在这篇文章中列出mongod服务启动时能够使用的一些启动参数,并对参数的含义进行说明。 Mongodb启动命令mongod参数说明 mongod的主要参数有: ************************************* 基本配置 ********************************************* --quiet # 安静
在这篇文章中列出mongod服务启动时能够使用的一些启动参数,并对参数的含义进行说明。
Mongodb启动命令mongod参数说明
mongod的主要参数有:
************************************* 基本配置*********************************************
--quiet | # 安静输出 |
--port arg | # 指定服务端口号,默认端口27017 |
--bind_ip arg | # 绑定服务IP,若绑定127.0.0.1,则只能本机访问,不指定默认本地所有IP |
--logpath arg | # 指定MongoDB日志文件,注意是指定文件不是目录 |
--logappend | # 使用追加的方式写日志 |
--pidfilepath arg | # PID File 的完整路径,如果没有设置,则没有PID文件 |
--keyFile arg | # 集群的私钥的完整路径,只对于Replica Set 架构有效 |
--unixSocketPrefix arg | # UNIX域套接字替代目录,(默认为 /tmp) |
--fork | # 以守护进程的方式运行MongoDB,创建服务器进程 |
--auth | # 启用验证 |
--cpu | # 定期显示CPU的CPU利用率和iowait |
--dbpath arg | # 指定数据库路径 |
--diaglog arg | # diaglog选项 0=off 1=W 2=R 3=both 7=W+some reads |
--directoryperdb | # 设置每个数据库将被保存在一个单独的目录 |
--journal | # 启用日志选项,MongoDB的数据操作将会写入到journal文件夹的文件里 |
--journalOptions arg | # 启用日志诊断选项 |
--ipv6 | # 启用IPv6选项 |
--jsonp | # 允许JSONP形式通过HTTP访问(有安全影响) |
--maxConns arg | # 最大同时连接数 默认2000 |
--noauth | # 不启用验证 |
--nohttpinterface | # 关闭http接口,默认关闭27018端口访问 |
--noprealloc | # 禁用数据文件预分配(往往影响性能) |
--noscripting | # 禁用脚本引擎 |
--notablescan | # 不允许表扫描 |
--nounixsocket | # 禁用Unix套接字监听 |
--nssize arg (=16) | # 设置信数据库.ns文件大小(MB) |
--objcheck | # 在收到客户数据,检查的有效性, |
--profile arg | # 档案参数 0=off 1=slow, 2=all |
--quota | # 限制每个数据库的文件数,设置默认为8 |
--quotaFiles arg | # number of files allower per db, requires --quota |
--rest | # 开启简单的rest API |
--repair | # 修复所有数据库run repair on all dbs |
--repairpath arg | # 修复库生成的文件的目录,默认为目录名称dbpath |
--slowms arg (=100) | # value of slow for profile and console log |
--smallfiles | # 使用较小的默认文件 |
--syncdelay arg (=60) | # 数据写入磁盘的时间秒数(0=never,不推荐) |
--sysinfo | # 打印一些诊断系统信息 |
--upgrade | # 如果需要升级数据库 |
********************************Replicaton**************************************************
--fastsync | # 从一个dbpath里启用从库复制服务,该dbpath的数据库是主库的快照,可用于快速启用同步 |
--autoresync | # 如果从库与主库同步数据差得多,自动重新同步, |
--oplogSize arg | # 设置oplog的大小(MB) |
********************************主/从参数****************************************************
--master | # 主库模式 |
--slave | # 从库模式 |
--source arg | # 从库 端口号 |
--only arg | # 指定单一的数据库复制 |
--slavedelay arg | # 设置从库同步主库的延迟时间 |
*********************************Replica set(副本集)选项************************************
--replSet arg | # 设置副本集名称 |
********************************Sharding(分片)选项******************************************
--configsvr | # 声明这是一个集群的config服务,默认端口27019,默认目录/data/configdb |
--shardsvr | # 声明这是一个集群的分片,默认端口27018 |
--noMoveParanoia | # 关闭偏执为moveChunk数据保存 |
********************************************************************************************
# 上述参数都可以写入 mongod.conf 配置文档里例如:
dbpath = /data/mongodb
logpath = /data/mongodb/mongodb.log
logappend = true
port = 27017
fork = true
auth = true
以上,对启动参数及其含义进行了列举,以供下次使用时进行查看。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

1. How can you make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! 1. Activate basic rights and interests: original articles can earn profits by advertising, and videos must be original in horizontal screen mode to earn profits. 2. Activate the rights of 100 fans: if the number of fans reaches 100 fans or above, you can get profits from micro headlines, original Q&A creation and Q&A. 3. Insist on original works: Original works include articles, micro headlines, questions, etc., and are required to be more than 300 words. Please note that if illegally plagiarized works are published as original works, credit points will be deducted, and even any profits will be deducted. 4. Verticality: When writing articles in professional fields, you cannot write articles across fields at will. You will not get appropriate recommendations, you will not be able to achieve the professionalism and refinement of your work, and it will be difficult to attract fans and readers. 5. Activity: high activity,

It is recommended to use the latest version of MongoDB (currently 5.0) as it provides the latest features and improvements. When selecting a version, you need to consider functional requirements, compatibility, stability, and community support. For example, the latest version has features such as transactions and aggregation pipeline optimization. Make sure the version is compatible with the application. For production environments, choose the long-term support version. The latest version has more active community support.

WPS is a very widely used office software, including documents, forms and PPT, and supports multi-terminal synchronization. If the prompt "The source application for this object cannot be launched" appears when editing wps, how to solve it? This problem may occur because you are trying to open a link or file, but its source application no longer exists or has been deleted. Here are some fixes: 1. Reinstall WPS software: Try reinstalling WPSOffice to fix the problem and make sure you are using the latest version. 2. Manually change the default program: Try to change the default program to WPS. You can right-click the file you want to open, select "Open with", and then

When wallpaperengine starts, there are 4 different options. Many users don't know which one to choose when starting wallpaperengine. Generally, when wallpaperengine starts, choose the first one: start 32-bit. Which one to choose when starting wallpaperengine? Answer: Start 32-bit. 1. Generally, when wallpaperengine starts, select the first one: start 32-bit. 2. When wallpaperengine starts, there are 4 different options: start 32-bit; start 64-bit. 3. Start 32-bit: This is a generally recommended option and suitable for most users. 4. Start 64-bit: If the system supports 64-bit, you can choose this option

Node.js is a server-side JavaScript runtime, while Vue.js is a client-side JavaScript framework for creating interactive user interfaces. Node.js is used for server-side development, such as back-end service API development and data processing, while Vue.js is used for client-side development, such as single-page applications and responsive user interfaces.

The data of the MongoDB database is stored in the specified data directory, which can be located in the local file system, network file system or cloud storage. The specific location is as follows: Local file system: The default path is Linux/macOS:/data/db, Windows: C:\data\db. Network file system: The path depends on the file system. Cloud Storage: The path is determined by the cloud storage provider.

The MongoDB database is known for its flexibility, scalability, and high performance. Its advantages include: a document data model that allows data to be stored in a flexible and unstructured way. Horizontal scalability to multiple servers via sharding. Query flexibility, supporting complex queries and aggregation operations. Data replication and fault tolerance ensure data redundancy and high availability. JSON support for easy integration with front-end applications. High performance for fast response even when processing large amounts of data. Open source, customizable and free to use.

MongoDB is a document-oriented, distributed database system used to store and manage large amounts of structured and unstructured data. Its core concepts include document storage and distribution, and its main features include dynamic schema, indexing, aggregation, map-reduce and replication. It is widely used in content management systems, e-commerce platforms, social media websites, IoT applications, and mobile application development.
