Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Implementing Geo-based Server Load Balancing
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Implementing Geo-based Server Load Balancing

I have a server in Turkey with cPanel installed, and everything is working fine. Now, I want to purchase another server, for example, from Google. If someone makes a request to any website I host, I want it to load directly from the server if the request is from Turkey. If the request is from anywhere else in the world, I want the site to load from Google's servers. Can anyone help me with how to implement this?

Comments

  • You would probably be best off getting some Geo DNS service. While implementing it yourself is possible it'll be somewhat tricky and if you have to ask it will probably be a bit of a steep learning curve.

  • @totally_not_banned said:
    You would probably be best off getting some Geo DNS service. While implementing it yourself is possible it'll be somewhat tricky and if you have to ask it will probably be a bit of a steep learning curve.

    Thanks for your response. Yeah, I've just started. Do you have any tutorials or guidance to send me, or any tools you recommend using?

  • Here's an easy way. Setup Google server with cPanel, install jetbackup on both servers, use "clone" feature to send copy of turk server to goog server however often you want it synced... Now you can use any load balancer service.

    Thanked by 1meditatingsurgeon
  • @thane said:
    Here's an easy way. Setup Google server with cPanel, install jetbackup on both servers, use "clone" feature to send copy of turk server to goog server however often you want it synced... Now you can use any load balancer service.

    "Thanks for your response, but I didn't quite understand how, in this setup, Turkish requests go to the Turkish server, and the rest go to Google. I'm concerned I might face issues with this approach. However, it seems like a cool solution. Thanks."

  • thanethane Member
    edited December 2023

    The part about turk traffic to turk server and the rest to Google will depend on your load balancer provider. Cloudflare has good load balancer feature, has routing feature built in that you can specify geo.

  • @transferaimom said:

    @thane said:
    Here's an easy way. Setup Google server with cPanel, install jetbackup on both servers, use "clone" feature to send copy of turk server to goog server however often you want it synced... Now you can use any load balancer service.

    "Thanks for your response, but I didn't quite understand how, in this setup, Turkish requests go to the Turkish server, and the rest go to Google. I'm concerned I might face issues with this approach. However, it seems like a cool solution. Thanks."

    He is pretty much right. You'll need to sync both servers. Everything else is managed externally. I can't recommend you a specific service but if you google "Geo DNS" you'll find a bunch. Those will manage your domain(s) and resolve them to the IP of the matching server when someone visits your site.

  • why not own ASN and do anycast?

  • @1q1 said:
    why not own ASN and do anycast?

    Could you please provide more explanation? I didn't understand

  • @transferaimom said:

    @1q1 said:
    why not own ASN and do anycast?

    Could you please provide more explanation? I didn't understand

    https://en.wikipedia.org/wiki/Anycast

  • @1q1 said:

    @transferaimom said:

    @1q1 said:
    why not own ASN and do anycast?

    Could you please provide more explanation? I didn't understand

    https://en.wikipedia.org/wiki/Anycast

    That will be awfully helpful to someone describing themselves as a beginner.

    Thanked by 2BasToTheMax ariq01
  • @totally_not_banned said: That will be awfully helpful to someone describing themselves as a beginner.

    how to gauge the knowledge ?
    it's just more energy efficient to wait for his further response and respond accordingly

  • edited December 2023

    @1q1 said:

    @totally_not_banned said: That will be awfully helpful to someone describing themselves as a beginner.

    how to gauge the knowledge ?
    it's just more energy efficient to wait for his further response and respond accordingly


    @transferaimom said:
    Yeah, I've just started. Do you have any tutorials or guidance to send me, or any tools you recommend using?

    Does not exactly sound like a person who will know what an ASN is or manage to setup anycast. It's obviously still a better solution though. Just currently outside of OPs options i fear.

    Thanked by 11q1
  • Just DM me, I can help for free. I've got at least three plans in my mind.

  • I think this aligns with the idea of GSLB. I did implement one in the past using PowerDNS and DB replication for accomplishing geo-based hidden-master DNS architecture. https://tchv.fr/pdns-gslb/ might be a very good starting point for your requirements.

  • @1q1 said: why not own ASN and do anycast?

    It costs at least 100/m for IPv4.

    CoreDNS has amazing plugins for geodns.

  • @kait said: CoreDNS has amazing plugins for geodns.

    does it work when visitors use non ISP provided nameservers such as cloudflare's 1.1.1.1?

  • kaitkait Member
    edited December 2023

    @1q1 said: does it work when visitors use non ISP provided nameservers such as cloudflare's 1.1.1.1?

    Yes, sinds if you use 1.1.1.1 your NS will see a different IP (owned by cloudflare and with the correct geoloc)

  • @kait said: correct geoloc

    nice.

  • @1q1 said: nice.

    Quad9 and everyone else does it the same way, so that geoloc works alright, while cloudflare's IP's are geoloced in London and I (my vpn) is located in the Netherlands, so its not perfect, but it works good enough.

  • Cloudflare does exactly that and it's free.
    Just set the Cloudflare cache settings well, don't try to connect to your servers unnecessarily, then visitors can connect to your website in 20-30 pings from almost anywhere in the world.

  • If my understanding is correct, you need a DNS hosting provider that supports assigning specific IP addresses by region, such as Huawei Cloud :o

Sign In or Register to comment.