This file contains hidden or 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
| ######### | |
| This is a step by step instruction for running a cluster of 3 Scylla nodes and a Scylla monitoring servers, all as Docker images on the same box. | |
| ######### | |
| # prerequisites (centos 7) | |
| sudo yum install tmux emacs git wget -y | |
| sudo tee /etc/yum.repos.d/docker.repo <<-'EOF' | |
| [dockerrepo] | |
| name=Docker Repository |
This file contains hidden or 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
| ;; CQL | |
| CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; | |
| use mykeyspace ; | |
| CREATE TABLE users (user_id int PRIMARY KEY, fname text, lname text); | |
| insert into users (user_id , fname, lname) values (1, 'tzach', 'livyatan'); | |
| insert into users (user_id , fname, lname) values (2, 'dor', 'laor'); | |
| insert into users (user_id , fname, lname) values (3, 'shlomi', 'laor'); | |
| insert into users (user_id , fname, lname) values (4, 'shlomi', 'livne'); | |
| insert into users (user_id , fname, lname) values (6, 'avi', 'kivity'); |
This file contains hidden or 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
| (custom-set-variables | |
| ;; custom-set-variables was added by Custom. | |
| ;; If you edit it by hand, you could mess it up, so be careful. | |
| ;; Your init file should contain only one such instance. | |
| ;; If there is more than one, they won't work right. | |
| '(erc-nick "tzach") | |
| '(package-selected-packages | |
| (quote | |
| (magithub magit helm cider emacsql-mysql twittering-mode ## yaml-mode starter-kit-ruby starter-kit-js starter-kit-eshell starter-kit-bindings scss-mode scala-mode markdown-preview-mode markdown-preview-eww less-css-mode langtool json-mode json js2-mode es-windows emstar clojure-project-mode))) | |
| '(show-paren-mode t)) |
This file contains hidden or 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
| /***************************/ | |
| /* simple robot car */ | |
| /***************************/ | |
| // engine part from | |
| // http://www.instructables.com/id/Control-DC-and-stepper-motors-with-L298N-Dual-Moto/?ALLSTEPS | |
| // sndor part from | |
| // http://www.instructables.com/id/Simple-Arduino-and-HC-SR04-Example/?ALLSTEPS | |
| /* |
This file contains hidden or 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
| CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; | |
| use mykeyspace; | |
| CREATE TABLE counts (value counter, name varchar, PRIMARY KEY (name)); | |
| UPDATE mykeyspace.counts set value = value + 3 WHERE name = 'tzach'; | |
| select * from mykeyspace.counts; |
This file contains hidden or 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
| (custom-set-variables | |
| ;; custom-set-variables was added by Custom. | |
| ;; If you edit it by hand, you could mess it up, so be careful. | |
| ;; Your init file should contain only one such instance. | |
| ;; If there is more than one, they won't work right. | |
| '(erc-nick "tzach") | |
| '(package-selected-packages | |
| (quote | |
| (wc-mode arduino-mode magithub magit helm cider emacsql-mysql twittering-mode ## yaml-mode starter-kit-ruby starter-kit-js starter-kit-eshell starter-kit-bindings scss-mode scala-mode markdown-preview-mode markdown-preview-eww less-css-mode langtool json-mode json js2-mode es-windows emstar clojure-project-mode))) | |
| '(show-paren-mode t)) |
This file contains hidden or 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
| echo "even more custom!" > /home/centos/more_test.txt |
This file contains hidden or 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
| ### Scylla | |
| docker run --name some-scylla -d scylladb/scylla:2.1.3 | |
| docker cp data.cql some-scylla:/data.cql | |
| docker exec -it some-scylla cqlsh -f data.cql | |
| ### Spark | |
| docker run -it -p 4040:4040 -p 8080:8080 -p 8081:8081 -p 10000:10000 -h spark --name=spark -d p7hb/docker-spark | |
| docker exec -it spark /usr/local/spark-2.2.0-bin-hadoop2.7/sbin/start-thriftserver.sh \ | |
| --conf hive.server2.thrift.bind.host=0.0.0.0 \ | |
| --conf spark.cassandra.connection.host=172.17.0.2 \ |
This file contains hidden or 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
| CREATE KEYSPACE IF NOT EXISTS mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; | |
| USE mykeyspace; | |
| CREATE TABLE IF NOT EXISTS air_quality_data (sensor_id text,time timestamp,location text, co_ppm int,PRIMARY KEY (sensor_id, time)); | |
| INSERT INTO air_quality_data(sensor_id, time, location, co_ppm) VALUES ('my_home', '2018-06-05 07:01:00', 'ISR', 17); | |
| INSERT INTO air_quality_data(sensor_id, time, location, co_ppm) VALUES ('my_home', '2018-06-06 07:02:01', 'ISR', 18); | |
| INSERT INTO air_quality_data(sensor_id, time, location, co_ppm) VALUES ('my_home', '2018-06-07 07:03:02', 'ISR', 19); | |
| INSERT INTO air_quality_data(sensor_id, time, location, co_ppm) VALUES ('my_home', '2018-06-08 07:04:03', 'ISR', 20); | |
| INSERT INTO air_quality_data(sensor_id, time, location, co_ppm) VALUES ('my_home', '2018-06-09 07:05:04', 'ISR', 30); | |
| INSERT INTO air_quality_data(sensor_id, time, location, co_ppm) VALUES ('my_home', '2018-06-10 07:06:04', 'ISR', 31); | |
| INSERT INTO air_quality_data(sensor_id, time, loc |
This file contains hidden or 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
| databases: | |
| - allow_run_async: true | |
| database_name: HiveSparkScylla | |
| expose_in_sqllab: true | |
| extra: "{\r\n \"metadata_params\": {},\r\n \"engine_params\": {}\r\n}\r\n" | |
| sqlalchemy_uri: hive://172.17.0.3:10000/default | |
| tables: | |
| - columns: | |
| - {avg: true, column_name: co_ppm, sum: true, type: INT} | |
| - {column_name: sensor_id, filterable: true, groupby: true, type: STRING} |