Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Comment start_mirror and move MirrorMaker processes to systemd units.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWall89 committed Aug 31, 2021
1 parent 694ac62 commit 5eca2b4
Showing 1 changed file with 32 additions and 29 deletions.
61 changes: 32 additions & 29 deletions dcm_rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,39 @@
signalling_metric_application = "signalling.metric.application"
signalling_kpi = "signalling.kpi"


"""
The creation of MirrorMaker processes has been moved to dedicated systemd services.
This allows to check logs more easily, setup restart on failure.
We leave this code for future reference.
"""
# Start one MirrorMaker per each site, blacklisting signalling and)
def start_mirror(site):
"""
Opens a mirrormaker with a site in order to mirror metric topics.
Signalling and KPI topics are blacklisted with regex.
"""
print("Start MirrorMaker for " + site);
subprocess.Popen(
[
"/bin/bash",
"/opt/kafka/bin/kafka-run-class.sh",
"kafka.tools.MirrorMaker",
"--consumer.config",
"/usr/bin/dcm/" + site + "_consumer.config",
"--num.streams",
"4",
"--producer.config",
"/usr/bin/dcm/producer.config",
"--whitelist",
"'^.*\.application_metric\..*$,^.*\.infrastructure_metric\..*$'",
],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
start_mirror("spanish")
start_mirror("italian")
start_mirror("french")
start_mirror("greek")

# def start_mirror(site):
# """
# Opens a mirrormaker with a site in order to mirror metric topics.
# Signalling and KPI topics are blacklisted with regex.
# """
# print("Start MirrorMaker for " + site);
# subprocess.Popen(
# [
# "/bin/bash",
# "/opt/kafka/bin/kafka-run-class.sh",
# "kafka.tools.MirrorMaker",
# "--consumer.config",
# "/usr/bin/dcm/" + site + "_consumer.config",
# "--num.streams",
# "2",
# "--producer.config",
# "/usr/bin/dcm/producer.config",
# "--whitelist",
# "'^.*\.application_metric\..*$,^.*\.infrastructure_metric\..*$'",
# ],
# stdout=subprocess.PIPE,
# stderr=subprocess.STDOUT,
# )
# start_mirror("spanish")
# start_mirror("italian")
# start_mirror("french")
# start_mirror("greek")

@app.route('/', methods=['GET'])
def server_status():
Expand Down

0 comments on commit 5eca2b4

Please sign in to comment.