Last active
May 16, 2019 21:29
-
-
Save PeterCorless/207dafb62ae72aa3c6c00617bfeff3bc to your computer and use it in GitHub Desktop.
scylla-kafka-akka-mqtt-blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar -xzf confluent-5.0.0-2.11.tar.gz | |
cd confluent-5.0.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ export PATH="$PATH:/YOUR_LOCAL_PATH_TO_BINARIES/confluent-5.0.0/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$confluent start kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$bin/zookeeper-server-start ./etc/kafka/zookeeper.properties | |
$bin/kafka-server-start ./etc/kafka/server.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
topic.regex.list=temperature:.*temperature, brightness:.*brightness | |
listeners=0.0.0.0:1883 | |
bootstrap.servers=PLAINTEXT://localhost:9092 | |
confluent.topic.replication.factor=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$bin/kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic temperature | |
$bin/kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic brightness |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$bin/kafka-mqtt-start kafka-mqtt-dev.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$brew install mosquitto | |
$brew link mosquitto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$mosquitto_pub -h 0.0.0.0 -p 1883 -t car/engine/temperature -q 2 -m "190F" | |
$mosquitto_pub -h 0.0.0.0 -p 1883 -t car/engine/temperature -q 2 -m "200F" | |
$mosquitto_pub -h 0.0.0.0 -p 1883 -t car/engine/temperature -q 2 -m "210F" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$kafka-console-consumer --bootstrap-server localhost:9092 \ | |
--topic temperature \ | |
--property print.key=true \ | |
--from-beginning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; do echo $(( $RANDOM % (231-180) + 180)); sleep .2; done | \ | |
mosquitto_pub -h 0.0 .0.0 -p 1883 -t car/engine/temperature -q 2 -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$git clone https://github.com/scylladb/scylla-code-samples/ | |
$cd gce_deploy_and_install_scylla_cluster | |
$./gce_deploy_and_install_scylla_cluster.sh -t n1-standard-16 -n -c5 -v2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cd /confluent-5.0.0/config | |
$touch cassandra-sink.properties | |
$vi cassandra-sink.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Connector `cassandra-sink`: | |
name=cassandra-sink | |
connector.class=com.datamountaineer.streamreactor.connect.cassandra.sink.CassandraSinkConnector | |
tasks.max=1 | |
topics=temperature | |
connect.cassandra.kcql=INSERT INTO temperature SELECT * FROM temperature | |
connect.cassandra.contact.points=<IP1>,<IP2> (public IP addresses SCYLLA nodes) | |
connect.cassandra.port=9042 | |
connect.cassandra.key.space=demo | |
connect.cassandra.username=cassandra | |
connect.cassandra.password=cassandra | |
connect.progress.enabled=true | |
#task ids: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cd /confluent-5.0.0/lib | |
$wget https://github.com/Landoop/stream-reactor/releases/download/1.1.0/stream-reactor-1.1.0-1.1.0.tar.gz | |
$tar -xzf stream-reactor-1.1.0-1.1.0.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$connect-distributed etc/schema-registry/connect-avro-distributed.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cd /confluent-5.0.0/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$java -jar kafka-connect-cli-0.6-all.jar create cassandra-sink < cassandra-sink.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$./sensor_generator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment