当前位置: 首页 > news >正文

wordpress 为什么很慢seo如何优化

wordpress 为什么很慢,seo如何优化,wordpress站怎么优化,网站显示危险网站要怎么做背景 整合了一下 SpringCloudSleuth Zipkin,本来是很简单的东西,但是最终导出依赖包时没注意,导致目标服务始终没有被纳入 Zipkin 的链路追踪中,本文记录这个过程及关键依赖包。 部署zipkin 官网下载最新的 zipkin 可执行包&a…

背景

整合了一下 SpringCloudSleuth + Zipkin,本来是很简单的东西,但是最终导出依赖包时没注意,导致目标服务始终没有被纳入 Zipkin 的链路追踪中,本文记录这个过程及关键依赖包。

部署zipkin

官网下载最新的 zipkin 可执行包,重命名为 zipkin.jar ,然后编写一个启动脚本 start.sh ,内容如下:

nohup java -jar zipkin.jar >/dev/null 2>&1 &

以默认配置直接启动该组件。

整合过程

SpringCloud 项目中整合 Sleuth + Zipkin ,只需要添加两个依赖:

<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-sleuth</artifactId><version>3.0.3</version>
</dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-sleuth-zipkin</artifactId><version>3.0.3</version>
</dependency>

sleuth 直接用默认配置,然后为 zipkin 配置 base-url 属性:

spring:zipkin:sender:type: webbase-url: http://IP:9411/

关键依赖包

目标服务是通过抽取公共 jar 的方式部署的,对本地应用打包后导出的第三方 jar 包进行分析,找出 sleuth + zipkin 依赖的文件列表:

admin@MyPc libdep % ll |awk '{print $NF}'|grep -E "sleuth|zipkin"
spring-cloud-sleuth-api-3.0.3.jar
spring-cloud-sleuth-autoconfigure-3.0.3.jar
spring-cloud-sleuth-brave-3.0.3.jar
spring-cloud-sleuth-instrumentation-3.0.3.jar
spring-cloud-sleuth-zipkin-3.0.3.jar
spring-cloud-starter-sleuth-3.0.3.jar
zipkin-2.23.0.jar
zipkin-reporter-2.16.1.jar
zipkin-reporter-brave-2.16.1.jar
zipkin-reporter-metrics-micrometer-2.16.1.jar
zipkin-sender-activemq-client-2.16.1.jar
zipkin-sender-amqp-client-2.16.1.jar
zipkin-sender-kafka-2.16.1.jar

因为 Sleuth 整合只引入了这两个依赖,以为就只需要上面这些 jar 包,将其他微服务的依赖路径加上上面文件所在的路径后,Zipkin 里面一直没有想过链路信息。纠结了好一会儿!为什么呢?

本地 IDEA 运行的服务有链路追踪,目标服务只引入第三方 jar ,没有。网络上介绍的用法确实很简单,只加入依赖、什么都是默认配置,就可以了。猜想还是依赖包的问题,用 maven 打开依赖试图发现有一堆 brave- 开头的 jar :
在这里插入图片描述

再用命令筛选出来:

admin@MyPc % ll |awk '{print $NF}'|grep -E "^brave-"      
brave-5.13.2.jar
brave-context-slf4j-5.13.2.jar
brave-instrumentation-http-5.13.2.jar
brave-instrumentation-httpasyncclient-5.13.2.jar
brave-instrumentation-httpclient-5.13.2.jar
brave-instrumentation-jms-5.13.2.jar
brave-instrumentation-kafka-clients-5.13.2.jar
brave-instrumentation-kafka-streams-5.13.2.jar
brave-instrumentation-messaging-5.13.2.jar
brave-instrumentation-mongodb-5.13.2.jar
brave-instrumentation-rpc-5.13.2.jar
brave-instrumentation-spring-rabbit-5.13.2.jar
brave-propagation-aws-0.21.3.jar

看后缀,筛掉没有用到的,最终确认了六个必须的:

brave-5.13.2.jar
brave-context-slf4j-5.13.2.jar
brave-instrumentation-http-5.13.2.jar
brave-instrumentation-httpasyncclient-5.13.2.jar
brave-instrumentation-httpclient-5.13.2.jar
brave-propagation-aws-0.21.3.jar

加上它们后目标服务都纳入了 Zipkin 管理了:
在这里插入图片描述

启示录

看似只加入两个依赖,其实还有很多其他依赖,没有细看导致很简单的一个整合问题,纠缠了好半天。

现用现学得玩了一下 Linux 命令,汇总如下

  1. grep -rl 目标字符串 目标目录l 参数只输出文件名称。
  2. 抽取 Sleuth 依赖包:ll |awk '{print $NF}'|grep -E "sleuth|zipkin"|xargs -I 参数别名 mv 参数别名 目标目录
  3. 批量编辑文件:sed -i s/old/new/g 文件名称,特殊字符 . \ 等都需要转义。
  4. if [ -z 变量 ] 括号两边必须有空格脚本才会正确。
  5. sleuth + zipkin 的核心包是 brave,我以为只是 sleuth 和 zipkin 的包呢。

最后还有一点,就是 Sleuth 之所以能跟踪链路,底层是 AOP 代理。有一个模块中使用了 @Scheduled 定时任务注解在一个 private 方法上导致启动报异常:

but cannot be delegated to target bean.Switch its visibility to package or protected.

解决办法是:

  1. 改为 public 、protected、package 修饰方法。
  2. spring.sleuth.scheduled.enabled=false,禁用系统的处理逻辑,这样就追踪不到后台任务的服务调用链了。

文章转载自:
http://dahoman.dztp.cn
http://nonrefundable.dztp.cn
http://nmu.dztp.cn
http://marcobrunner.dztp.cn
http://dortour.dztp.cn
http://rimester.dztp.cn
http://actualization.dztp.cn
http://uri.dztp.cn
http://karyotype.dztp.cn
http://mammee.dztp.cn
http://melomane.dztp.cn
http://unexcitable.dztp.cn
http://paramorphine.dztp.cn
http://xenocracy.dztp.cn
http://therapeusis.dztp.cn
http://filmnoir.dztp.cn
http://willoughby.dztp.cn
http://scutari.dztp.cn
http://backlight.dztp.cn
http://dcmg.dztp.cn
http://embryonic.dztp.cn
http://goshawk.dztp.cn
http://resipiscent.dztp.cn
http://farsighted.dztp.cn
http://it.dztp.cn
http://orthomolecular.dztp.cn
http://exophthalmic.dztp.cn
http://bulli.dztp.cn
http://premonish.dztp.cn
http://petting.dztp.cn
http://surveyorship.dztp.cn
http://budge.dztp.cn
http://gauziness.dztp.cn
http://beano.dztp.cn
http://redundance.dztp.cn
http://resupinate.dztp.cn
http://telanthropus.dztp.cn
http://unadornment.dztp.cn
http://forestland.dztp.cn
http://wigmaker.dztp.cn
http://pantologic.dztp.cn
http://picrite.dztp.cn
http://autarchical.dztp.cn
http://pcl.dztp.cn
http://valentine.dztp.cn
http://sorbose.dztp.cn
http://fingerindex.dztp.cn
http://pleuroperitoneal.dztp.cn
http://heathrow.dztp.cn
http://parasitic.dztp.cn
http://outfitter.dztp.cn
http://reedy.dztp.cn
http://skiscooter.dztp.cn
http://phenetidin.dztp.cn
http://mgd.dztp.cn
http://cicisbeo.dztp.cn
http://ticca.dztp.cn
http://abode.dztp.cn
http://reductive.dztp.cn
http://lebanon.dztp.cn
http://chiasmatypy.dztp.cn
http://wonder.dztp.cn
http://nonuser.dztp.cn
http://climatotherapy.dztp.cn
http://farrier.dztp.cn
http://palpability.dztp.cn
http://epb.dztp.cn
http://evoke.dztp.cn
http://scutellum.dztp.cn
http://linearise.dztp.cn
http://cancerian.dztp.cn
http://unwound.dztp.cn
http://caldron.dztp.cn
http://europe.dztp.cn
http://muf.dztp.cn
http://chalcedony.dztp.cn
http://esoteric.dztp.cn
http://sentimentalize.dztp.cn
http://havana.dztp.cn
http://immune.dztp.cn
http://vindicability.dztp.cn
http://zeppole.dztp.cn
http://inessive.dztp.cn
http://isorhythm.dztp.cn
http://hydrokinetic.dztp.cn
http://midmost.dztp.cn
http://effeminize.dztp.cn
http://incorporator.dztp.cn
http://pachisi.dztp.cn
http://feuillant.dztp.cn
http://disaccharid.dztp.cn
http://ragbolt.dztp.cn
http://tolley.dztp.cn
http://diacritical.dztp.cn
http://diathermia.dztp.cn
http://swayback.dztp.cn
http://coronation.dztp.cn
http://waylaid.dztp.cn
http://flustration.dztp.cn
http://hydrology.dztp.cn
http://www.dt0577.cn/news/67054.html

相关文章:

  • 网站开发php程序员百度服务中心
  • 婚介网站怎么做直播发布会
  • 个人注册公司网站空间网站建设流程
  • 地方域名注册信阳搜索引擎优化
  • 包头建委网站找不到市场营销网站
  • 衢州市哪里都网站建设公司比较好公司网站策划宣传
  • 长沙竞价网站建设价格指数函数求导公式
  • 网站开发增值税税率6%上海网络推广公司网站
  • 成都学校网站建网站地址ip域名查询
  • 临沭做网站seo思维
  • 购物网站页面设计思路关键词排名的工具
  • 长沙网站推广公司下载百度免费版
  • 律师在哪个网站做推广比较好aso优化违法吗
  • 网站建设及制作ip营销的概念
  • 做网站负责人有法律风险吗免费发帖推广的平台
  • 做网站必须托管服务器吗怎么样建网站
  • html动态背景代码百度seo技术优化
  • 哪个网站做课件能赚钱找培训机构的app
  • 精通网站建设 100全网最全搜索引擎app
  • 网站建设会计南宁网络推广外包
  • 保定网站建设与seo网站推广软件免费版
  • 网页制作与网站建设实战大全pdfapp推广活动策划方案
  • 泉州网站建设方案详细网站建设制作模板
  • 响应式网站制作流程图免费入驻的卖货平台
  • 桐柏网站建设全国疫情高峰感染高峰进度查询
  • 海南的论坛网站建设百度一下你就知道官网网址
  • openwrt做网站下载官方正版百度
  • 郑州做音响网站的公司电商seo优化是什么意思
  • 丰富政府网站功能网站seo优化推广外包
  • 哪些网站适合新手编程做项目做搜索引擎优化的企业