目录
problems_microservice
1 skywalking的gateway插件版本不对不兼容
SOLUTION:
# 查看gateway的版本
ll skywalking/agent/plugins/apm-spring-cloud-gateway*
# result: -rw-rw-r-- 1 witt witt 43569 12月 9 17:12 skywalking/agent/plugins/apm-spring-cloud-gateway-2.1.x-plugin-8.5.0.jar
# 删除gateway2.1.x
rm -f skywalking/agent/plugins/apm-spring-cloud-gateway-2.1.x-plugin-8.5.0.jar
# 替换为gateway2.0.x
cp skywalking/agent/optional-plugins/apm-spring-cloud-gateway-2.0.x-plugin-8.5.0.jar skywalking/agent/plugins/
2 springboot微服务启动报错,无法连接到nacos
ERROR:
ERROR [com.alibaba.nacos.client.config.security.updater] com.alibaba.nacos.client.security.SecurityProxy [SecurityProxy] login http request failed url: http://nacos.k8sdev.ciicsh.com:80/nacos/v1/auth/users/login, params: {username=java}, bodyMap: {password=java}, errorMsg: errCode: 100, errMsg: Nacos serialize for class [com.alibaba.nacos.common.http.HttpRestResult] failed.
com.alibaba.nacos.client.config.impl.ClientWorker [fixed-nacos.k8sdev.ciicsh.com_80-java_demo] [sub-server-error] no right, dataId=gateway, group=DEFAULT_GROUP, tenant=java_demo
There was an unexpected error (type=Forbidden, status=403).unknown user!
一开始查网上资料,以为是nacos的需要配置用户名密码,还有context-path,yml文件中配置如下,然并卵:
spring:
cloud:
nacos:
config:
name: gateway
namespace: ******
# 此处必须要加端口号,否则会使用默认端口号8848
server-addr: nacos-dev.com:8848
file-extension: yaml
username: java
password: java
context-path: /nacos # 可不设置,默认就是这个值
RCA:是server-addr配置错误了,nacos-dev需要修改为nacos-test。修改为如下配置:
server-addr: nacos-test.com:8848
3 springboot启动时无法加载skywalking插件
RCA:skywalking相关的启动参数配置到了 Program arguments中,如下图所示:
应该配置在 VM options中,如下图所示: