nikepan / clickhouse-bulk

Collects many small inserts to ClickHouse and send in big inserts
Apache License 2.0
474 stars 87 forks source link

connect.Ping() results in bad connection error #13

Closed rodrigo-garcia-edo closed 4 years ago

rodrigo-garcia-edo commented 5 years ago

One common practice after creating the connection is to check for Ping/Pong from server

if err := connect.Ping(); err != nil {
    logger.Fatal(err)
    return nil, err
}

This method works as intended when connecting to a clickhouse server via either http or tcp.

When i connect instead to clickhouse-bulk http i receive bad connection error from the driver.

nikepan commented 4 years ago

I think, you use https://github.com/kshvakov/clickhouse/, it use TCP protocol. clickhouse-bulk uses only simple HTTP requests (