如何为mongodb配置新端口 [英] How to configure new port for mongodb

查看:468
本文介绍了如何为mongodb配置新端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前在mongodb使用端口27017,并且一切正常.为了安全起见,我们要配置新端口.

I am currently using port 27017 for mongodb and everything is working proper. We want to configure new port for security purpose.

您能帮我配置一下吗?

推荐答案

这种方式,

  1. 启动mongo pass端口参数时

  1. While startiing mongo pass port argument

mongod --port 您所需的端口

mongod --port 19000

使用以下端口启动Mongo:

Start Mongo with port:

mongo --port 您所需的端口

mongo --port 19000

2.更改 mongodb.config 文件中的端口,并将配置文件作为输入传递.

2.change the port in the mongodb.config file and pass the config file as input.

端口= 您需要的端口

这篇关于如何为mongodb配置新端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆