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即可

相关推荐
ITxiaobing202321 小时前
IP 库与 AppsFlyer 国家/地区数据不一致时的对账方法
tcp/ip
TechWayfarer1 天前
IP地址查询之后:如何在请求抵达前识别风险
python·tcp/ip·网络安全
2401_873479402 天前
IP属地为什么有时显示外省?用IP查询工具核查动态分配、运营商出口与GeoIP库
python·tcp/ip·ip
可爱系程序猿2 天前
WSD 打印机时好时坏:从发现服务、地址变化到 Standard TCP/IP 端口的迁移记录
网络·网络协议·tcp/ip·程序人生·电脑
JIngles1232 天前
用 Dart 通过 S3 API 操作 MinIO:文件上传与下载 Demo
中间件·minio·存储
Cx330❀2 天前
【Linux网络】网络层 IP 协议:从网段划分到内核源码解析
大数据·linux·服务器·网络·tcp/ip·性能优化·langchain
javaDocker2 天前
生产事件BUG跟进-【curl 卡在 Client Hello 问题复盘】
tcp/ip·生产事件
myy-learn2 天前
33-HTTP协议TCP网页设计相关知识
tcp/ip·http
java_nnnn2 天前
面试题(网络部分前传)-13问
服务器·网络·网络协议·tcp/ip·面试
上海云盾-小余2 天前
业务被 DDoS 打崩?四层、七层攻击特征与防护方案复盘
网络·网络协议·tcp/ip·ddos