博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Mongo Connector for BI
阅读量:7005 次
发布时间:2019-06-27

本文共 1896 字,大约阅读时间需要 6 分钟。

官网地址:

它目前包含两个组件:

  1. mongosqld:mongosqld接受来自SQL客户端的传入请求,并将这些请求代理到mongod或mongos实例。
  2. mongodrdl: 根据一个或多个MongoDB的集合(collection,类似于表),生成一个Schema,交将它写入.drdl文件中

 


安装

安装包下载地址:,可以下载不同系统平台的安装包

 

windows:

安装完成后,安装目录的文件,里面会有两个可执行文件,mongosqld.exe和mongodrdl.exe,分别对应它两个组件mongosqld和mongodrdl

 

Linux系统的安装是将文件下载至服务器,并使用命令安装已经下载的软件包 

 


mongodrdl

命令行参数参考官方地址:

 

 

连接本地mongodb,已经生成了Schema,如果需要使用power bi或是其他的工具连接至mongo connector,需要再安装另外一个mysql ODBC工具,可以参考《》

mongosqld --mongo-uri "mongodb://localhost:27017/?connect=direct" --addr "127.0.0.1:3307"

 

 

尝试连接mongo atlas,没有用户名

mongosqld --mongo-uri "mongodb+srv://集群地址/?connect=direct" --addr "127.0.0.1:3308"

 

 

 

尝试连接mongo atlas,出现以下错误

mongosqld --mongo-uri "mongodb+srv://weschen:123456789@集群地址/?connect=direct" --addr "127.0.0.1:3308"

 

 

 

加入密码参数,出现以下错误

mongosqld --mongo-uri "mongodb+srv://集群地址/admin?connect=direct" --auth -u weschen -p 123456789 --addr "127.0.0.1:3308"

 

 

连接的是集群中的单个服务器,依然出现错误

mongosqld --mongo-uri "mongodb://服务器1:27017,服务器2:27017,服务器3:27017" --auth -u weschen -p 123456789 --addr "127.0.0.1:3308"

 

 

 

mongosqld也可以与mongodrdl配合使用,mongodrdl生成.drdl文件,而mongosqld直接使用该文件生成schema ,官风应该是可行的,在本机一直在等待,没有回应

mongosqld --schema d:\demo.drdl 

 

 

 


mongodrdl

命令行参数参考官网地址:

 

 

在命令行中生成drdl

mongodrdl --host localhost --port 27017 --db tqsapi

 

 

将drdl文件保存至指定的地址

mongodrdl --host localhost --port 27017 --db tqsapi --out d:\demo.drdl

 

 

mongodrdl连接至mongo atlas,首先需要找到mongo atlas的所有服务器,参考地址:

命令如下,

--host对应到服务器的IP和端口,

-u对应到授权的用户

-p对应到授权的用户密码

-d对应到DB名称

--ssl --authenticationDatabase=admin 暂时不知道意义

mongodrdl --host 服务器1:27017,服务器2:27017,服务器3:27017 -u weschen -p 123456789 --ssl --authenticationDatabase=admin -d tqsapi

 

 

连接至远程集群中的所有服务器,发现是不可用的,错误地址:

mongodrdl --host 服务器1:27017,服务器2:27017,服务器3:27017 -u weschen -p 123456789 --ssl --authenticationDatabase=admin -d tqsapi --out d:\test.drdl

 

 

 

 
  
X
基本翻译
abbr. 超文本传输协议安全(Hyper Text Transfer Protocol)
网络释义
HTTP Secure
支援
通信安全

 

转载于:https://www.cnblogs.com/weschen/p/8862935.html

你可能感兴趣的文章