简体   繁体   English

在Apache Superset中添加一个druid集群作为SQL数据库

[英]Add a druid cluster as a SQL database in Apache Superset

I currently connect to the druid cluster through the druid connector in Apache Superset.我目前通过 Apache Superset 中的 druid 连接器连接到 druid 集群。 I heard that SQL can be used to query druid.听说可以用SQL查询druid。 Is it possible to point my SQL database connection to druid?是否可以将我的 SQL 数据库连接指向德鲁伊?

Follow the steps below请按照以下步骤操作

  1. You need to use latest version of pydruid for enabling sqlalchemy support.您需要使用最新版本的pydruid来启用pydruid支持。 For me pydruid 0.4.1 is working fine.对我来说,pydruid 0.4.1 工作正常。

  2. On Superset, in the Databases section you need to provide the SQLAlchemy URI druid://XX.XX:8082/druid/v2/sql/ using a broker ip/host.在 Superset 上,在 Databases 部分,您需要使用代理 ip/host 提供SQLAlchemy URI druid://XX.XX:8082/druid/v2/sql/

  3. Third thing you need to do is to enable druid.sql.enable=true on broker.您需要做的第三件事是在代理上启用druid.sql.enable=true

I hope this will help you.我希望这能帮到您。

i was really struggling with this one... in my case, i am running on my mac.我真的很纠结这个……就我而言,我在我的 mac 上运行。 druid is installed directly and superset is running in docker (using the docker-compose setup). druid 是直接安装的,superset 在 docker 中运行(使用 docker-compose 设置)。

the key is that localhost in the superset docker container doesn't point at the host, but instead at the docker container.关键是超集 docker 容器中的 localhost 不指向主机,而是指向 docker 容器。

when i changed the superset datasource to this, it worked...当我将超集数据源更改为此时,它起作用了...

druid://host.docker.internal:8082/druid/v2/sql/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM