OPENWRT本地局域网模拟域名多IP

本地配置MINIO服务时,会遇到域名多IP的需求。当某一个节点失效时,可以通过域名访问平滑过渡到其它的节点继续服务。

【MINIO搭建过程略】

搭建完毕后,有4个节点,对应的docker搭建命令:

docker run --net=host --restart=always -p 9000:9000 --name minio -v /data/minio:/data -v /opt/docker-data/minio/config:/root/.minio -e "MINIO_ACCESS_KEY=admin" -e "MINIO_SECRET_KEY=admin123" minio/minio server http://192.168.1.201/data http://192.168.1.202/data http://192.168.1.206/data http://192.168.1.207/data

这样将201,202,206,207 4台机器联合为一个MINIO集群。此时希望使用file.localhost.com来自动访问集群,当某个节点失效时,能够平滑的过渡到其它的节点。

本地路由网关是openwrt使用了dnsmasq,这样方案就简单,按照下面步骤配置一下:

vi /etc/dnsmasq.conf

添加以下命令:

复制代码
address=/file.localhost.com/192.168.1.201
address=/file.localhost.com/192.168.1.202
address=/file.localhost.com/192.168.1.206
address=/file.localhost.com/192.168.1.207

然后重启:

/etc/init.d/dnsmasq restart

这样就可以了,试以下,把201节点先停了。ping以下域名

然后把201节点启动起来,1分钟后再ping一下

这样就实现了通过域名访问的高可用MINIO服务

如果是公网,则方法更简单,直接将域名绑定多IP即可

相关推荐
IUGEI1 小时前
【计算机网络】HTTP/3如何实现可靠传输?
java·网络·后端·网络协议·tcp/ip·计算机网络·http
代码不停4 小时前
网络编程 UDP 和 TCP
网络·tcp/ip·udp
tan180°5 小时前
Linux网络IP(下)(16)
linux·网络·后端·tcp/ip
澄岚明雪6 小时前
八股复习之计算机网络1
网络协议·tcp/ip·计算机网络·http·https·信息与通信
abcefg_h6 小时前
TCP与UDP的区别
网络·tcp/ip·udp
q***38518 小时前
IP地址、子网掩码(NETMASK)和网关(Gateway)
tcp/ip·gateway·智能路由器
tan180°19 小时前
Linux网络IP(上)(15)
linux·网络·tcp/ip
云和数据.ChenGuang20 小时前
运维工程师技术教程之nginx ip访问机制
运维·tcp/ip·nginx
_星辰大海乀21 小时前
TCP 协议
网络·网络协议·tcp/ip·tcp
翼龙云_cloud21 小时前
亚马逊云渠道商:aws安全组没有加ip用ip访问会有什么问题?
运维·tcp/ip·安全·云计算·aws