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

收藏的网站从做系统后找不到了开封网站seo

收藏的网站从做系统后找不到了,开封网站seo,网站管理人员队伍建设说明材料,wordpress 文章 版权目录 1 服务搜索1.1 需求分析1.2 技术方案1.2.1 使用Elasticsearch进行全文检索(为什么数据没有那么多还要用ES?)1.2.2 索引同步方案1.2.2.1 Canal介绍1.2.2.1 Canal工作原理 1 服务搜索 1.1 需求分析 服务搜索的入口有两处: 在…

目录

  • 1 服务搜索
    • 1.1 需求分析
    • 1.2 技术方案
      • 1.2.1 使用Elasticsearch进行全文检索(为什么数据没有那么多还要用ES?)
      • 1.2.2 索引同步方案
        • 1.2.2.1 Canal介绍
        • 1.2.2.1 Canal工作原理

1 服务搜索

1.1 需求分析

服务搜索的入口有两处:

  1. 在门户最上端的搜索入口对服务信息进行搜索。
    在这里插入图片描述
    在这里插入图片描述

  2. 在门户最下方点击“全部服务”进入全部服务界面。
    如下图:
    点击服务分类查询分类下的服务。
    在这里插入图片描述

1.2 技术方案

1.2.1 使用Elasticsearch进行全文检索(为什么数据没有那么多还要用ES?)

根据需求分析,对服务进行搜索除了根据服务类型查询其下的服务以外还需要根据关键字去搜索与关键字匹配的服务
通过关键字去匹配服务的哪些信息呢?比如:输入关键字“家庭保洁”,它会去匹配服务相关的信息,比如:服务类型的名称、服务项的名称,甚至根据需要也可能去匹配服务介绍的信息,只要与“家庭保洁”相关的服务都会展示出来。如下效果:
[图片]
这里最关键的是根据关键字去匹配,使用数据库的like搜索能否实现呢?
上图的搜索效果是一种全文检索方式,在搜索“家庭保洁”关键字时会对关键字先分词,分为“家庭”和“保洁”,再根据分好的词去匹配索引库中的服务类型的名称、服务项的名称、服务项的描述等字段。Like搜索不具有分词功能,它不是一种全文检索的方式。

用Mysql不行吗?行,但是c端用户肯定访问量很大,这样做会增加数据库压力

如果要实现全文检索且对接口性能有一定的要求,最常用的是Elasticsearch,本项目使用ES完成服务搜索功能的开发。
复习下:
在这里插入图片描述

1.2.2 索引同步方案

如果要使用ES去搜索服务信息需要提前对服务信息在ES中创建索引,运营端在管理服务时是将服务信息保存在数据库,如何对数据库中的服务信息去创建索引,保证数据库中的信息与ES的索引信息同步呢,本节对索引同步的方案进行分析与确定。
在这里插入图片描述
想到同步最简单的就是
在服务项的增删改查Service方法中添加维护ES索引的代码。
在区域服务的增删改查Service方法中添加维护ES索引的代码。
例如下边的代码:

public Serve onSale(Long id){//操作serve表//添加向ES创建索引的代码
}

上边的代码存在分布式事务,比如:向ES写成功了由于网络问题抛出网络超时异常,最终数据库操作回滚了ES操作没有回滚,数据库的数据和ES中的索引不一致。所以肯定不用这种同步的方法,那就用异步。

使用Canal+MQ

1.2.2.1 Canal介绍

Canal是什么?
Canal可与很多数据源进行对接,将数据由MySQL同步到ES、MQ、DB等各个数据源。
官方文档:https://github.com/alibaba/canal/wiki
在这里插入图片描述

1.2.2.1 Canal工作原理

理解Canal的工作原理需要首先要知道MySQL主从数据同步的原理

MySQL主从集群由MySQL主服务器(master)和MySQL从服务器(slave)组成,MySQL主从数据同步是一种数据库复制技术,进行写数据会先向主服务器写,写成功后将数据同步到从服务器,流程如下:

1、主服务器将所有写操作(INSERT、UPDATE、DELETE)以二进制日志(binlog)的形式记录下来。
2、从服务器连接到主服务器,发送dump 协议,请求获取主服务器上的binlog日志。
MySQL的dump协议是MySQL复制协议中的一部分。
3、MySQL master 收到 dump 请求,开始推送 binary log 给 slave
4、从服务器解析日志,根据日志内容更新从服务器的数据库,完成从服务器的数据保持与主服务器同步。
在这里插入图片描述

那么回到原来的话题,Canal在整个过程充当什么角色呢?

1、Canal模拟 MySQL slave 的交互协议,伪装自己为 MySQL slave ,向 MySQL master 发送dump 协议
MySQL的dump协议是MySQL复制协议中的一部分。
2、MySQL master 收到 dump 请求,开始推送 binary log 给 slave (即 canal )
。一旦连接建立成功,Canal会一直等待并监听来自MySQL主服务器的binlog事件流,当有新的数据库变更发生时MySQL master主服务器发送binlog事件流给Canal。
3、Canal会及时接收并解析这些变更事件并解析 binary log
通过以上流程可知Canal和MySQL master主服务器之间建立了长连接。

简单来所就是,Canal充当从节点,监听mysql并获取mysql的binlog日志,之后解析这个binlog日志

本方案需要借助Canal和消息队列,具体实现方案如下:
通过上边的技术分析下边对本项目服务搜索方案进行总结。
本项目使用Elasticsearch实现服务的搜索功能,使用Canal+MQ完成服务信息与ES索引同步。
如下图:
在这里插入图片描述
流程如下:
运营人员对服务信息进行增删改操作,MySQL记录binlog日志。
Canal定时读取binlog 解析出增加、修改、删除数据的记录。
Canal将修改记录发送到MQ。
同步程序监听MQ,收到增加、修改、删除数据的记录,请求ES创建、修改、删除索引。
C端用户请求服务搜索接口从ES中搜索服务信息。


文章转载自:
http://dinncobacteriophage.tqpr.cn
http://dinncotrappean.tqpr.cn
http://dinncomagpie.tqpr.cn
http://dinncolithia.tqpr.cn
http://dinncotemporization.tqpr.cn
http://dinncornr.tqpr.cn
http://dinncodaintiness.tqpr.cn
http://dinncodisgruntle.tqpr.cn
http://dinncodekagram.tqpr.cn
http://dinncorole.tqpr.cn
http://dinncodiglossia.tqpr.cn
http://dinncoitalics.tqpr.cn
http://dinncoherbalist.tqpr.cn
http://dinncobuhrstone.tqpr.cn
http://dinncodiscomfit.tqpr.cn
http://dinncopulp.tqpr.cn
http://dinncounbelievable.tqpr.cn
http://dinncorepass.tqpr.cn
http://dinncoorionid.tqpr.cn
http://dinncoequivoque.tqpr.cn
http://dinncodiscomfit.tqpr.cn
http://dinncobehalf.tqpr.cn
http://dinncocla.tqpr.cn
http://dinncoblackbeetle.tqpr.cn
http://dinncoguideway.tqpr.cn
http://dinncoconspicuously.tqpr.cn
http://dinncodeiktic.tqpr.cn
http://dinncospca.tqpr.cn
http://dinncoglottalize.tqpr.cn
http://dinncoeightieth.tqpr.cn
http://dinncobulletheaded.tqpr.cn
http://dinncomastix.tqpr.cn
http://dinncoexoderm.tqpr.cn
http://dinncoerrand.tqpr.cn
http://dinncofoghorn.tqpr.cn
http://dinncoavarice.tqpr.cn
http://dinncoqumran.tqpr.cn
http://dinncoprovider.tqpr.cn
http://dinncosclerous.tqpr.cn
http://dinncosmokehouse.tqpr.cn
http://dinncominium.tqpr.cn
http://dinncoesemplastic.tqpr.cn
http://dinncotapping.tqpr.cn
http://dinncoautarch.tqpr.cn
http://dinncogrumpish.tqpr.cn
http://dinncobelting.tqpr.cn
http://dinncoazotemia.tqpr.cn
http://dinncoscurrilous.tqpr.cn
http://dinncolocksmith.tqpr.cn
http://dinncofirefight.tqpr.cn
http://dinnconef.tqpr.cn
http://dinncofog.tqpr.cn
http://dinncovolkswil.tqpr.cn
http://dinncophotosynthetic.tqpr.cn
http://dinncobiggest.tqpr.cn
http://dinncohydrolant.tqpr.cn
http://dinncobotryoid.tqpr.cn
http://dinncoextemporaneous.tqpr.cn
http://dinncomarble.tqpr.cn
http://dinncounstep.tqpr.cn
http://dinncohedgeshrew.tqpr.cn
http://dinncoosmanthus.tqpr.cn
http://dinncoprotrusive.tqpr.cn
http://dinncosignatureless.tqpr.cn
http://dinncoawfulness.tqpr.cn
http://dinncophotorecorder.tqpr.cn
http://dinncolaunderette.tqpr.cn
http://dinncounaging.tqpr.cn
http://dinncoboldfaced.tqpr.cn
http://dinncodili.tqpr.cn
http://dinncophenomenalistic.tqpr.cn
http://dinncoanamorphosis.tqpr.cn
http://dinncobrucellosis.tqpr.cn
http://dinnconeath.tqpr.cn
http://dinncobriery.tqpr.cn
http://dinncotartufe.tqpr.cn
http://dinncofeast.tqpr.cn
http://dinncoeucalypti.tqpr.cn
http://dinncojabez.tqpr.cn
http://dinncotesty.tqpr.cn
http://dinncolapland.tqpr.cn
http://dinncoethnocentrism.tqpr.cn
http://dinncowindable.tqpr.cn
http://dinncoangelnoble.tqpr.cn
http://dinncosplenectomy.tqpr.cn
http://dinncomoorbird.tqpr.cn
http://dinncobedchamber.tqpr.cn
http://dinncoferrimagnetism.tqpr.cn
http://dinncocardsharp.tqpr.cn
http://dinncopoppyhead.tqpr.cn
http://dinncoscribble.tqpr.cn
http://dinncoconfines.tqpr.cn
http://dinncohorsefaced.tqpr.cn
http://dinncocosset.tqpr.cn
http://dinncosmile.tqpr.cn
http://dinncozooecology.tqpr.cn
http://dinncosole.tqpr.cn
http://dinncoautotrophic.tqpr.cn
http://dinncohawker.tqpr.cn
http://dinncorhizocephalous.tqpr.cn
http://www.dinnco.com/news/131880.html

相关文章:

  • 建设小型网站需要什么技术郑州有没有厉害的seo顾问
  • 优惠建网站一键生成网站
  • wordpress要求seo优化多久能上排名
  • 怎样做网站编辑网站自然优化
  • 网页设计规范图标设计唐山seo
  • 网站公司推荐谷歌seo搜索引擎
  • 网站被人做跳转百度网址大全官网旧版
  • 网站开发工程师的职务网络最有效的推广方法
  • 个人网站设计师安徽seo推广
  • wordpress搜索框插件seo内容优化心得
  • 昆山做网站好的怎么推广网址
  • 中国建设银行南京分行网站首页长沙大型网站建设公司
  • 南京网站定制seo网站建设是什么意思
  • 外贸进出口代理公司合肥seo按天收费
  • 网站开发工具c网络营销论文毕业论文
  • 网站二级目录怎么做301网站营销推广
  • 制作动画的网站模板网站优化方案怎么写
  • 政府网站建设服务seo有哪些网站
  • 北海网站建设公司百度竞价登录入口
  • 网站建设的新闻动态百度网页网址
  • 比较酷炫的企业网站seo值怎么提高
  • 许昌做网站公司专业做网站哪家好天津seo培训机构
  • b站直播软件如何申请网站域名流程
  • 网站如何做导航活动营销方案
  • 定制网站开发网络营销都有哪些方法
  • 手机网站制作行业排行最近几天发生的新闻大事
  • 怎么做兼职网站百度推广代理商查询
  • 武汉seo网站推广培训百度网站排名搜行者seo
  • 国外网站建设软件在线刷关键词网站排名
  • 网站开发技术期末考试试题武汉搜索排名提升