Skip to content

Commit d193a21

Browse files
committed
revert original conf to avoid changes in the base params
1 parent d930067 commit d193a21

File tree

4 files changed

+115
-18
lines changed

4 files changed

+115
-18
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ COPY . .
2020
run python3.8 -m pip wheel --wheel-dir=/tmp/clickkhouse-mysql-data-reader/ .
2121
run find /tmp/clickkhouse-mysql-data-reader/ -name *.whl -exec pip install {} \;
2222

23-
ENTRYPOINT ["./init.sh"]
24-
cmd ["--config-file=./clickhouse-mysql.conf"]
23+
ENTRYPOINT ["./init-docker.sh"]
24+
cmd ["--config-file=./clickhouse-mysql-docker.conf"]

clickhouse-mysql-docker.conf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
tb_host=https://api.tinybird.co
2+
tb_token=
3+
4+
log_file=/mnt/disks/tb/tinybird_mysql_connector/main.log
5+
log_level=debug
6+
nice_pause=1
7+
8+
binlog_position_file=/mnt/disks/tb/tinybird_mysql_connector/syncer_files/bl-raw_landing-local-pos
9+
10+
mempool=yes
11+
mempool_max_events_num=10
12+
mempool_max_flush_interval=5
13+
csvpool=yes
14+
csvpool_file_path_prefix=/mnt/disks/tb/tinybird_mysql_connector/syncer_files/raw_landing_local_
15+
#csvpool_keep_files=yes
16+
pump_data=yes
17+
18+
src_server_id=1
19+
src_host=127.0.0.1
20+
#src_port=3306
21+
src_user=clickhouse_mysql_reader
22+
src_password=1234
23+
src_schemas=clickhouse_mysql_reader
24+
src_tables=one,two
25+
src_wait=yes
26+
src_resume=yes
27+
28+
dst_table=raw_landing
Lines changed: 72 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,84 @@
1-
tb_host=https://api.tinybird.co
2-
tb_token=
1+
# INTRODUCTION
2+
#
3+
# 1. Parameters accept both variants for naming - with '_' as a words separator or '-'.
4+
# The former is used for ENV VARS, the latter - for CLI options.
5+
# Config file accepts both, thus 'log_file' equals to 'log-file'
6+
#
7+
# 2. Lists are specified with ',' as a separator
8+
# For example, in case we'd like to specify two entries for `src_tables_prefixes` option:
9+
# src_tables_prefixes=performance_log_, indexing_log_
10+
#
11+
# 3. Boolean parameters accept case-insensitive 'yes', 'no', 'on', 'off', 1 or 0 values
12+
#
13+
# 4. Each parameter must have a value, thus
14+
# 'dry=yes' is ok,
15+
# 'dry=' is not that good, but will be interpreted as an empty line, while
16+
# 'dry' is a syntax error - not recognized to as a value - no '=' and right part value specified
17+
#
18+
# 5. Comments are '#'-only. So, php-like ';' is not accepted as a comment symbol in config file
19+
#
20+
# general app section
21+
#
322

4-
log_file=/mnt/disks/tb/tinybird_mysql_connector/main.log
23+
#config_file=clickhouse-mysql.conf
24+
#log_file=/var/log/clickhouse-mysql/main.log
525
log_level=debug
626
nice_pause=1
7-
8-
binlog_position_file=/mnt/disks/tb/tinybird_mysql_connector/syncer_files/bl-raw_landing-local-pos
9-
27+
#dry=yes
28+
#daemon=yes
29+
#pid_file=/tmp/clickhouse-client.pid
30+
#binlog_position_file=/tmp/clickhouse-mysql-binlog.pos
1031
mempool=yes
11-
mempool_max_events_num=10
12-
mempool_max_flush_interval=5
13-
csvpool=yes
14-
csvpool_file_path_prefix=/mnt/disks/tb/tinybird_mysql_connector/syncer_files/raw_landing_local_
32+
#mempool_max_events_num=10000
33+
#mempool_max_rows_num=
34+
#mempool_max_flush_interval=60
35+
#csvpool=yes
36+
#csvpool_file_path_prefix=qwe_
1537
#csvpool_keep_files=yes
38+
#create_table_sql_template=yes
39+
#create_table_sql=yes
40+
#with_create_database=yes
41+
#create_table_json_template=yes
42+
migrate_table=yes
1643
pump_data=yes
1744

45+
#
46+
# src section
47+
#
48+
1849
src_server_id=1
1950
src_host=127.0.0.1
2051
#src_port=3306
21-
src_user=clickhouse_mysql_reader
22-
src_password=1234
23-
src_schemas=clickhouse_mysql_reader
24-
src_tables=one,two
52+
src_user=reader
53+
src_password=qwerty
54+
#src_schemas=db1, db2, db3
55+
src_tables=airline.ontime
56+
#src_tables_where_clauses=a=1
57+
#src_tables_prefixes=log_, log1_, log2_
2558
src_wait=yes
26-
src_resume=yes
59+
#src_resume=yes
60+
#src_file=
61+
#src_binlog_file=mysql-bin.000024
62+
#src_binlog_position=5307
63+
64+
#
65+
# dst section
66+
#
67+
68+
#dst_file=dst.csv
69+
dst_host=127.0.0.1
70+
#dst_port=
71+
#dst_user=default
72+
#dst_password=
73+
#dst_schema=db
74+
#dst_table=logunified
75+
dst_create_table=yes
76+
77+
#
78+
# converters section
79+
#
2780

28-
dst_table=raw_landing
81+
#column_default_value=
82+
#column_skip=
83+
#ch_converter_file=
84+
#ch_converter_class=

init-docker.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
mysqld &
4+
sleep 5
5+
mysql -e "create user 'clickhouse_mysql_reader'@'%' identified by '1234';"
6+
mysql -e "create database clickhouse_mysql_reader"
7+
mysql -e "grant super on *.* to 'clickhouse_mysql_reader';"
8+
mysql -e "grant replication slave on *.* to 'clickhouse_mysql_reader';"
9+
10+
mysql -e "use clickhouse_mysql_reader; create table one (id int, field varchar(10));"
11+
mysql -e "use clickhouse_mysql_reader; create table two (id int, field varchar(10));"
12+
13+
clickhouse-mysql $@ #--config-file=./clickhouse-mysql.conf

0 commit comments

Comments
 (0)