heplify-server icon indicating copy to clipboard operation
heplify-server copied to clipboard

Better way to map PROMTARGETIP to PROMTARGETNAME/Service discovery?

Open PNRxA opened this issue 6 years ago • 12 comments

Currently I run heplify-server in a docker container.

My config has the following flags set up with 40+ VoIP servers for example:

- "HEPLIFYSERVER_PROMTARGETIP=1.1.1.1,1.1.1.2,1.1.1.3,1.1.1.4,..."
- "HEPLIFYSERVER_PROMTARGETNAME=name1,name2,name3,name4,..."

We launch new VoIP servers often so every night using a cron job I run a script which updates those flags in my docker-compose file with the latest IPs and Names pulled from AWS CLI and then runs docker-compose up -d to update heplify-server with the new values.

There is no problem here as it all works fine but is this the best way to accomplish this? Is there a better way of mapping IP addresses to names dynamically or is this typically done manually?

PNRxA avatar Jun 26 '19 23:06 PNRxA

Hi, yes a better way would be to create a new flag like PromTargetMap and use a map like notation { name1=1.1.1.1, name2=1.1.1.2}

negbie avatar Jun 27 '19 04:06 negbie

About the dynamically mapping I guess I would do something like this: Use dns names instead of IP's and create a go routine in heplify-server whichs does the ip resolution every x hours and puts them into the PromTargetMap.

negbie avatar Jun 27 '19 06:06 negbie

@negbie if this is the approach, consider letting the DNS server(s) configurable so one can avoid resolving unwanted items and/or setup a dedicated DNS server for this purpose, vs. the OS DNS which might end up resolving more spammers than others.

lmangani avatar Jun 27 '19 06:06 lmangani

Good point, I will keep it in mind. I was just thinking out loud about a possible solution to this. There are more elegant ways especially when you use aws or gcp but they are more complex. I will see when I find more time to look for other possible solutions to this.

negbie avatar Jun 28 '19 05:06 negbie

I guess a simple table in the db, or an optional sqlite file would also do, if we're trying to stay simple - we can brainstorm on slack if you'd like ;)

lmangani avatar Jun 28 '19 07:06 lmangani

Currently I run heplify-server in a docker container.

My config has the following flags set up with 40+ VoIP servers for example:

- "HEPLIFYSERVER_PROMTARGETIP=1.1.1.1,1.1.1.2,1.1.1.3,1.1.1.4,..."
- "HEPLIFYSERVER_PROMTARGETNAME=name1,name2,name3,name4,..."

We launch new VoIP servers often so every night using a cron job I run a script which updates those flags in my docker-compose file with the latest IPs and Names pulled from AWS CLI and then runs docker-compose up -d to update heplify-server with the new values.

There is no problem here as it all works fine but is this the best way to accomplish this? Is there a better way of mapping IP addresses to names dynamically or is this typically done manually?

40+ VoIP servers?

changzx avatar Nov 01 '19 03:11 changzx

40+ VoIP servers?

Yes, over 40 VoIP servers hosted on AWS EC2

PNRxA avatar Nov 01 '19 03:11 PNRxA

40+ VoIP servers?

Yes, over 40 VoIP servers hosted on AWS EC2

Concurrent? Can you send me your email?

changzx avatar Nov 01 '19 06:11 changzx

@changzx @PNRxA right now advanced and realtime tagging options are only available in hepic but a new version of homer is in the works where we could perhaps address this more elegantly.

lmangani avatar Nov 01 '19 13:11 lmangani

@lmangani that sounds great, looking forward to it. Are you referring to Homer 7.x or a newer version?

PNRxA avatar Nov 04 '19 01:11 PNRxA

@changzx @PNRxA right now advanced and realtime tagging options are only available in hepic but a new version of homer is in the works where we could perhaps address this more elegantly.

that sounds great!

changzx avatar Nov 04 '19 02:11 changzx

I want to konw does this sovled this issue? if yes, where is the latest config map, or db

Zhenyuga avatar Dec 09 '21 14:12 Zhenyuga