ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Linux Project

    IT Discussion
    5
    36
    5.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller @A Former User
      last edited by

      @Aaron-Studer said:

      How do I setup cloudflare to point to 2 ip addresses?

      Stop. Everything is wrong here. What do you picture you are going to do with two IP addresses here?!?

      1 Reply Last reply Reply Quote 2
      • scottalanmillerS
        scottalanmiller
        last edited by

        And what do you imagine YOUR DNS servers are going to do?

        1 Reply Last reply Reply Quote 1
        • ?
          A Former User
          last edited by

          So I am going to have 2 IP addresses - one Public IP address from C@C and One Public IP from my home internet. How do I setup my domain in such a way that it trys C@C first, and if that does loads, loads my home server?

          scottalanmillerS 1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller @A Former User
            last edited by

            @Aaron-Studer said:

            So I am going to have 2 IP addresses - one Public IP address from C@C and One Public IP from my home internet. How do I setup my domain in such a way that it trys C@C first, and if that does loads, loads my home server?

            DNS does not do that. To do what you are picturing you need a load balancer like an F5 or HAProxy. DNS doesn't do this, ever. You are using the wrong tools and the wrong approach. If you want failover for webservers, you are getting into a whole new level of complexity. A huge one. Even after we fix this layer, you have to fix things like database sync when the system fails back and forth!!

            What you want is CloudFlare, don't even think of ever running your own DNS servers. No one should ever do this. Not in the SMB, not the Fortune 101, no one. DNS points to your main IP. If your site fails, manually switch the IP to your backup. That's about the best you are going to get.

            ? 1 Reply Last reply Reply Quote 1
            • scottalanmillerS
              scottalanmiller
              last edited by

              If you wanted failover, you would buy a bunch of VMs at AWS or Rackspace. Then buy a load balancer. Have the load balancer detect if one of the VMs fails. Then it would point to the other one. I manage load balancers at Rackspace for this all of the time.

              1 Reply Last reply Reply Quote 0
              • ?
                A Former User @scottalanmiller
                last edited by A Former User

                @scottalanmiller said:

                @Aaron-Studer said:

                So I am going to have 2 IP addresses - one Public IP address from C@C and One Public IP from my home internet. How do I setup my domain in such a way that it trys C@C first, and if that does loads, loads my home server?

                DNS does not do that. To do what you are picturing you need a load balancer like an F5 or HAProxy. DNS doesn't do this, ever. You are using the wrong tools and the wrong approach. If you want failover for webservers, you are getting into a whole new level of complexity. A huge one. Even after we fix this layer, you have to fix things like database sync when the system fails back and forth!!

                What you want is CloudFlare, don't even think of ever running your own DNS servers. No one should ever do this. Not in the SMB, not the Fortune 101, no one. DNS points to your main IP. If your site fails, manually switch the IP to your backup. That's about the best you are going to get.

                I see. Updates to IP addresses in CloudFlare are very fast, so changing the IP should work, with minimal downtime. At lease I would have options, and not be completely screwed.

                scottalanmillerS 1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller @A Former User
                  last edited by

                  @Aaron-Studer said:

                  I see. Updates to IP addresses in CloudFlare are very fast, so changing the IP should work, with minimal downtime. At lease I would have options, and not be completely screwed.

                  Yes, that's really best. Multi-site failover is a tough thing. You could, in theory, build a system that automatically updated DNS when a failure was detected, but the problems that this would cause are immense, there is a reason that no one does this.

                  1 Reply Last reply Reply Quote 0
                  • ?
                    A Former User
                    last edited by

                    @scottalanmiller This is what I was thinking of I think

                    http://www.gearbytes.com/2010/11/configuring-dns-round-robin-in-windows-dns-for-load-balancing/

                    scottalanmillerS ? 2 Replies Last reply Reply Quote 0
                    • ?
                      A Former User
                      last edited by

                      With Active-Passive I've only done it manually. for Automated you'd usually have Active/Active with loads of nodes both for failover and load-balancing. Unless it's a e-commerce or other money generating site it's not worth it.

                      1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User
                        last edited by

                        P.S. Now I feel stupid.

                        1 Reply Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller @A Former User
                          last edited by

                          @Aaron-Studer said:

                          @scottalanmiller This is what I was thinking of I think

                          http://www.gearbytes.com/2010/11/configuring-dns-round-robin-in-windows-dns-for-load-balancing/

                          Sure, you can do round robin with "any" DNS system. But that would just hose your site as you'd have competing database masters. You'd need a multi-master setup to make that work and it would not help with outages, it would keep sending half of your traffic to the failed site even after it had failed.

                          1 Reply Last reply Reply Quote 0
                          • ?
                            A Former User @A Former User
                            last edited by

                            @Aaron-Studer said:

                            @scottalanmiller This is what I was thinking of I think

                            http://www.gearbytes.com/2010/11/configuring-dns-round-robin-in-windows-dns-for-load-balancing/

                            There are DNS services that will do round robin and detect when a host is down and remove it. The problem is the TTL of the entries isn't always honored. and before that you have no way of making sure traffic goes to your primary host (nslookup doesn't care about the order you put them in on the records)

                            1 Reply Last reply Reply Quote 2
                            • StrongBadS
                              StrongBad
                              last edited by

                              I think that you are over thinking this. Keep things pretty simple. Having two servers and manually failing over from your DNS provider is still far more failover than most sites have.

                              1 Reply Last reply Reply Quote 1
                              • thanksajdotcomT
                                thanksajdotcom
                                last edited by

                                @Aaron-Studer, I've been wanting to do this as well. However, I've moved off AWS so I don't think I'll need to anymore...

                                1 Reply Last reply Reply Quote 0
                                • thanksajdotcomT
                                  thanksajdotcom
                                  last edited by

                                  But Rsync for the Wordpress files and auto-exports and imports of the MySQL databases.

                                  1 Reply Last reply Reply Quote 0
                                  • thanksajdotcomT
                                    thanksajdotcom
                                    last edited by

                                    I have keys setup between my servers so I can ssh without a password, so if you get that setup, these are my scripts...

                                    On the cloud server:
                                    #!/bin/sh

                                    cd /var/www/databases

                                    mysqldump -u root --password=mypasswordthanksaj > thanksaj.sql
                                    mysqldump -u root --password=mypassword literaryworksbyaj > literaryworksbyaj.sql
                                    mysqldump -u root --password=mypassword builtbyart > builtbyart.sql

                                    rsync -chavzP --stats /var/www/* [email protected]:/var/www/

                                    **On the local server: **
                                    #!/bin/sh

                                    cd /var/www/databases/

                                    mysql -u root --password=mypassword thanksaj < thanksaj.sql
                                    mysql -u root --password=mypassword literaryworksbyaj < literaryworksbyaj.sql
                                    mysql -u root --password=mypassword builtbyart < builtbyart.sql

                                    So I export the MySQL databases to /var/www/databases as .sql files and then rsync them to the local server. The local server imports said files into its local databases. I use cron to schedule all this.

                                    Local server:
                                    0 6,18 * * * /home/aj/scripts/aj-import-wordpress-dbs >> /srv/samba/share/import_wordpress_dbs.log 2>&1

                                    Cloud server:
                                    0 5,17 * * * /home/user/scripts/aj-sync-wordpress >> /var/log/aj-logs/sync_wordpress.log 2>&1

                                    Then I use Unitrends to backup the local server. 🙂

                                    We'll see how this works!

                                    Thanks,
                                    A.J.

                                    1 Reply Last reply Reply Quote 0
                                    • 1
                                    • 2
                                    • 2 / 2
                                    • First post
                                      Last post