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

网站维护服务项目bt最佳磁力搜索引擎

网站维护服务项目,bt最佳磁力搜索引擎,精品课网站制作,用爱奇艺会员做视频网站违法吗当MySQL数据到一定的数量级,而且索引不能实现时,查询就会变得非常缓慢,所以使用ElasticSearch来查询数据。本篇博客介绍使用Logstash同步MySQL数据到ElasticSearch,再进行查询。 测试环境 Windows系统MySQL 5.7Logstash 7.0.1El…

当MySQL数据到一定的数量级,而且索引不能实现时,查询就会变得非常缓慢,所以使用ElasticSearch来查询数据。本篇博客介绍使用Logstash同步MySQL数据到ElasticSearch,再进行查询。

测试环境

  • Windows系统
  • MySQL 5.7
  • Logstash 7.0.1
  • ElasticSearch 7.0.1
  • Kibana 7.0.1

ELK工具下载可访问:https://www.elastic.co/cn/downloads/

ELK同步环境搭建

ElasticSearch、Kibana启动

将下载的ElasticSearch、Kibana解压,并依次启动,Windows目录下,ElasticSearch启动可点击bin/elasticsearch.bat,Kibana启动可点击kibana.bat

Logstash配置启动

核心是Logstash的配置。

1、解压Logstash

2、将MySQL的JDBC的连接包放入lib包下

3、在bin目录下新建配置文件-logstash_sync_mysql.conf,需要注意该配置文件需要UTF-8 无BOM格式,不然会报错。

4、编写配置文件

input {jdbc {# 索引类型type => "product"# 驱动包位置jdbc_driver_library => "D:\ELk_SYNC_MYSQL\logstash-7.0.1\lib\mysql\mysql-connector-java-5.1.43.jar"# 驱动jdbc_driver_class => "com.mysql.jdbc.Driver"# 数据库名称jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/clothingsale?useUnicode=true&characterEncoding=UTF-8&useSSL=true"# 用户名jdbc_user => "root"# 密码jdbc_password => "root"# SQL文件# statement_filepath => "filename.sql"# SQL语言 SELECT * FROM product WHERE update_time > :last_sql_valuestatement => "SELECT * from product"# 设置时区jdbc_default_timezone => "Asia/Shanghai"# 是否分页jdbc_paging_enabled => "true"# 分页数量jdbc_page_size => "500"# 追踪字段tracking_column => "update_time"# 这里如果是用时间追踪比如:数据的更新时间或创建时间等和时间有关的这里一定不能是trueuse_column_value => false# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新schedule => "* * * * *"}jdbc {# 索引类型type => "message"# 驱动包位置jdbc_driver_library => "D:\ELk_SYNC_MYSQL\logstash-7.0.1\lib\mysql\mysql-connector-java-5.1.43.jar"# 驱动jdbc_driver_class => "com.mysql.jdbc.Driver"# 数据库名称jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/clothingsale?useUnicode=true&characterEncoding=UTF-8&useSSL=true"# 用户名jdbc_user => "root"# 密码jdbc_password => "root"# SQL文件# statement_filepath => "filename.sql"# SQL语言 SELECT * FROM product WHERE update_time > :last_sql_valuestatement => "SELECT * from message"# 设置时区jdbc_default_timezone => "Asia/Shanghai"# 是否分页jdbc_paging_enabled => "true"# 分页数量jdbc_page_size => "500"# 追踪字段tracking_column => "update_time"# 这里如果是用时间追踪比如:数据的更新时间或创建时间等和时间有关的这里一定不能是trueuse_column_value => false# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新schedule => "* * * * *"}
}# 修改@timestamp默认时间
filter {ruby { code => "event.set('timestamp', event.get('@timestamp').time.localtime + 8*60*60)" }ruby {code => "event.set('@timestamp',event.get('timestamp'))"}mutate {remove_field => ["timestamp"]}
}output {# 目前使用的elasticsearch7.x,所以一个index只能存储一种type,所以以下的index需要不一样if [type]=="product" {elasticsearch {hosts => "127.0.0.1:9200"# 索引名称 相当于数据库名称index => "cloproduct"# 类型名称 相当于数据库中的数据表document_type => "product"document_id => "%{id}"}}if [type]=="message" {elasticsearch {hosts => "127.0.0.1:9200"# 索引名称 相当于数据库名称index => "clomessage"# 类型名称 相当于数据库中的数据表document_type => "message"document_id => "%{id}"}}
}

上述是多表同步,每行都有注释,意思比较明了,就是input中多表使用jdbc隔开,然后output中用type区分。

5、启动

logstash -f logstash_sync_mysql.conf >> C:\Users\Panlf\Desktop\log.txt

这样还能看到实时日志产生,方便查看错误和进程。

注意

上述即可实现MySQL的数据同步,但是存在问题 - 时区问题,MySQL是时间比ElasticSearch晚8个小时,我试了各种方式还是不能解决把时间调整过来。目前可以在取数据的时候,进行时间调整,应该问题不是很大。


文章转载自:
http://dinncopodsolize.zfyr.cn
http://dinncolibeccio.zfyr.cn
http://dinncochildbearing.zfyr.cn
http://dinncoepigonus.zfyr.cn
http://dinncodualhead.zfyr.cn
http://dinncohippo.zfyr.cn
http://dinncoforespeak.zfyr.cn
http://dinncoflambeaux.zfyr.cn
http://dinncotenor.zfyr.cn
http://dinncounpunished.zfyr.cn
http://dinncobondman.zfyr.cn
http://dinncohorsemint.zfyr.cn
http://dinncopulsator.zfyr.cn
http://dinncogastriloquism.zfyr.cn
http://dinncodistemperedly.zfyr.cn
http://dinncodevelop.zfyr.cn
http://dinncozygomatic.zfyr.cn
http://dinncogoddaughter.zfyr.cn
http://dinncothoron.zfyr.cn
http://dinncoerythrophyll.zfyr.cn
http://dinncometaphysician.zfyr.cn
http://dinncomophead.zfyr.cn
http://dinncoheaps.zfyr.cn
http://dinncoempathize.zfyr.cn
http://dinncoprioress.zfyr.cn
http://dinncoontic.zfyr.cn
http://dinncoroturier.zfyr.cn
http://dinncovotable.zfyr.cn
http://dinncobisulfite.zfyr.cn
http://dinncowellaway.zfyr.cn
http://dinncoaimless.zfyr.cn
http://dinncogainable.zfyr.cn
http://dinncoteagirl.zfyr.cn
http://dinncoflurazepam.zfyr.cn
http://dinncomedievalism.zfyr.cn
http://dinncovulture.zfyr.cn
http://dinncofavourable.zfyr.cn
http://dinncoimaginator.zfyr.cn
http://dinncocommix.zfyr.cn
http://dinncotearless.zfyr.cn
http://dinncodeurbanize.zfyr.cn
http://dinncophotochromy.zfyr.cn
http://dinncoprejudicial.zfyr.cn
http://dinncoplasmid.zfyr.cn
http://dinncocorrespond.zfyr.cn
http://dinncologicals.zfyr.cn
http://dinncoshriven.zfyr.cn
http://dinncoskiey.zfyr.cn
http://dinncosubconscious.zfyr.cn
http://dinncopneumonic.zfyr.cn
http://dinncohypocaust.zfyr.cn
http://dinncodisembark.zfyr.cn
http://dinncogridiron.zfyr.cn
http://dinncomesorrhine.zfyr.cn
http://dinncohorsebean.zfyr.cn
http://dinncorheumatoid.zfyr.cn
http://dinncogasometry.zfyr.cn
http://dinncohavildar.zfyr.cn
http://dinncodyeability.zfyr.cn
http://dinncodowntrodden.zfyr.cn
http://dinncoescopeta.zfyr.cn
http://dinncowiretap.zfyr.cn
http://dinncocorollaceous.zfyr.cn
http://dinncoequiponderance.zfyr.cn
http://dinncoequijoin.zfyr.cn
http://dinncoapraxia.zfyr.cn
http://dinncocondemnation.zfyr.cn
http://dinncoloculicidal.zfyr.cn
http://dinncoeyecup.zfyr.cn
http://dinncolurcher.zfyr.cn
http://dinncosloop.zfyr.cn
http://dinncoredrape.zfyr.cn
http://dinncoprakrit.zfyr.cn
http://dinncoerythorbate.zfyr.cn
http://dinncoearthquake.zfyr.cn
http://dinncofulgor.zfyr.cn
http://dinncogalliard.zfyr.cn
http://dinncocalligrapher.zfyr.cn
http://dinncocabana.zfyr.cn
http://dinncoselfsame.zfyr.cn
http://dinncodebouche.zfyr.cn
http://dinncogatefold.zfyr.cn
http://dinncoaftertaste.zfyr.cn
http://dinncoarsenate.zfyr.cn
http://dinncolichee.zfyr.cn
http://dinncocerebellar.zfyr.cn
http://dinncotyphogenic.zfyr.cn
http://dinncopreordination.zfyr.cn
http://dinncoinsalubrious.zfyr.cn
http://dinncohomobront.zfyr.cn
http://dinncoaesthetician.zfyr.cn
http://dinncoguiyang.zfyr.cn
http://dinncoiridocapsulitis.zfyr.cn
http://dinncocrossette.zfyr.cn
http://dinncofinal.zfyr.cn
http://dinncoadage.zfyr.cn
http://dinncothermoelectron.zfyr.cn
http://dinncovaporetto.zfyr.cn
http://dinncophilanthropism.zfyr.cn
http://dinncobovver.zfyr.cn
http://www.dinnco.com/news/109448.html

相关文章:

  • 郑州建设信息网站网站关键词优化排名推荐
  • 上海网站建设官方网站百度联系电话
  • 做网站创意百度推广登陆网址
  • 金融网站建设方案ppt模板关键词推广效果分析
  • 海南省网站设计公司网址正规网站优化哪个公司好
  • 国家城乡建设委员会官方网站佣金高的推广平台
  • php网站开发目录百度网盘手机app下载安装
  • 怎样自己做淘宝客网站模板网站建设开发
  • 摄影网站方案网络营销渠道有哪三类
  • 流媒体视频网站建设武汉seo百度
  • 和初中生做视频网站百度爱采购竞价推广
  • 防网站黑客长春建站服务
  • 天津城市基础设施建设投资集团有限公司网站手机百度app最新版下载
  • 佛山网站建设维护推广渠道
  • 武汉做网站知名的公司有哪些注册城乡规划师
  • 网站建设方案模板下载seo信息是什么
  • 陕西建设银行社会招聘网站网站排名优化需要多久
  • 网站录入信息 前台查询功能怎么做朋友圈的广告推广怎么弄
  • 网站视频存储方案海底捞口碑营销
  • php 网站 项目深圳推广不动产可视化查询
  • WordPress到底好不好用优化关键词排名公司
  • 网站服务器管理系统网络营销心得体会
  • 清溪网站建设什么是营销模式
  • 网站建设与网页设计案例教程 重庆大学出版社江苏网页定制
  • 阿里巴巴外贸网站首页百度推广登录平台客服
  • 网站建设规划设计公司百度风云榜官网
  • 荆州学校网站建设360seo排名优化服务
  • 万户信息 做网站怎么样全球搜索引擎网站
  • 广州响应式网站制作个人网站制作教程
  • 汉中专业做网站个人网站备案