Skip to content

Commit

Permalink
fix doc typo
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhichang committed May 20, 2021
1 parent 119947e commit 97d2697
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/dev/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ Controled by:
- CLI parameters: `nacos-addr, nacos-username, nacos-password, nacos-namespace-id, nacos-group, nacos-dataid`
- env variables: `NACOS_ADDR, NACOS_USERNAME, NACOS_PASSWORD, NACOS_NAMESPACE_ID, NACOS_GROUP, NACOS_DATAID`

### Local Files
### Local Config File

Currently sinker is able to parse local config files at startup, but unable to detect file changes.
Currently sinker is able to parse local config file at startup, but unable to detect file changes.
Controled by:

- CLI parameters: `local-cfg-file`
Expand Down
27 changes: 15 additions & 12 deletions docs/guide/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Note: Ensure `clickhouse-server` and `kafka` work before running clickhouse_sink

`clickhouse_sinker --nacos-addr 127.0.0.1:8848 --nacos-username nacos --nacos-password nacos --nacos-dataid test_auto_schema`

> Read more detail descriptions of config in [here](docs/config.md)
> Read more detail descriptions of config in [here](../configuration/config.html)
## Example

Expand All @@ -25,21 +25,23 @@ Let's follow up a piece of the systest script.
* Prepare

- let's checkout `clickhouse_sinker`
```

```bash
$ git clone https://github.com/housepower/clickhouse_sinker.git
$ cd clickhouse_sinker
```

- let's start standalone clickhouse-server and kafka in container:
```

```bash
$ docker-compose up -d
```

* Create a simple table in Clickhouse

> It's not the duty for clickhouse_sinker to auto create table, so we should do that manually.
```
```sql
CREATE TABLE IF NOT EXISTS test_auto_schema
(
`day` Date DEFAULT toDate(time),
Expand All @@ -52,12 +54,12 @@ Let's follow up a piece of the systest script.
ORDER BY (time, name);
```

* Enable topic is created in kafka
* Create a topic in kafka

> I use [kaf](https://github.com/birdayz/kaf) tool to create topics.
```
kaf topic create topic1 -p 1 -r 1
```bash
$ kaf topic create topic1 -p 1 -r 1
✅ Created topic!
Topic Name: topic1
Partitions: 1
Expand All @@ -68,21 +70,22 @@ Let's follow up a piece of the systest script.

* Run clickhouse_sinker

```
clickhouse_sinker --local-cfg-file docker/test_auto_schema.json
```bash
$ ./clickhouse_sinker --local-cfg-file docker/test_auto_schema.json
```


* Send messages to the topic

```
```bash
echo '{"time" : "2020-12-18T03:38:39.000Z", "name" : "name1", "value" : 1}' | kaf -b '127.0.0.1:9092' produce topic1
echo '{"time" : "2020-12-18T03:38:39.000Z", "name" : "name2", "value" : 2}' | kaf -b '127.0.0.1:9092' produce topic1
echo '{"time" : "2020-12-18T03:38:39.000Z", "name" : "name3", "value" : 3}' | kaf -b '127.0.0.1:9092' produce topic1
```

- Check the data in clickhouse
```
* Check the data in clickhouse

```sql
SELECT count() FROM test_auto_schema;

3 rows in set. Elapsed: 0.016 sec.
Expand Down

0 comments on commit 97d2697

Please sign in to comment.