0

I have 8 servers running on GCP.

I want to implement auto-scaling on them. There are Nginx and PHP installed on UBUNTU server.

All I want to transfer Application logs on a particular instance before terminating the instance by auto scaling and meanwhile it should be removed by ELB.

Similar to a feature AWS life cycle Hooks.

1 Answers1

0

Autoscaling only works for Managed Instance Groups which means you have to create a template of your server and create the MIG using that template. The autoscaler will create new instances when necessary and scale down when demand is down.

If you want to keep application logs, I recommend two options:

  1. Export your application logs to Stackdriver Logging
  2. Create a shutdown script that will copy your application logs to another (preferable static) destination.
Patrick W
  • 4,603
  • 1
  • 12
  • 26
  • I am following your first suggestion to Export application logs to stackdriver logging but i found destination sink should be on cloud,(correct me if I am wrong).But i want to send application log to a perticular instance. that machine is not attach to the auto scaling – Neha Kashyap Apr 17 '18 at 07:47
  • No there is no way to create a sink to another instance. If you want to copy logs from one instance to another, you will need to use the second suggestion. – Patrick W Apr 18 '18 at 17:11