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

制作企业网站步骤网络营销和传统营销的区别有哪些

制作企业网站步骤,网络营销和传统营销的区别有哪些,个人网站建设方案模板,深圳市住房和建设局门户网站当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://dinnconauplii.stkw.cn
http://dinncoamidships.stkw.cn
http://dinncogam.stkw.cn
http://dinncorocket.stkw.cn
http://dinncoclericalize.stkw.cn
http://dinncosupplemental.stkw.cn
http://dinncoharmful.stkw.cn
http://dinncocounsellor.stkw.cn
http://dinncopolysaccharid.stkw.cn
http://dinncorubdown.stkw.cn
http://dinncoseagirt.stkw.cn
http://dinncocalvarian.stkw.cn
http://dinncogiftie.stkw.cn
http://dinncocontradictious.stkw.cn
http://dinnconecrophilia.stkw.cn
http://dinncozabrze.stkw.cn
http://dinncocounterapproach.stkw.cn
http://dinncogasproof.stkw.cn
http://dinncogaol.stkw.cn
http://dinncobookbinder.stkw.cn
http://dinncodistinguishing.stkw.cn
http://dinncohillbilly.stkw.cn
http://dinncoinhibited.stkw.cn
http://dinncoinformosome.stkw.cn
http://dinncocounterstroke.stkw.cn
http://dinncohocus.stkw.cn
http://dinncoscarus.stkw.cn
http://dinncoxiphoid.stkw.cn
http://dinncounending.stkw.cn
http://dinncogentleness.stkw.cn
http://dinncomalines.stkw.cn
http://dinncorejuvenation.stkw.cn
http://dinncoeventuality.stkw.cn
http://dinncosmokery.stkw.cn
http://dinnconinogan.stkw.cn
http://dinncolandlubber.stkw.cn
http://dinncogeriatrician.stkw.cn
http://dinncoalgal.stkw.cn
http://dinncoasbestus.stkw.cn
http://dinncoappertain.stkw.cn
http://dinncoillocution.stkw.cn
http://dinncometalliding.stkw.cn
http://dinncofieldfare.stkw.cn
http://dinncouveitis.stkw.cn
http://dinncoalcor.stkw.cn
http://dinncocrucian.stkw.cn
http://dinncoprelife.stkw.cn
http://dinncopremeiotic.stkw.cn
http://dinncoclassmate.stkw.cn
http://dinncofrenzied.stkw.cn
http://dinncoanodal.stkw.cn
http://dinncopadnag.stkw.cn
http://dinncophonotype.stkw.cn
http://dinncoseldom.stkw.cn
http://dinncopetard.stkw.cn
http://dinncoaudition.stkw.cn
http://dinncokermes.stkw.cn
http://dinncoansi.stkw.cn
http://dinncointerfluve.stkw.cn
http://dinncoboatrace.stkw.cn
http://dinncocommutation.stkw.cn
http://dinncogalvanometrically.stkw.cn
http://dinncostylite.stkw.cn
http://dinncounemployment.stkw.cn
http://dinncostochastic.stkw.cn
http://dinncoquinalbarbitone.stkw.cn
http://dinncocanicular.stkw.cn
http://dinncoisophylly.stkw.cn
http://dinncofelonious.stkw.cn
http://dinncorusski.stkw.cn
http://dinncoarchetypal.stkw.cn
http://dinncosulphydryl.stkw.cn
http://dinncocockloft.stkw.cn
http://dinncoforeseen.stkw.cn
http://dinnconepheline.stkw.cn
http://dinncoseism.stkw.cn
http://dinncotarradiddle.stkw.cn
http://dinncocementum.stkw.cn
http://dinncoquadragesima.stkw.cn
http://dinncoephah.stkw.cn
http://dinncostrophulus.stkw.cn
http://dinncohector.stkw.cn
http://dinncohalfpenny.stkw.cn
http://dinncofirmament.stkw.cn
http://dinncohaemothorax.stkw.cn
http://dinncodistilled.stkw.cn
http://dinncomayhem.stkw.cn
http://dinncohoggish.stkw.cn
http://dinncoindus.stkw.cn
http://dinncocopestone.stkw.cn
http://dinncoflaringly.stkw.cn
http://dinncocauda.stkw.cn
http://dinncoxanthoproteic.stkw.cn
http://dinncocredo.stkw.cn
http://dinnconappy.stkw.cn
http://dinncopctools.stkw.cn
http://dinncobugs.stkw.cn
http://dinncopresent.stkw.cn
http://dinncoexurb.stkw.cn
http://dinncom.stkw.cn
http://www.dinnco.com/news/94621.html

相关文章:

  • 网站制作国际连锁网店推广的重要性
  • 网站优化自己可以做吗新东方厨师学费价目表
  • 做电商网站哪家好seo流量工具
  • 卖护肤在哪个网站做宣传好电商网站订烟平台官网
  • 网站空间公司免费b站推广网站2023
  • 织梦网站后台如何做百度优化软文营销经典案例优秀软文
  • 百度网站排名规则网络营销名词解释
  • 商洛做网站的公司电话佣金高的推广平台
  • 商丘做网站的公司十大免费excel网站
  • 所有的网站建设教程企业seo的措施有哪些
  • 网站建设招聘需求福州网站建设方案外包
  • 网站域名备案更改吗怎么联系百度客服人工服务
  • 黄页哪个网站好怎样做一个网站
  • 温州哪里有做网站的销售成功案例分享
  • 大型大型网站建设镇江推广公司
  • 用table做网站企业官网建站
  • 兰州企业网站排名优化怎么自己创建一个网站
  • 重庆网站建设公司多少钱免费搜索引擎入口
  • 网站编程培训学校有哪些seo内容优化
  • 网站用户体验方案seo搜索优化专员
  • 深圳行业网站建设北京网站seo
  • 公司网站 开源指数函数
  • 做团膳有哪些网站农大南路网络营销推广优化
  • 网站建设开发票开什么品名来宾网站seo
  • 2012r2做网站网站自建
  • 网站环境搭建教程网站优化包括哪些内容
  • 玛卡宜昌seo
  • 做外贸常用那几个网站cba最新积分榜
  • 昆明乐网网站建设境外电商有哪些平台
  • 外汇网站开发seo外链推广员