From 02a9347a35f4d8b20d1547e5a12dd5d22d94ff18 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Mon, 24 Jul 2023 21:25:58 -0400 Subject: [PATCH] restart cassandra in cloud-init startup and wait 60 secs for it to come up --- cloudformation/jambonz-mini.yaml | 5 +++++ cloudformation/jambonz-scalable-production.yaml | 2 +- terraform/proxmox/files/cloud-init.cloud_config.tftpl | 5 +++++ terraform/proxmox/main.tf | 4 ++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cloudformation/jambonz-mini.yaml b/cloudformation/jambonz-mini.yaml index 5ddc8de..1721c87 100644 --- a/cloudformation/jambonz-mini.yaml +++ b/cloudformation/jambonz-mini.yaml @@ -281,6 +281,11 @@ Resources: sudo -u admin bash -c "pm2 save" sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u admin --hp /home/admin + sudo systemctl restart cassandra.service + echo "waiting 60 secs for cassandra to start.." + sleep 60 + echo "now start jaeger" + # restart jaeger sudo systemctl restart jaeger-collector.service sudo systemctl restart jaeger-query.service diff --git a/cloudformation/jambonz-scalable-production.yaml b/cloudformation/jambonz-scalable-production.yaml index a6d5aa7..cad6f50 100644 --- a/cloudformation/jambonz-scalable-production.yaml +++ b/cloudformation/jambonz-scalable-production.yaml @@ -812,7 +812,7 @@ Resources: # restart heplify-server sudo systemctl restart heplify-server.service sudo systemctl restart cassandra.service - sleep 15 + sleep 60 sudo systemctl restart jaeger-collector.service sudo systemctl restart jaeger-query.service Tags: diff --git a/terraform/proxmox/files/cloud-init.cloud_config.tftpl b/terraform/proxmox/files/cloud-init.cloud_config.tftpl index 19f09b8..98a2fb7 100644 --- a/terraform/proxmox/files/cloud-init.cloud_config.tftpl +++ b/terraform/proxmox/files/cloud-init.cloud_config.tftpl @@ -98,6 +98,11 @@ write_files: sudo -u admin bash -c "pm2 save" sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u admin --hp /home/admin + sudo systemctl restart cassandra.service + echo "waiting 60 secs for cassandra to start.." + sleep 60 + echo "now start jaeger" + # restart jaeger sudo systemctl restart jaeger-collector.service sudo systemctl restart jaeger-query.service diff --git a/terraform/proxmox/main.tf b/terraform/proxmox/main.tf index 4c61aec..ae67787 100644 --- a/terraform/proxmox/main.tf +++ b/terraform/proxmox/main.tf @@ -120,13 +120,13 @@ resource "null_resource" "cloud_init_config_files" { } } -resource "proxmox_vm_qemu" "jambonz-mini-v084-2" { +resource "proxmox_vm_qemu" "jambonz-mini-v084-3" { depends_on = [ null_resource.cloud_init_config_files, ] count = var.vm_count - name = "jambonz-mini-v084-2" + name = "jambonz-mini-v084-3" target_node = var.pm_target_node clone = var.pm_source_template full_clone = true