You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#528: Update README with Kafka producer and more fixes from testing.
Summary:
Also includes:
- Removed iot-app example from README.
- Fix null value bind for non-existing columns.
- More sanity checks.
- Corner case checks for some data types.
Test Plan:
Ran the following and ensured table has the data.
```
./bin/connect-standalone ./etc/kafka/kafka.connect.properties ./etc/kafka-connect-yugabyte/yugabyte.sink.properties
```
Reviewers: mihnea
Reviewed By: mihnea
Subscribers: yql
Differential Revision: https://phabricator.dev.yugabyte.com/D5656
Copy file name to clipboardexpand all lines: README.md
+92-59
Original file line number
Diff line number
Diff line change
@@ -2,51 +2,65 @@
2
2
3
3
This is the framework to connect Kafka streams to use [YugaByte DB](https://github.com/YugaByte/yugabyte-db) as the data sink using the [Kafka Connect](https://docs.confluent.io/3.0.0/connect/intro.html) mechanism.
4
4
5
-
NOTE: This is a highly work in progress repo and the instructions/steps below can change.
6
-
7
5
## Prerequisites
8
6
9
-
For building these projects it requires following tools. Please refer README.md files of individual projects for more details.
7
+
For building and using this project, we requires following tools pre-installed on the system.
10
8
- JDK - 1.8+
11
9
- Maven - 3.3+
12
-
- Cassandra Core driver - 3.2.0
13
-
- Confluent Kafka (we assume this is installed in the `~/code/confluent-os/confluent-5.0.0` directory).
14
10
15
11
## Steps to setup and run connect sink
16
-
1. Download Confluent Open Source from https://www.confluent.io/download/. Unbundle the content of the tar.gz to say ```~/code/confluent-os/confluent-5.0.0```.
12
+
1. Download Confluent Open Source from https://www.confluent.io/download/. This is a manual step, as Email id is needed (as of Nov 2018).
13
+
Unbundle the content of the tar.gz to location `~/yb-kafka/confluent-os/confluent-5.0.0` using these steps.
14
+
```
15
+
mkdir -p ~/yb-kafka/confluent-os
16
+
cd ~/yb-kafka/confluent-os
17
+
tar -xvf confluent-5.0.0-2.11.tar.gz
18
+
```
17
19
18
20
2. Include the YugaByte DB sink into the registered connectors:
19
-
- Add the "yb-sink=kafka-connect-yugabyte/sink.properties" in bin/confluent file within the `declare -a connector_properties={` scope.
20
-
- Copy the sample kafka-sink properties file from this repos `resources/examples/kafka.connector` to `~/code/confluent-os/confluent-5.0.0/etc/kafka-connect-yugabyte/`
21
-
- For now, set the following in the ```~/code/confluent-os/confluent-5.0.0/etc/kafka/connect-standalone.properties``` file
21
+
- Add `yb-sink=kafka-connect-yugabyte/kafka.sink.properties` to `~/yb-kafka/confluent-os/confluent-5.0.0/bin/confluent` file in this scope:
- Download the dependent jars from maven central repository using the following commands.
31
38
```
32
-
- Copy all the dependent jars from Cassandra into the same folder. Most of these can be downloaded from maven central repository. The final list of jars should look like this:
39
+
cd ~/yb-kafka/confluent-os/confluent-5.0.0/share/java/kafka-connect-yugabyte/
The output for the `confluent status` should look like
50
64
```
51
65
control-center is [UP]
52
66
ksql-server is [UP]
@@ -58,55 +72,74 @@ For building these projects it requires following tools. Please refer README.md
58
72
```
59
73
60
74
5. Install YugaByte DB and create the keyspace/table.
61
-
- [Install YugaByte DB and start a local cluster](https://docs.yugabyte.com/quick-start/install/).
62
-
- Create the keyspace and table by running the following command. You can find `cqlsh` in the `bin` sub-directory located inside the YugaByte installation folder.
63
-
```sh
64
-
cqlsh -f resources/examples/table.cql
65
-
```
66
-
67
-
6. Create a topic (one time)
75
+
- [Install YugaByte DB and start a local cluster](https://docs.yugabyte.com/quick-start/install/).
76
+
- Create a keyspace and table by running the following command. You can find `cqlsh` in the `bin` sub-directory located inside the YugaByte installation folder.
cd ~/code/confluent-os/confluent-5.0.0; ./bin/connect-standalone ./etc/kafka/connect-standalone.properties ./etc/kafka-connect-yugabyte/sink.properties
90
+
{"key" : "A", "value" : 1, "ts" : 20002000}
91
+
{"key" : "B", "value" : 2, "ts" : 20002020}
92
+
{"key" : "C", "value" : 3, "ts" : 20202020}
80
93
```
81
-
Note: In the connect-standalone need to set *.enable.schema to false.
94
+
Feel free to Ctrl-C this process or switch to a different shell as more values can be added later as well to the same topic.
82
95
83
-
You should see something like this (relevant lines from YBSinkTask.java):
84
-
```
85
-
[2018-10-28 16:24:16,037] INFO Start with keyspace=iotdemo, table=ingress (com.yb.connect.sink.YBSinkTask:69)
86
-
[2018-10-28 16:24:16,054] INFO Connecting to nodes: /127.0.0.1:9042,/127.0.0.2:9042,/127.0.0.3:9042 (com.yb.connect.sink.YBSinkTask:149)
87
-
[2018-10-28 16:24:16,517] INFO Connected to cluster: cluster1 (com.yb.connect.sink.YBSinkTask:155)
88
-
[2018-10-28 16:24:16,594] INFO Processing 1 records from Kafka. (com.yb.connect.sink.YBSinkTask:419)
89
-
[2018-10-28 16:24:16,612] INFO Prepare SinkRecord ...
90
-
[2018-10-28 16:24:16,618] INFO Bind timestamp of type timestamp (com.yb.connect.sink.YBSinkTask:204)
0 commit comments