Skip to content

Commit

Permalink
Fix: prometheus and node_exporter installation
Browse files Browse the repository at this point in the history
Also add bidirectional <> communications form qed to prometheus
  • Loading branch information
suizman authored and iknite committed Feb 19, 2019
1 parent 9393af9 commit 6a44ce7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deploy/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ module "prometheus" {
- job_name: 'Qed0-HostMetrics'
scrape_interval: 10s
static_configs:
- targets: ['${module.leader.private_ip}:9100', ]
- targets: ['${module.leader.private_ip}:9100']
- job_name: 'Qed0-QedMetrics'
scrape_interval: 10s
static_configs:
Expand Down
9 changes: 3 additions & 6 deletions deploy/aws/modules/prometheus/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,12 @@ resource "aws_instance" "prometheus" {
sudo yum install -y https://dl.grafana.com/oss/release/grafana-5.4.2-1.x86_64.rpm
sudo service grafana-server start
while [ ! -f ${var.path}/prometheus ]; do
sleep 1 # INFO: wait until binary exists
while [ `lsof ${var.path}/prometheus | wc -l` -gt 0 ]; do
sleep 1 # INFO: prevents Error of `text file busy`
done
sleep 1
chmod +x ${var.path}/prometheus
nohup ${var.path}/prometheus --config.file=${var.path}/prometheus.yml &
${var.path}/prometheus --config.file=${var.path}/prometheus.yml
DATA
}
4 changes: 4 additions & 0 deletions deploy/aws/modules/qed/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ resource "aws_instance" "qed-server" {
done
chmod +x ${var.path}/qed
chmod +x ${var.path}/node_exporter
${var.path}/node_exporter &
${var.path}/qed ${var.command}
DATA
}
9 changes: 8 additions & 1 deletion deploy/aws/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,16 @@ module "security_group" {
to_port = 65535
protocol = "tcp"
source_security_group_id = "${module.security_group.this_security_group_id}"
},
{
from_port = 0
to_port = 65535
protocol = "tcp"
source_security_group_id = "${module.prometheus_security_group.this_security_group_id}"
}
]
number_of_computed_ingress_with_source_security_group_id = 1

number_of_computed_ingress_with_source_security_group_id = 2

}

Expand Down
2 changes: 1 addition & 1 deletion deploy/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ variable "aws_profile" {

variable "keypath" {
default = "~/.ssh/id_rsa_free"
}
}

0 comments on commit 6a44ce7

Please sign in to comment.