housepower / clickhouse_sinker

Easily load data from kafka to ClickHouse
https://housepower.github.io/clickhouse_sinker
Apache License 2.0
516 stars 118 forks source link

关于怎么使用的问题 #9

Closed panda403 closed 4 years ago

panda403 commented 5 years ago

我下载https://github.com/housepower/clickhouse_sinker/releases/download/v1.3/clickhouse_sinker_1.3_linux_amd64.zip的时候,解压发现里面有clickhouse_sinker和README.md两个文件,手动在相同的目录下编写了conf.json文件,文件如下: { "clickhouse": { "ch1": { "db": "default", "host": "127.0.0.1", "dnsLoop" : false, "maxLifeTime": 300, "password": "123456", "port": 9000, "username": "default" } }, "kafka": { "kfk1": { "brokers": "127.0.0.1:9092", "sasl": { "password": "", "username": "" } } }, "common": { "bufferSize": 90000, "flushInterval": 5, "logLevel": "info" } } 然后运行:./clickhouse_sinker -conf binlog.json 报错: 2019/07/12 11:31:52 Initial [clickhouse_sinker] panic: stat binlog.json/config.json: not a directory

goroutine 1 [running]: github.com/housepower/clickhouse_sinker/creator.InitConfig(0x7ffe95ae746b, 0xb, 0x1fdd80) /Users/sundy/pan/gopath/src/github.com/housepower/clickhouse_sinker/creator/config.go:41 +0x371 main.main.func1(0x9078dc, 0xc) /Users/sundy/pan/gopath/src/github.com/housepower/clickhouse_sinker/bin/main.go:42 +0x5d github.com/housepower/clickhouse_sinker/vendor/github.com/wswz/go_commons/app.Run(0x90a6dd, 0x11, 0xc0000f9f28, 0xc0000bb1b0, 0xc0000f9f08) /Users/sundy/pan/gopath/src/github.com/housepower/clickhouse_sinker/vendor/github.com/wswz/go_commons/app/app.go:26 +0xad main.main() /Users/sundy/pan/gopath/src/github.com/housepower/clickhouse_sinker/bin/main.go:41 +0x13a 请问这个是怎么使用的呢

sundy-li commented 5 years ago

sorry, -conf 指定的是目录名

taiyang-li commented 5 years ago

@panda403 可参考我的学习笔记 http://note.youdao.com/noteshare?id=c4b4a84a08e2312da6c6d733a5074c7a&sub=7C5BE2C626DE416CA8AD4C4908527B62

sundy-li commented 5 years ago

@taiyang-li 👍