【发布时间】:2021-04-29 23:01:27
【问题描述】:
我在 azure VM 上托管了一个 clickhouse 服务器 (我可以在 VM 内运行 clickhouse-client) 使用 nginx 代理,下面是 nginx 设置
server {
listen 5000;
server_name myhost.cloudapp.azure.com;
location / {
proxy_pass http://localhost:8123;
}
server {
listen 6000;
server_name myhost.cloudapp.azure.com;
location / {
proxy_pass http://localhost:9000;
}
我能够以正确的响应卷曲两个端点,例如
curl http://myhost.cloudapp.azure.com:6000
Port 9000 is for clickhouse-client program.
You must use port 8123 for HTTP.
curl http://myhost.cloudapp.azure.com:5000
Ok.
但是,当我尝试执行 clickhouse-client -h myhost.cloudapp.azure.com --port 6000 时,我得到以下信息。
clickhouse-client -h myhost.cloudapp.azure.com --port 6000
ClickHouse client version 21.1.2.15 (official build).
Connecting to myhost.cloudapp.azure.com:6000 as user default.
Code: 102. DB::NetException: Unexpected packet from server bs-
clickhouse.westeurope.cloudapp.azure.com:6000 (expected Hello or Exception, got Unknown packet)
clickhouse-server的连接设置如下:
<listen_host>::</listen_host>
我不知道我做错了什么,感谢任何提示。
【问题讨论】:
-
您确定端口 6000 未与其他应用共享(请参阅stackoverflow.com/questions/50490543/…)?
-
检查 clickhouse-server 和 clickhouse-client 的版本是否相同。
标签: clickhouse