Docs HomeMongoDB Manual

Default MongoDB Port默认MongoDB端口

The following table lists the default TCP ports used by MongoDB:下表列出了MongoDB使用的默认TCP端口:

Default Port默认端口Description描述
27017The default port for mongod and mongos instances. mongodmongos实例的默认端口。You can change this port with port or --port.您可以用port--port更改此端口。
27018The default port for mongod when running with --shardsvr command-line option or the shardsvr value for the clusterRole setting in a configuration file.mongod在使用--shardsvr命令行选项或配置文件中clusterRole设置的shardsvr值运行时的默认端口。
27019The default port for mongod when running with --configsvr command-line option or the configsvr value for the clusterRole setting in a configuration file.当使用--configsvr命令行选项或配置文件中clusterRole设置的configsvr值运行时,mongod的默认端口。
27020The default port from which mongocryptd listens for messages. mongocryptd侦听消息的默认端口。mongocryptd is installed with MongoDB Enterprise Server (version 4.2 and later) and supports automatic encryption operations.mongocryptd安装在MongoDB企业版服务器(4.2及更高版本)中,支持自动加密操作。