我在使用python驱动程序连接到windows docker容器中的clickhouse时遇到问题。Clickhouse服务器运行在我的E盘上,在一个docker容器中,它暴露在端口8123上。我可以在R中使用这个包https://github.com/hannesmuehleisen/clickhouse-r轻松连接,如下所示:
conn = DBI::dbConnect(clickhouse::clickhouse(),
host = "my_ip",
port = 8123L,
user = "myun",
password = "mypwd")
但是当我在python中使用https://clickhouse-driver.readthedocs.io/en/latest/quickstart.html尝试相同的操作时,我遇到了一个问题:
^{pr2}$有人知道问题出在哪里吗?在
更新:
尝试安全=F并得到:
File "d:\ProgramData\Anaconda3\lib\site-packages\clickhouse_driver\connection.py", line 243, in connect
'{} ({})'.format(e.strerror, self.get_description())
SocketTimeoutError: Code: 209. None
ClickHouse服务器和客户端之间的通信有两种协议:http(端口8123)和本机(端口9000)。在
Http适用于curl/wget和其他工具。大多数ClickHouse客户端使用http进行数据传输。在你的案子里包括R。但是有些客户机使用本机协议(go和这个python客户机)。这个协议应该比http更有效。https://clickhouse-driver.readthedocs.io/en/latest/#user-s-guide
从服务器容器中公开端口9000并在客户端中使用它。此端口也是此客户端中的默认端口。在
相关问题 更多 >
编程相关推荐