首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法通过redash连接mongodb

无法通过redash连接mongodb
EN

Stack Overflow用户
提问于 2019-05-24 15:18:27
回答 1查看 699关注 0票数 0

我正在尝试连接到mongodb,以便从本地机器上进行编辑。

1)芒果和红斑鱼都属于独立系统。

2)我能从终端连接到芒果。请看我的终端细节后,我登录到它。

代码语言:javascript
运行
复制
rahul@rahul-VirtualBox:~$ mongo -u rahul -p
MongoDB shell version v3.6.3
Enter password: 
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.3
Server has startup warnings: 
2019-05-24T20:05:14.788+0530 I STORAGE  [initandlisten] 
2019-05-24T20:05:14.788+0530 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-05-24T20:05:14.788+0530 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2019-05-24T20:05:16.607+0530 I CONTROL  [initandlisten] 
2019-05-24T20:05:16.607+0530 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-05-24T20:05:16.607+0530 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2019-05-24T20:05:16.607+0530 I CONTROL  [initandlisten] 
> show dbs
admin   0.000GB
config  0.000GB
local   0.000GB
>

3)我使用Ubuntu16.04作为我的操作系统。

4)我输入的使用Mongo连接redash的详细信息

名称: Localhost_mongo 连接String:mongodb://rahul:password@127.0.0.1:27017 数据库名称:admin

5)我得到了错误的connection refused err no:111

6)下面是我的配置文件的详细信息&位置: /etc/mongodb.conf

代码语言:javascript
运行
复制
# mongodb.conf

# Where to store the data.
dbpath=/var/lib/mongodb

#where to log
logpath=/var/log/mongodb/mongodb.log

logappend=true

bind_ip = 0.0.0.0
port = 27017

# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
journal=true

# Enables periodic logging of CPU utilization and I/O wait
#cpu = true

# Turn on/off security.  Off is currently the default
#noauth = true
#auth = true

# Verbose logging output.
#verbose = true

# Inspect all client data for validity on receipt (useful for
# developing drivers)
#objcheck = true

# Enable db quota management
#quota = true

# Set diagnostic logging level where n is
#   0=off (default)
#   1=W
#   2=R
#   3=both
#   7=W+some reads
#diaglog = 0

# Diagnostic/debugging option
#nocursors = true

# Ignore query hints
#nohints = true

# Disable the HTTP interface (Defaults to localhost:27018).
#nohttpinterface = true

# Turns off server-side scripting.  This will result in greatly limited
# functionality
#noscripting = true

# Turns off table scans.  Any query that would do a table scan fails.
#notablescan = true

# Disable data file preallocation.
#noprealloc = true

# Specify .ns file size for new databases.
# nssize = <size>

# Accout token for Mongo monitoring server.
#mms-token = <token>

# Server name for Mongo monitoring server.
#mms-name = <server-name>

# Ping interval for Mongo monitoring server.
#mms-interval = <seconds>

# Replication Options
#   3=both
#   7=W+some reads
#diaglog = 0

# Diagnostic/debugging option
#nocursors = true

# Ignore query hints
#nohints = true

# Disable the HTTP interface (Defaults to localhost:27018).
#nohttpinterface = true

# Turns off server-side scripting.  This will result in greatly limited
# functionality
#noscripting = true

# Turns off table scans.  Any query that would do a table scan fails.
#notablescan = true

# Disable data file preallocation.
#noprealloc = true

# Specify .ns file size for new databases.
# nssize = <size>

# Accout token for Mongo monitoring server.
#mms-token = <token>

# Server name for Mongo monitoring server.
#mms-name = <server-name>

# Ping interval for Mongo monitoring server.
#mms-interval = <seconds>

# Replication Options

请帮帮忙。谢谢你的帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-31 03:00:30

自从您提到redash和mongodb都在独立的系统上,您有添加了iptable规则吗?如果您已经完成了检查,检查您是否存在多个规则之间的冲突。

我注意到一个用户建议注释掉bind_ip行,您不应该这样做,因为bind_ip = 0.0.0.0允许从所有主机建立连接。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56295428

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档