原因:
网关的持久化配置的策略类型填写错误:
以下配置只是用于微服务的策略
rule-type查看org.springframework.cloud.alibaba.sentinel.datasource.RuleType
我们需要将rule-type改为gw-flow
dataid也需要改成-gateway-flow后缀
api组策略也一样
datasource:
gw-flow-fules:
nacos:
server-addr: 10.114.102.164:8848
dataId: ${spring.application.name}-gateway-flow
groupId: SENTINEL_GROUP # 注意groupId对应Sentinel Dashboard中的定义
data-type: json
rule-type: gw-flow
gw-api-group-fules:
nacos:
server-addr: 10.114.102.164:8848
dataId: ${spring.application.name}-gateway-api
groupId: SENTINEL_GROUP # 注意groupId对应Sentinel Dashboard中的定义
data-type: json
rule-type: gw-api-group