commit
7c90239ef3
@ -1,31 +1,32 @@ |
|||||||
* [首页](/?t=1562744547267) |
* [首页](/?t=1563439736156) |
||||||
* 开发文档 |
* 开发文档 |
||||||
* [快速体验](files/10010_快速体验.md?t=1562744547269) |
* [快速体验](files/10010_快速体验.md?t=1563439736157) |
||||||
* [项目接入到SOP](files/10011_项目接入到SOP.md?t=1562744547286) |
* [项目接入到SOP](files/10011_项目接入到SOP.md?t=1563439736174) |
||||||
* [新增接口](files/10020_新增接口.md?t=1562744547286) |
* [新增接口](files/10020_新增接口.md?t=1563439736174) |
||||||
* [业务参数校验](files/10030_业务参数校验.md?t=1562744547287) |
* [业务参数校验](files/10030_业务参数校验.md?t=1563439736174) |
||||||
* [错误处理](files/10040_错误处理.md?t=1562744547287) |
* [错误处理](files/10040_错误处理.md?t=1563439736174) |
||||||
* [编写文档](files/10041_编写文档.md?t=1562744547287) |
* [编写文档](files/10041_编写文档.md?t=1563439736174) |
||||||
* [接口交互详解](files/10050_接口交互详解.md?t=1562744547287) |
* [接口交互详解](files/10050_接口交互详解.md?t=1563439736174) |
||||||
* [easyopen支持](files/10070_easyopen支持.md?t=1562744547287) |
* [easyopen支持](files/10070_easyopen支持.md?t=1563439736175) |
||||||
* [使用签名校验工具](files/10080_使用签名校验工具.md?t=1562744547287) |
* [使用签名校验工具](files/10080_使用签名校验工具.md?t=1563439736175) |
||||||
* [ISV管理](files/10085_ISV管理.md?t=1562744547287) |
* [ISV管理](files/10085_ISV管理.md?t=1563439736175) |
||||||
* [自定义路由](files/10086_自定义路由.md?t=1562744547287) |
* [自定义路由](files/10086_自定义路由.md?t=1563439736175) |
||||||
* [路由授权](files/10090_路由授权.md?t=1562744547287) |
* [路由授权](files/10090_路由授权.md?t=1563439736175) |
||||||
* [接口限流](files/10092_接口限流.md?t=1562744547288) |
* [接口限流](files/10092_接口限流.md?t=1563439736175) |
||||||
* [监控日志](files/10093_监控日志.md?t=1562744547288) |
* [监控日志](files/10093_监控日志.md?t=1563439736175) |
||||||
* [SDK开发](files/10095_SDK开发.md?t=1562744547288) |
* [SDK开发](files/10095_SDK开发.md?t=1563439736175) |
||||||
* [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1562744547288) |
* [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1563439736176) |
||||||
* [应用授权](files/10097_应用授权.md?t=1562744547288) |
* [应用授权](files/10097_应用授权.md?t=1563439736176) |
||||||
* [更改数据节点名称](files/10099_更改数据节点名称.md?t=1562744547288) |
* [更改数据节点名称](files/10099_更改数据节点名称.md?t=1563439736176) |
||||||
* [对接前端](files/10100_对接前端.md?t=1562744547288) |
* [对接前端](files/10100_对接前端.md?t=1563439736176) |
||||||
* [自定义过滤器](files/10102_自定义过滤器.md?t=1562744547288) |
* [自定义过滤器](files/10102_自定义过滤器.md?t=1563439736176) |
||||||
* [文件上传](files/10104_文件上传.md?t=1562744547289) |
* [文件上传](files/10104_文件上传.md?t=1563439736176) |
||||||
* [nacos注册中心](files/10106_nacos注册中心.md?t=1562744547289) |
* [nacos注册中心](files/10106_nacos注册中心.md?t=1563439736176) |
||||||
* [扩展其它注册中心](files/10107_扩展其它注册中心.md?t=1562744547289) |
* [扩展其它注册中心](files/10107_扩展其它注册中心.md?t=1563439736176) |
||||||
|
* [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1563439736176) |
||||||
* 原理分析 |
* 原理分析 |
||||||
* [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1562744547289) |
* [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1563439736177) |
||||||
* [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1562744547289) |
* [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1563439736177) |
||||||
* [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1562744547289) |
* [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1563439736177) |
||||||
* [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1562744547289) |
* [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1563439736177) |
||||||
* [常见问题](files/90100_常见问题.md?t=1562744547289) |
* [常见问题](files/90100_常见问题.md?t=1563439736177) |
||||||
|
@ -0,0 +1,104 @@ |
|||||||
|
# 配置Sleuth链路追踪 |
||||||
|
|
||||||
|
配置了Sleuth可以很方便查看微服务的调用路线图,可快速定位问题。 |
||||||
|
|
||||||
|
SOP基于SpringCloud,因此只要整合[Spring Cloud Sleuth](https://spring.io/projects/spring-cloud-sleuth)即可。 |
||||||
|
除此之外,还需要支持dubbo的链路的跟踪,Sleuth在2.0已经对dubbo做了支持,详见:[brave-instrumentation-dubbo-rpc](https://github.com/openzipkin/brave/tree/master/instrumentation/dubbo-rpc) |
||||||
|
|
||||||
|
接入Spring Cloud Sleuth步骤如下: |
||||||
|
|
||||||
|
- 下载zipkin服务器 |
||||||
|
|
||||||
|
以mac环境为例,执行下面命令,下载jar并启动zipkin服务 |
||||||
|
|
||||||
|
``` |
||||||
|
curl -sSL https://zipkin.io/quickstart.sh | bash -s |
||||||
|
java -jar zipkin.jar |
||||||
|
``` |
||||||
|
|
||||||
|
默认端口是9411,更多安装方式详见:[quickstart](https://zipkin.io/pages/quickstart.html) |
||||||
|
|
||||||
|
- sop-gateway/pom.xml添加依赖 |
||||||
|
|
||||||
|
```xml |
||||||
|
<!--开启zipkin服务链路跟踪--> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springframework.cloud</groupId> |
||||||
|
<artifactId>spring-cloud-starter-zipkin</artifactId> |
||||||
|
</dependency> |
||||||
|
``` |
||||||
|
|
||||||
|
配置文件新增 |
||||||
|
|
||||||
|
```properties |
||||||
|
# zipkin服务跟踪 |
||||||
|
spring.zipkin.base-url=http://127.0.0.1:9411/ |
||||||
|
# 设置sleuth收集信息的比率,默认0.1,最大是1,数字越大越耗性能 |
||||||
|
spring.sleuth.sampler.probability=1 |
||||||
|
``` |
||||||
|
重启sop-gateway |
||||||
|
|
||||||
|
- 打开sop-story-web/pom.xml |
||||||
|
|
||||||
|
添加依赖: |
||||||
|
|
||||||
|
```xml |
||||||
|
<!--开启zipkin服务链路跟踪--> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springframework.cloud</groupId> |
||||||
|
<artifactId>spring-cloud-starter-zipkin</artifactId> |
||||||
|
</dependency> |
||||||
|
<!-- zipkin支持dubbo --> |
||||||
|
<dependency> |
||||||
|
<groupId>io.zipkin.brave</groupId> |
||||||
|
<artifactId>brave-instrumentation-dubbo-rpc</artifactId> |
||||||
|
<version>5.6.6</version> |
||||||
|
</dependency> |
||||||
|
``` |
||||||
|
|
||||||
|
配置文件新增: |
||||||
|
|
||||||
|
```properties |
||||||
|
# zipkin服务跟踪 |
||||||
|
spring.zipkin.base-url=http://127.0.0.1:9411/ |
||||||
|
# 设置sleuth收集信息的比率,默认0.1,最大是1,数字越大越耗性能 |
||||||
|
spring.sleuth.sampler.probability=1 |
||||||
|
# dubbo使用zipkin过滤器 |
||||||
|
dubbo.provider.filter=tracing |
||||||
|
dubbo.consumer.filter=tracing |
||||||
|
``` |
||||||
|
|
||||||
|
重启服务 |
||||||
|
|
||||||
|
- 打开sop-book/sop-book-web/pom.xml |
||||||
|
|
||||||
|
步骤同上 |
||||||
|
|
||||||
|
- 运行DubboDemoTest.java单元测试 |
||||||
|
|
||||||
|
运行完毕看控制台,找到日志信息 |
||||||
|
|
||||||
|
```text |
||||||
|
2019-07-18 16:22:04.438 INFO [story-service,59dae98250b276bd,60828035658f175f,true] 90553 --- [:12345-thread-2] c.g.s.s.service.DefaultDemoService : dubbo provider, param: DemoParam(id=222) |
||||||
|
``` |
||||||
|
|
||||||
|
日志内容多了`[story-service,59dae98250b276bd,60828035658f175f,true]`部分,这些是zipkin加进去的,说明如下: |
||||||
|
|
||||||
|
```text |
||||||
|
story-service:服务名称 |
||||||
|
59dae98250b276bd:traceId |
||||||
|
60828035658f175f:spanId |
||||||
|
true:是否上传到zipkin服务器 |
||||||
|
``` |
||||||
|
|
||||||
|
查看各个服务的控制台,可以发现traceId是一致的。 |
||||||
|
|
||||||
|
- 浏览器打开:http://127.0.0.1:9411/ |
||||||
|
|
||||||
|
将traceId复制黏贴到右上角文本框进行查询,可看到服务调用链。 |
||||||
|
|
||||||
|
|
||||||
|
![预览](images/10109_1.png "10109_1.png") |
||||||
|
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 35 KiB |
@ -0,0 +1,2 @@ |
|||||||
|
ALTER TABLE `sop`.`isv_info` ADD COLUMN `remark` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注' AFTER `sign_type`; |
||||||
|
|
@ -1 +1 @@ |
|||||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=favicon.ico><title>SOP Admin</title><link href=static/css/chunk-elementUI.81cf475c.css rel=stylesheet><link href=static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=static/css/app.4f0872ef.css rel=stylesheet></head><body><noscript><strong>We're sorry but SOP Admin doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script>(function(e){function t(t){for(var r,c,a=t[0],i=t[1],f=t[2],l=0,d=[];l<a.length;l++)c=a[l],u[c]&&d.push(u[c][0]),u[c]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);h&&h(t);while(d.length)d.shift()();return o.push.apply(o,f||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,c=1;c<n.length;c++){var a=n[c];0!==u[a]&&(r=!1)}r&&(o.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},c={runtime:0},u={runtime:0},o=[];function a(e){return i.p+"static/js/"+({}[e]||e)+"."+{"chunk-009073d4":"28312808","chunk-238a81e9":"5955f13d","chunk-25908fca":"9d8bc0b6","chunk-29e7142c":"994a3ac0","chunk-2d2085ef":"a63a74dc","chunk-2d22c2e3":"4a098244","chunk-37401378":"4e39ec9b","chunk-4a59cbe4":"a6360c68","chunk-6a68a33e":"b6685cb9","chunk-73b2dcec":"14f248eb"}[e]+".js"}function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.e=function(e){var t=[],n={"chunk-009073d4":1,"chunk-238a81e9":1,"chunk-25908fca":1,"chunk-29e7142c":1,"chunk-37401378":1,"chunk-6a68a33e":1,"chunk-73b2dcec":1};c[e]?t.push(c[e]):0!==c[e]&&n[e]&&t.push(c[e]=new Promise(function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-009073d4":"0af16c7e","chunk-238a81e9":"e8e2beee","chunk-25908fca":"89ab33e8","chunk-29e7142c":"d10599db","chunk-2d2085ef":"31d6cfe0","chunk-2d22c2e3":"31d6cfe0","chunk-37401378":"a43114f3","chunk-4a59cbe4":"31d6cfe0","chunk-6a68a33e":"3b12267b","chunk-73b2dcec":"99cf6327"}[e]+".css",u=i.p+r,o=document.getElementsByTagName("link"),a=0;a<o.length;a++){var f=o[a],l=f.getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(l===r||l===u))return t()}var d=document.getElementsByTagName("style");for(a=0;a<d.length;a++){f=d[a],l=f.getAttribute("data-href");if(l===r||l===u)return t()}var h=document.createElement("link");h.rel="stylesheet",h.type="text/css",h.onload=t,h.onerror=function(t){var r=t&&t.target&&t.target.src||u,o=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.code="CSS_CHUNK_LOAD_FAILED",o.request=r,delete c[e],h.parentNode.removeChild(h),n(o)},h.href=u;var s=document.getElementsByTagName("head")[0];s.appendChild(h)}).then(function(){c[e]=0}));var r=u[e];if(0!==r)if(r)t.push(r[2]);else{var o=new Promise(function(t,n){r=u[e]=[t,n]});t.push(r[2]=o);var f,l=document.createElement("script");l.charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.src=a(e),f=function(t){l.onerror=l.onload=null,clearTimeout(d);var n=u[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src,o=new Error("Loading chunk "+e+" failed.\n("+r+": "+c+")");o.type=r,o.request=c,n[1](o)}u[e]=void 0}};var d=setTimeout(function(){f({type:"timeout",target:l})},12e4);l.onerror=l.onload=f,document.head.appendChild(l)}return Promise.all(t)},i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var f=window["webpackJsonp"]=window["webpackJsonp"]||[],l=f.push.bind(f);f.push=t,f=f.slice();for(var d=0;d<f.length;d++)t(f[d]);var h=l;n()})([]);</script><script src=static/js/chunk-elementUI.8ebdfbab.js></script><script src=static/js/chunk-libs.9cf9cc40.js></script><script src=static/js/app.095e8b9c.js></script></body></html> |
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=favicon.ico><title>SOP Admin</title><link href=static/css/chunk-elementUI.81cf475c.css rel=stylesheet><link href=static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=static/css/app.4f0872ef.css rel=stylesheet></head><body><noscript><strong>We're sorry but SOP Admin doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script>(function(e){function t(t){for(var r,c,o=t[0],i=t[1],f=t[2],l=0,d=[];l<o.length;l++)c=o[l],u[c]&&d.push(u[c][0]),u[c]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);h&&h(t);while(d.length)d.shift()();return a.push.apply(a,f||[]),n()}function n(){for(var e,t=0;t<a.length;t++){for(var n=a[t],r=!0,c=1;c<n.length;c++){var o=n[c];0!==u[o]&&(r=!1)}r&&(a.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},c={runtime:0},u={runtime:0},a=[];function o(e){return i.p+"static/js/"+({}[e]||e)+"."+{"chunk-009073d4":"28312808","chunk-238a81e9":"5955f13d","chunk-25908fca":"ca176fa6","chunk-29e7142c":"994a3ac0","chunk-2d2085ef":"a63a74dc","chunk-2d22c2e3":"4a098244","chunk-37401378":"4e39ec9b","chunk-4a59cbe4":"a6360c68","chunk-6a68a33e":"b6685cb9","chunk-73b2dcec":"14f248eb"}[e]+".js"}function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.e=function(e){var t=[],n={"chunk-009073d4":1,"chunk-238a81e9":1,"chunk-25908fca":1,"chunk-29e7142c":1,"chunk-37401378":1,"chunk-6a68a33e":1,"chunk-73b2dcec":1};c[e]?t.push(c[e]):0!==c[e]&&n[e]&&t.push(c[e]=new Promise(function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-009073d4":"0af16c7e","chunk-238a81e9":"e8e2beee","chunk-25908fca":"89ab33e8","chunk-29e7142c":"d10599db","chunk-2d2085ef":"31d6cfe0","chunk-2d22c2e3":"31d6cfe0","chunk-37401378":"a43114f3","chunk-4a59cbe4":"31d6cfe0","chunk-6a68a33e":"3b12267b","chunk-73b2dcec":"99cf6327"}[e]+".css",u=i.p+r,a=document.getElementsByTagName("link"),o=0;o<a.length;o++){var f=a[o],l=f.getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(l===r||l===u))return t()}var d=document.getElementsByTagName("style");for(o=0;o<d.length;o++){f=d[o],l=f.getAttribute("data-href");if(l===r||l===u)return t()}var h=document.createElement("link");h.rel="stylesheet",h.type="text/css",h.onload=t,h.onerror=function(t){var r=t&&t.target&&t.target.src||u,a=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");a.code="CSS_CHUNK_LOAD_FAILED",a.request=r,delete c[e],h.parentNode.removeChild(h),n(a)},h.href=u;var s=document.getElementsByTagName("head")[0];s.appendChild(h)}).then(function(){c[e]=0}));var r=u[e];if(0!==r)if(r)t.push(r[2]);else{var a=new Promise(function(t,n){r=u[e]=[t,n]});t.push(r[2]=a);var f,l=document.createElement("script");l.charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.src=o(e),f=function(t){l.onerror=l.onload=null,clearTimeout(d);var n=u[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src,a=new Error("Loading chunk "+e+" failed.\n("+r+": "+c+")");a.type=r,a.request=c,n[1](a)}u[e]=void 0}};var d=setTimeout(function(){f({type:"timeout",target:l})},12e4);l.onerror=l.onload=f,document.head.appendChild(l)}return Promise.all(t)},i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var f=window["webpackJsonp"]=window["webpackJsonp"]||[],l=f.push.bind(f);f.push=t,f=f.slice();for(var d=0;d<f.length;d++)t(f[d]);var h=l;n()})([]);</script><script src=static/js/chunk-elementUI.8ebdfbab.js></script><script src=static/js/chunk-libs.9cf9cc40.js></script><script src=static/js/app.095e8b9c.js></script></body></html> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,14 +1,6 @@ |
|||||||
server.port=1111 |
server.port=1111 |
||||||
spring.application.name=sop-registry |
spring.application.name=sop-registry |
||||||
|
|
||||||
# ------- 需要改的配置 ------- |
|
||||||
|
|
||||||
# eureka注册中心地址 |
|
||||||
eureka.url=http://localhost:1111/eureka/ |
|
||||||
# ------- 需要改的配置end ------- |
|
||||||
|
|
||||||
######### 下面的配置基本不用改 ######### |
|
||||||
|
|
||||||
eureka.client.fetch-registry=false |
eureka.client.fetch-registry=false |
||||||
eureka.client.register-with-eureka=false |
eureka.client.register-with-eureka=false |
||||||
eureka.client.serviceUrl.defaultZone=${eureka.url} |
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/ |
||||||
|
Loading…
Reference in new issue