https://github.com/previousdeveloper/es-spark
Simple Elasticsearch Spark Example
https://github.com/previousdeveloper/es-spark
Last synced: 2 months ago
JSON representation
Simple Elasticsearch Spark Example
- Host: GitHub
- URL: https://github.com/previousdeveloper/es-spark
- Owner: previousdeveloper
- Created: 2017-01-18T06:30:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-25T20:03:57.000Z (almost 9 years ago)
- Last Synced: 2024-12-29T06:29:52.692Z (4 months ago)
- Language: Scala
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Elasticsearch Spark Example
# Vagrant
Create development environment (requires Vagrant and VirtualBox) and login:
```
vagrant up && vagrant ssh
```# Build
Use Scala Build Tool:
```
sbt package
```This builds a jar in the target directory.
# Elasticsearch
Start elasticsearch docker container:
```
docker-compose up -d
```# Run
Use spark-shell to to run the example:
```
spark-shell \
--class "EsExample" \
--master local[*] \
--packages org.elasticsearch:elasticsearch-spark_2.10:2.3.2 \
--jars target/scala-2.10/es-example_2.10-1.0.jar
```This will send a map to elasticsearch from spark.
To see the results open elasticsearch-head: http://localhost:9200/_plugin/head