Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigData-radio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ANDRE Quentin
BigData-radio
Commits
ac5fc561
Commit
ac5fc561
authored
2 years ago
by
Quentin ANDRE
Browse files
Options
Downloads
Patches
Plain Diff
multiple ports
parent
7c86926e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
planes_consumer.py
+1
-1
1 addition, 1 deletion
planes_consumer.py
spark_launch.sh
+2
-0
2 additions, 0 deletions
spark_launch.sh
spark_streaming.py
+1
-1
1 addition, 1 deletion
spark_streaming.py
useful-sh.sh
+1
-1
1 addition, 1 deletion
useful-sh.sh
with
5 additions
and
3 deletions
planes_consumer.py
+
1
−
1
View file @
ac5fc561
...
...
@@ -2,7 +2,7 @@ import json
from
kafka
import
KafkaConsumer
planes
=
{}
consumer
=
KafkaConsumer
(
"
air-traffic
"
,
bootstrap_servers
=
'
pi-node07:9092
'
,
group_id
=
"
air-traffic-monitor
"
)
consumer
=
KafkaConsumer
(
"
air-traffic
"
,
bootstrap_servers
=
'
pi-node07:9092
, pi-node07:9093
'
,
group_id
=
"
air-traffic-monitor
"
)
for
message
in
consumer
:
print
(
message
)
...
...
This diff is collapsed.
Click to expand it.
spark_launch.sh
+
2
−
0
View file @
ac5fc561
...
...
@@ -4,6 +4,8 @@ ssh pi@10.29.227.239
# launch
start-dfs.sh
$SPARK_HOME
/sbin/start-all.sh
# launch spark_streaming in node 29
spark-submit SparkStreamingRadio/spark_streaming_radio.py
# stop
$SPARK_HOME
/sbin/stop-all.sh
...
...
This diff is collapsed.
Click to expand it.
spark_streaming.py
+
1
−
1
View file @
ac5fc561
...
...
@@ -18,7 +18,7 @@ def find_country(lat, long):
spark
=
SparkSession
.
builder
.
appName
(
"
Spark Structured Streaming from Kafka
"
).
getOrCreate
()
sdfPlanes
=
spark
.
readStream
.
format
(
"
kafka
"
)
\
.
option
(
"
kafka.bootstrap.servers
"
,
"
localhost
:9092
"
)
\
.
option
(
"
kafka.bootstrap.servers
"
,
"
pi-node07
:9092
"
)
\
.
option
(
"
subscribe
"
,
"
air-traffic
"
)
\
.
option
(
"
startingOffsets
"
,
"
latest
"
)
\
.
load
().
selectExpr
(
"
CAST(value AS STRING)
"
)
...
...
This diff is collapsed.
Click to expand it.
useful-sh.sh
+
1
−
1
View file @
ac5fc561
...
...
@@ -20,4 +20,4 @@ nc pi-node07 9092
ssh pi@10.29.227.218
python3 bigdata-radio/planes_producer.py
# consumer in node8
python3 bigdata-radio/planes_consumer.py
\ No newline at end of file
python3 bigdata-radio/planes_consumer.py
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment