{"id":13412079,"url":"https://github.com/nikepan/clickhouse-bulk","last_synced_at":"2025-05-15T13:09:06.928Z","repository":{"id":20439348,"uuid":"89779028","full_name":"nikepan/clickhouse-bulk","owner":"nikepan","description":"Collects many small inserts to ClickHouse and send in big inserts","archived":false,"fork":false,"pushed_at":"2025-04-14T18:53:42.000Z","size":158,"stargazers_count":488,"open_issues_count":28,"forks_count":88,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-15T03:51:29.226Z","etag":null,"topics":["clickhouse","clickhouse-bulk","clickhouse-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikepan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-29T10:38:41.000Z","updated_at":"2025-04-10T19:24:43.000Z","dependencies_parsed_at":"2024-01-30T04:07:34.142Z","dependency_job_id":"37b27040-a4cd-4be9-9ae4-1db01521b673","html_url":"https://github.com/nikepan/clickhouse-bulk","commit_stats":{"total_commits":125,"total_committers":18,"mean_commits":6.944444444444445,"dds":0.5920000000000001,"last_synced_commit":"9251c585086bfb16f8f566b39ac0c33b2d5dd229"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikepan%2Fclickhouse-bulk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikepan%2Fclickhouse-bulk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikepan%2Fclickhouse-bulk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikepan%2Fclickhouse-bulk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikepan","download_url":"https://codeload.github.com/nikepan/clickhouse-bulk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346622,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clickhouse","clickhouse-bulk","clickhouse-server"],"created_at":"2024-07-30T20:01:20.796Z","updated_at":"2025-05-15T13:09:06.591Z","avatar_url":"https://github.com/nikepan.png","language":"Go","funding_links":[],"categories":["Database","Generators","Integrations","数据库  `go语言实现的数据库`","Data Integration Frameworks","数据库","Uncategorized"],"sub_categories":["Database Tools","Advanced Console UIs","Data Transfer and Synchronization","数据库工具"],"readme":"# ClickHouse-Bulk\n\n[![build](https://github.com/nikepan/clickhouse-bulk/actions/workflows/test.yml/badge.svg)](https://github.com/nikepan/clickhouse-bulk/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/nikepan/clickhouse-bulk/branch/master/graph/badge.svg)](https://codecov.io/gh/nikepan/clickhouse-bulk)\n[![download binaries](https://img.shields.io/badge/binaries-download-blue.svg)](https://github.com/nikepan/clickhouse-bulk/releases)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nikepan/clickhouse-bulk)](https://goreportcard.com/report/github.com/nikepan/clickhouse-bulk)\n[![godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/nikepan/clickhouse-bulk)\n\nSimple [Yandex ClickHouse](https://clickhouse.yandex/) insert collector. It collect requests and send to ClickHouse servers.\n\n\n### Installation\n\n[Download binary](https://github.com/nikepan/clickhouse-bulk/releases) for you platorm\n\nor\n\n[Use docker image](https://hub.docker.com/r/nikepan/clickhouse-bulk/)\n\n\nor from sources (Go 1.23+):\n\n```text\ngit clone https://github.com/nikepan/clickhouse-bulk\ncd clickhouse-bulk\ngo build\n```\n\n\n### Features\n- Group n requests and send to any of ClickHouse server\n- Sending collected data by interval\n- Tested with VALUES, TabSeparated formats\n- Supports many servers to send\n- Supports query in query parameters and in body\n- Supports other query parameters like username, password, database\n- Supports basic authentication\n\n\nFor example:\n```sql\nINSERT INTO table3 (c1, c2, c3) VALUES ('v1', 'v2', 'v3')\nINSERT INTO table3 (c1, c2, c3) VALUES ('v4', 'v5', 'v6')\n```\nsends as\n```sql\nINSERT INTO table3 (c1, c2, c3) VALUES ('v1', 'v2', 'v3')('v4', 'v5', 'v6')\n```\n\n\n### Options\n- -config - config file (json); default _config.json_\n\n\n### Configuration file\n```json lines\n{\n  \"listen\": \":8124\",\n  \"flush_count\": 10000, // check by \\n char\n  \"flush_interval\": 1000, // milliseconds\n  \"clean_interval\": 0, // how often cleanup internal tables - e.g. inserts to different temporary tables, or as workaround for query_id etc. milliseconds\n  \"remove_query_id\": true, // some drivers sends query_id which prevents inserts to be batched\n  \"dump_check_interval\": 300, // interval for try to send dumps (seconds); -1 to disable\n  \"debug\": false, // log incoming requests\n  \"dump_dir\": \"dumps\", // directory for dump unsended data (if clickhouse errors)\n  \"clickhouse\": {\n    \"down_timeout\": 60, // wait if server in down (seconds)\n    \"connect_timeout\": 10, // wait for server connect (seconds)\n    \"tls_server_name\": \"\", // override TLS serverName for certificate verification (e.g. in cases you share same \"cluster\" certificate across multiple nodes)\n    \"insecure_tls_skip_verify\": false, // INSECURE - skip certificate verification at all\n    \"servers\": [\n      \"http://127.0.0.1:8123\"\n    ]\n  },\n  \"metrics_prefix\": \"prefix\"\n}\n```\n\n### Environment variables (used for docker image)\n\n* `CLICKHOUSE_BULK_DEBUG` - enable debug logging\n* `CLICKHOUSE_SERVERS` - comma separated list of servers\n* `CLICKHOUSE_FLUSH_COUNT` - count of rows for insert\n* `CLICKHOUSE_FLUSH_INTERVAL` - insert interval\n* `CLICKHOUSE_CLEAN_INTERVAL` - internal tables clean interval\n* `DUMP_CHECK_INTERVAL` - interval of resend dumps\n* `CLICKHOUSE_DOWN_TIMEOUT` - wait time if server is down\n* `CLICKHOUSE_CONNECT_TIMEOUT` - clickhouse server connect timeout\n* `CLICKHOUSE_TLS_SERVER_NAME` - server name for TLS certificate verification\n* `CLICKHOUSE_INSECURE_TLS_SKIP_VERIFY` - skip certificate verification at all\n* `METRICS_PREFIX` - prefix for prometheus metrics\n\n### Quickstart\n\n`./clickhouse-bulk`\nand send queries to :8124\n\n### Metrics\nmanual check main metrics\n`curl -s http://127.0.0.1:8124/metrics | grep \"^ch_\"`\n* `ch_bad_servers 0` - actual count of bad servers\n* `ch_dump_count 0` - dumps saved from launch\n* `ch_queued_dumps 0` - actual dump files id directory\n* `ch_good_servers 1` - actual good servers count\n* `ch_received_count 40` - received requests count from launch\n* `ch_sent_count 1` - sent request count from launch\n\n\n### Tips\n\nFor better performance words FORMAT and VALUES must be uppercase.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikepan%2Fclickhouse-bulk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikepan%2Fclickhouse-bulk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikepan%2Fclickhouse-bulk/lists"}