0

We use a machine_code variable to help generate random numbers per hit on a server. We have always deployed manually, so this gets set by us. And as we usually only have 5-10 boxes at a time. We could literally reuse numbers as boxes got replaced.

We're not moving towards using amazon's auto scaling group, which will use an image of our server. Problem here is I can't work out how I can get a unique number for that box.

I was originally going to maybe use the instance-id from within the box, but that isnt a straight forward number.

My next thought was, on each box's init(), it would talk to it's Load Balancer, pull all boxes, and then loop through till it found it's self, then use that loop counter as its machine_code. This obviously is limited.

I'm really not 100% sure how to go about this, if anyone has any ideas? Or if my proposal of looping the current load balancer to get a number, would be ok.

I wasn't sure where else to ask this question.

datacubed
  • 189
  • 1
  • 10
  • If you think your use-case is different, let us know and we can reopen your question. – John Rotenstein Jun 18 '19 at 00:00
  • Yeah this answers it - I think. Hadn't thought of looking for the phrase "auto increment" in regards to this issue. Looks as though you propose my thought of using the current count of boxes in the LB and using that on init to get the current number and use that. – datacubed Jun 18 '19 at 08:36

0 Answers0