假设我们有两个具有“真实”和外部IP的服务器A和B,我们可以将所谓的
‘failover ip’(W.X.Y.Z)切换为指向A或B的特定外部IP.这可以从“外部”开始,并且很容易完成.
@H_403_1@作为背景:故障转移ip配置为/ etc / network / interfaces中的新条目:
@H_502_19@auto eth0:0 iface eth0:0 inet static address W.X.Y.Z netmask 255.255.255.224
现在让我们假设WXYZ被动态配置为使用硬件A.现在我从B调用’curl domain.com’它使用正确的故障转移ip WXYZ然后以某种方式解析为错误的外部IP B(或localhost?)而不是使用配置的一个A:
Trying W.X.Y.Z ... * connect to W.X.Y.Z port 443 Failed: Connection refused * Failed to connect to domain.com port 443: Connection refused * Closing connection 0 curl: (7) Failed to connect to domain.com port 443: Connection refused
当我启动本地Nginx时,它可以成功地卷曲domain.com
我是否需要以某种方式在本地配置DNS?如何了解有关DNS链的更多信息?
如果从服务器B尝试此操作,则使用mtr只打印domain.com
这与this question有关吗?
The failover IP is W.X.Y.Z and is also the A record of domain.com The /etc/hosts file for both nodes serverA and serverB looks like: 127.0.0.1 localhost 127.0.1.1 luminarhost xxx serverA xxx serverB The /etc/network/interfaces of serverA ### Hetzner Online AG - installimage # Loopback device: auto lo iface lo inet loopback # device: eth0 auto eth0 iface eth0 inet static address xxx broadcast xxx netmask xxx gateway xxx # default route to access subnet up route add -net xxx netmask 255.255.255.224 gw xxx eth0 iface eth0 inet6 static address xxx netmask xxx gateway xxx # failover ip auto eth0:0 iface eth0:0 inet static address W.X.Y.Z netmask 255.255.255.224 and of serverB it is: ### Hetzner Online AG - installimage # Loopback device: auto lo iface lo inet loopback # device: eth0 auto eth0 iface eth0 inet static address xxx broadcast xxx netmask xxx gateway xxx # default route to access subnet up route add -net xxx netmask 255.255.255.192 gw xxx eth0 iface eth0 inet6 static address xxx netmask xxx gateway xxx # failover ip auto eth0:0 iface eth0:0 inet static address W.X.Y.Z netmask 255.255.255.224