Skip to content

Instantly share code, notes, and snippets.

View noemi-dresden's full-sized avatar
🎯
Focusing

Salohy Miarisoa noemi-dresden

🎯
Focusing
View GitHub Profile
@noemi-dresden
noemi-dresden / Kafka-cluster.yml
Created July 18, 2019 12:32
Kafka cluster using docker swarm and confluentinc image, managed by kafka-manager
version: "3"
services:
zookeeper-1:
image: confluentinc/cp-zookeeper:latest
hostname: zookeeper-1
ports:
- "12181:12181"
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 12181
@noemi-dresden
noemi-dresden / submit.sh
Last active March 28, 2019 20:24
spark submit in docker without metrics
docker run --name spark-app \
-e ENABLE_INIT_DAEMON=false \
--link spark-master:spark-master \
--network=same-network-as-master-and-worker \
spark-app
@noemi-dresden
noemi-dresden / docker-compose.yml
Created March 28, 2019 19:44
Complete compose file for monitoring spark on prometheus
version: "3.1"
services:
spark-master:
image: bde2020/spark-master:2.4.0-hadoop2.7
container_name: spark-master
ports:
- "8080:8080"
- "7077:7077"
environment:
- INIT_DAEMON_STEP=setup_spark
@noemi-dresden
noemi-dresden / graphite_mapping.conf
Created March 28, 2019 19:29
graphite_mapping conf file for spark
mappings:
- match: '*.*.jvm.*.*'
name: jvm_memory_usage
labels:
application: $1
executor_id: $2
mem_type: $3
qty: $4
- match: '*.*.jvm.pools.*.*'
@noemi-dresden
noemi-dresden / graphite_exporter.yml
Created March 28, 2019 19:24
Graphite exporter service
graphite_exporter:
image: prom/graphite-exporter
command: "--graphite.mapping-config=/tmp/graphite_mapping.conf"
container_name: graphite_exporter
volumes:
- path/to-your/graphite_mapping.conf:/tmp/graphite_mapping.conf
ports:
- "9108:9108"
- "9109:9109"
- "9109:9109/udp"
@noemi-dresden
noemi-dresden / metrics.properties
Created March 28, 2019 19:10
spark properties file allowing to sink to graphite
*.sink.graphite.class=org.apache.spark.metrics.sink.GraphiteSink
*.sink.graphite.host=graphite_exporter
*.sink.graphite.port=9109
*.sink.graphite.period=10
*.sink.graphite.unit=seconds
# Enable JvmSource for instance master, worker, driver and executor
master.source.jvm.class=org.apache.spark.metrics.source.JvmSource
worker.source.jvm.class=org.apache.spark.metrics.source.JvmSource
@noemi-dresden
noemi-dresden / submit.sh
Last active March 28, 2019 20:24
Spark submit using docker
docker run --name spark-app \
-e ENABLE_INIT_DAEMON=false \
--link spark-master:spark-master \
-v path/to-your/metrics.properties:/spark/conf/metrics.properties \
--network=same-network-as-master-and-worker \
spark-app
@noemi-dresden
noemi-dresden / docker-compose.yml
Created March 28, 2019 18:20
Spark standalone cluster using docker
version: "3.1"
services:
spark-master:
image: bde2020/spark-master:2.4.0-hadoop2.7
container_name: spark-master
ports:
- "8080:8080"
- "7077:7077"
volumes:
- ${PWD}/spark/metrics.properties:/spark/conf/metrics.properties
@noemi-dresden
noemi-dresden / datasource.yaml
Last active March 28, 2019 17:34
Prometheus and Grafana
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus-ip:9090
@noemi-dresden
noemi-dresden / fixshbadinterpreter.md
Last active March 8, 2019 20:30
fix / /bin/sh^M : bad interpreter

Fix /bin/sh^M : bad interpreter when running a shell script

  1. Open the script using vi or vim
  2. Type esc
  3. Type :set fileformat=unix
  4. Save with :wq!