本文介绍了带有SQLAlchemy的Docker中Clickhouse的超集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Clickhouse设置Apache Superset.到目前为止,我的理解是我需要为Clickhouse安装SQLAlchemy https://github.com/xzkostyan/clickhouse-sqlalchemy

我在Ubuntu 16.04 LTS中,并使用Clickhouse和Superset的Docker Vanilla版本:

没有特殊设置

有什么主意如何将两个docker容器与clickhouse-sqlalchemy桥接?在那种情况下如何安装?(如果您有示例命令行,我可以重复使用,那将会很棒)

解决方案

您不需要桥接它们:您想要的是一个超集服务器(您恰好通过docker运行)来连接到Clickhouse数据库(您也恰巧通过docker运行).

您也不需要安装Clickhouse的SQLAlchemy:在 https://hub.docker.com/r/amancevice/superset/~/dockerfile/该映像已经为您安装了 sqlalchemy-clickhouse .

您的步骤应如下:

  • 当您 docker运行--detach --name超集[选项] amancevice/superset 时,您的超集实例应在 http://localhost:8088/

  • 类似地,当您运行 $ docker run -d --name some-clickhouse-server --ulimit nofile = 262144:262144 -v/path/to/your/config.xml:/etc/clickhouse-server/config.xml yandex/clickhouse-server ,您应该最终获得一个Clickhouse实例,该实例可以通过SQLAlchemy在类似 clickhouse://default上进行访问:@ some-clickhouse-server/test 您需要根据config.xml修改该连接URI-您应该能够通过在python控制台中连接它来再次检查它是否有效.

  • 然后,您应该能够以与连接任何其他数据库相同的方式将超集连接到Clickhouse db:导航到Superset的菜单>源">数据库">"[新]"

I'm trying to setup Apache Superset for Clickhouse.My understanding so far is that I need to install SQLAlchemy for Clickhousehttps://github.com/xzkostyan/clickhouse-sqlalchemy

I'm in Ubuntu 16.04 LTS, and using the Docker vanilla version of Clickhouse and of Superset:

without special settings

Any idea how I can bridge the two docker containers with clickhouse-sqlalchemy ?Where and how in that case to install that?(if you have sample command line that I can reuse that will be great)

解决方案

You don't need to bridge them: what you want is a superset server (that you happen to be running via docker) to connect to a clickhouse database (that you also happen to be running via docker).

You also shouldn't need to install SQLAlchemy for Clickhouse: looking at the dockerfile at https://hub.docker.com/r/amancevice/superset/~/dockerfile/ that image has already sqlalchemy-clickhouse installed for you.

Your steps should be as follow:

  • When you docker run --detach --name superset [options] amancevice/superset you should have your superset instance running at http://localhost:8088/

  • Similarly, when you run $ docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 -v /path/to/your/config.xml:/etc/clickhouse-server/config.xml yandex/clickhouse-server you should end-up with a clickhouse instance that you can access via SQLAlchemy at something like clickhouse://default:@some-clickhouse-server/testYou'd need to modify that connection URI based on your config.xml - and you should be able to double-check that it works by connecting to it in your python console.

  • You should then be able to connect superset to your clickhouse db in the same way you'd connect to any other DB: by navigating into Superset's menu > Sources > Databases > [new]

这篇关于带有SQLAlchemy的Docker中Clickhouse的超集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-17 07:14