mongodb - Mongodb:连接被拒绝
问题描述
我想在远程服务器上启动一个配置节点,但是当我启动一个mongod进程时,用mongo命令打不开。甚至在本地节点上也打不开。</p>
root@Ubuntu04:~/mongodb# mongod --configsvr --replSet mongoConfig --dbpath config2/data --bind_ip [localhost,master] --port 21000 --logpath config2/log/config.log --fork
about to fork child process, waiting until server is ready for connections.
forked process: 833
child process started successfully, parent exiting
root@Ubuntu04:~/mongodb# mongo localhost:21000
MongoDB shell version v4.2.5
connecting to: mongodb://localhost:21000/test?compressors=disabled&gssapiServiceName=mongodb
2020-03-27T17:15:23.552+0800 E QUERY [js] Error: couldn't connect to server localhost:21000, connection attempt failed: SocketException: Error connecting to localhost:21000 (127.0.0.1:21000) :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2020-03-27T17:15:23.555+0800 F - [main] exception: connect failed
2020-03-27T17:15:23.555+0800 E - [main] exiting with code 1
解决方案
推荐阅读
- java - 写一个路由程序,Java中的递归难度
- ruby - 在 Ruby 上声明 Hash 时出错
- entity-framework-core - 实体框架核心 无效操作。连接已关闭
- flutter - 颤振自定义字体未应用
- python - 仅在系统关闭时终止正在运行的 python 程序
- python - 找不到 Jupyter Lab 的 bin 目录
- core-data - 呈现工作表时 EnvironmentObject 不起作用
- html - 如何在 HTML/CSS 中创建跟踪视口的背景?
- javascript - javascript按钮行为的初学者问题
- java - 有人可以帮我修复这个程序吗?