IPV6改造技术——微服务

1.Nacos

涉及版本:1.2.1、2.1.2、2.0.x、1.3.x、1.4.1/1.4.3

1.2.1,1.3.x不支持ipv6服务注册功能
1.4.1版本后增加支持ipv6的服务注册功能,集群需执行1.4.0-ipv6_support-update.sql文件到数据库,将相关ipv4地址改为ipv6地址,如将集群各节点改为ipv6地址
修改cluster.conf

[fd15:4ba5:5a2b:1008:7639:4521:2bed:ab31]:8848
[fd15:4ba5:5a2b:1008:7dc6:1ba:c130:8a02]:8848
[fd15:4ba5:5a2b:1008:7245:ba98:3210:4562]:8848

参考https://zhuanlan.zhihu.com/p/412899266

2.Consul

涉及版本:1.4.2、1.5.2、1.8.1

默认支持ipv6,将ipv4地址改为ipv6地址
修改启动命令(集群中各节点都修改)
./consul agent -server -bootstrap-expect 1 -data-dir=“./” -node=consulServer1 -bind=fd15:4ba5:5a2b:1008:7639:4521:2bed:ab31 -ui -rejoin -client=fd15:4ba5:5a2b:1008:7639:4521:2bed:ab31
或修改config.json中配置bind_addr
如:

{
bind_addr:”[fd15:4ba5:5a2b:1008:7639:4521:2bed:ab31]”,
}

bind_addr指定“[::]”,Consul将通告第一个可用的公共IPv6地址。
3.Apollo
修改配置文件application.properties中注册中心IPv6地址

dubbo.registry.id = dubboRegistry
dubbo.registry.timeout=5000
dubbo.registry.address = ipv6:8848
dubbo.registry.protocol=nacos
#dubbo.registry.address = ipv6:2181
#dubbo.registry.client = curator
#dubbo.registry.protocol=zookeeper

3.4.5.SpringCloud gateway
默认支持ipv6
具有ipv6的环境,配置文件相关ipv4地址改为ipv6地址如:

spring:
   cloud:
     gateway:
       routes:
         - id: query_route
           uri: https://www.baidu.com/
           predicates:
             - RemoteAddr=3ffe:ffff:7654:feda:1245:ba98:3210:4562/48

地址是cidr符号(IPv4或IPv6 )字符串
3.4.6.zuul
默认支持ipv6
具有ipv6的环境,相关ipv4地址改为ipv6地址

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

jsrdweiting

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值