shenyu
springcloud使用
初期准备
https://github.com/apache/incubator-shenyu/releases 下载2.4.0
maven install:
cd incubator-shenyu
mvn clean install -Dmaven.javadoc.skip=true -B -Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests
版本:
使用shenyu2.4.0版本 https://shenyu.apache.org/zh/docs/2.4.0
nacos2.0.1版本
admin配置
shenyu-admin管理界面项目
1.执行sql 注意sql必须按版本严格执行 不同版本的sql会出现变化 比如context_path变contextPath
incubator-shenyu-2.4.0\shenyu-admin\src\main\resources\META-INF\schema.sql
2.修改incubator-shenyu-2.4.0\shenyu-admin\src\main\resources\application.yml
spring:
profiles:
active: mysql # h2
datasource:
url: jdbc:mysql://localhost:3306/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root
password: root
driver-class-name: com.mysql.jdbc.Driver
3.升级lombok插件支持@SuperBuilder
4.支持服务端nacos同步选择器和规则
pom:
<dependency>
<groupId>org.apache.shenyu</groupId>
<artifactId>shenyu-register-server-nacos</artifactId> # nacos-client用的2.0.0版本
<version>${project.version}</version>
</dependency>
yml配置文件:
shenyu:
register:
registerType: nacos # 使用nacos获取客户端注册的信息即uri和元数据 http #http #zookeeper #etcd #nacos #consul
serverLists: 127.0.0.1:8848 #localhost:2181 #ht