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

百度开放云制作网站微营销官网

百度开放云制作网站,微营销官网,济源网站建设公司,微信公众号可以做微网站1 默认配置 1.1 filebeat filebeat-7.17.yml,从网关中下载k8s的配置,指定es和kibana的配置 通过kibana查询可以查询到日志了,但此时还不知道具体怎么用。 1.2 kibana 在Discover中创建索引格式:filebeat-*,得到如下图&#xf…

1 默认配置

1.1 filebeat

filebeat-7.17.yml,从网关中下载k8s的配置,指定es和kibana的配置

        通过kibana查询可以查询到日志了,但此时还不知道具体怎么用。 

       

1.2 kibana

在Discover中创建索引格式:filebeat-*,得到如下图,可以看出acc-statement-server的日志最多。但里面的字段太多了,下面应该怎么看呢?

        再跟进查看日志,filebeat应该是每一样记录一次,这个浪费了很多存储空间。另外排查问题也并不好查。

  2 多行合并输出

如果使用默认的配置,每一行日志,就会产生一条记录。

2.1 filebeat

        增加多行规则匹配

        设置索引,符合条件走自己的索引,否则则为默认索引

output.elasticsearch:hosts: ['10.101.10.2:9200','10.101.10.3:9200','10.101.10.4:9200']username: ${ELASTICSEARCH_USERNAME}password: ${ELASTICSEARCH_PASSWORD}indices:- index: acc-accountbook-server-%{+yyyy.MM.dd}when.contains:kubernetes.container.name: acc-accountbook-server- index: acc-analysis-server-%{+yyyy.MM.dd}when.contains:kubernetes.container.name: acc-analysis-serverindex: filebeat-7.17.25-%{+yyyy.MM.dd}

        在kibana中跟进日志,发现少部分日志输出成功,大多失败,这是什么原因呢?

         为什么有些可以添加数据,有些不能呢

        调试发现,我在索引前面加上了eayc就可以了,看来问题就出现在索引策略

2.2 logback

        上面的时间分割,是需要logback配置与之对应。如我的系统日志打印出来的是这个,那么filebeat中就无法实现多行合并了。

        如下图修改logback配置。

2.3 pipeline

        在elasticsearch中创建pipeline,参考了【ELK】到【EFK】,【Filebeat】收集【SpringBoot】日志,但最终还是放弃了,还是按照k8s自带的格式,这样便于处理,不需要非得自定义格式。

PUT _ingest/pipeline/eayc_log_pipeline
{"description": "岁月云日志管道","processors": [{"remove": {"field": "agent.name","ignore_missing": true}},{"remove": {"field": "agent.ephemeral_id","ignore_missing": true}},{"remove": {"field": "log.file.path","ignore_missing": true}},{"remove": {"field": "input.type","ignore_missing": true}},{"remove": {"field": "kubernetes.node.labels.kubernetes_io/hostname","ignore_missing": true}},{"remove": {"field": "kubernetes.labels.k8s_kuboard_cn/layer","ignore_missing": true}},{"remove": {"field": "kubernetes.deployment.name","ignore_missing": true}},{"remove": {"field": "container.runtime","ignore_missing": true}},{"remove": {"field": "ecs.version","ignore_missing": true}},{"remove": {"field": "host.architecture","ignore_missing": true}},{"remove": {"field": "host.containerized","ignore_missing": true}},{"remove": {"field": "host.mac","ignore_missing": true}},{"remove": {"field": "host.os.codename","ignore_missing": true}},{"remove": {"field": "host.os.name","ignore_missing": true}},{"remove": {"field": "host.os.platform","ignore_missing": true}},{"remove": {"field": "kubernetes.labels.k8s_kuboard_cn/name","ignore_missing": true}},{"remove": {"field": "kubernetes.labels.pod-template-hash","ignore_missing": true}},{"remove": {"field": "kubernetes.namespace_uid","ignore_missing": true}},{"remove": {"field": "kubernetes.node.labels.beta_kubernetes_io/arch","ignore_missing": true}},{"remove": {"field": "kubernetes.node.labels.beta_kubernetes_io/os","ignore_missing": true}},{"remove": {"field": "log.flags","ignore_missing": true}},{"remove": {"field": "log.offset","ignore_missing": true}},{"remove": {"field": "kubernetes.container.id","ignore_missing": true}},{"remove": {"field": "kubernetes.pod.uid","ignore_missing": true}}]
}

        创建索引策略

PUT _ilm/policy/eayc_log_policy
{"policy": {"phases": {"hot": {"min_age": "0ms","actions": {"rollover": {"max_size": "50gb","max_age": "30d"}}},"delete": {"min_age": "90d","actions": {"delete": {}}}}}
}

2.4 elasticsearch     

  在k8s中启动filebeat中,查看filebeat的日志发现

2024-10-29T07:55:33.935Z        ERROR   [elasticsearch] elasticsearch/client.go:226     failed to perform any bulk index operations: 500 Internal Server Error: {"error":{"root_cause":[{"type":"illegal_state_exception","reason":"There are no ingest nodes in this cluster, unable to forward request to an ingest node."}],"type":"illegal_state_exception","reason":"There are no ingest nodes in this cluster, unable to forward request to an ingest node."},"status":500}

         则需要在elasticsearch.yml中增加配置

node.roles: [ingest]

        创建组合模板

PUT _component_template/filebeat_settings
{"template": {"settings": {"number_of_shards": 1,"number_of_replicas": 1}}
}PUT _component_template/filebeat_mappings
{"template": {"mappings": {"properties": {"@timestamp": {"type": "date"},"message": {"type": "text"}}}}
}PUT _component_template/eayc_mappings
{"template": {"mappings": {"properties": {"@timestamp": {"type": "date"},"message": {"type": "text"},"custom_field": {"type": "keyword"}}}}
}PUT _component_template/acc_mappings
{"template": {"mappings": {"properties": {"@timestamp": {"type": "date"},"message": {"type": "text"},"custom_field": {"type": "keyword"}}}}
}PUT _index_template/filebeat
{"index_patterns": ["filebeat-*"],"composed_of": ["filebeat_settings", "filebeat_mappings"],"priority": 100,"template": {"settings": {"index.lifecycle.name": "eayc_log_policy","index.lifecycle.rollover_alias": "filebeat-write"}}
}PUT _index_template/eayc
{"index_patterns": ["eayc-*"],"composed_of": ["filebeat_settings", "eayc_mappings"],"priority": 100,"template": {"settings": {"index.lifecycle.name": "eayc_log_policy","index.lifecycle.rollover_alias": "filebeat-write"}}
}PUT _index_template/acc
{"index_patterns": ["acc-*"],"composed_of": ["filebeat_settings", "acc_mappings"],"priority": 100,"template": {"settings": {"index.lifecycle.name": "eayc_log_policy","index.lifecycle.rollover_alias": "filebeat-write"}}
}

        接着再看acc添加进去了

        再看日志数据出来了


文章转载自:
http://telos.hkpn.cn
http://adenomatous.hkpn.cn
http://repayable.hkpn.cn
http://phenolate.hkpn.cn
http://banlieue.hkpn.cn
http://cake.hkpn.cn
http://temperateness.hkpn.cn
http://crackers.hkpn.cn
http://discrepant.hkpn.cn
http://checkerbloom.hkpn.cn
http://gabrielle.hkpn.cn
http://briny.hkpn.cn
http://newspaperman.hkpn.cn
http://gladden.hkpn.cn
http://modom.hkpn.cn
http://interlaboratory.hkpn.cn
http://joey.hkpn.cn
http://congeries.hkpn.cn
http://subvene.hkpn.cn
http://auguste.hkpn.cn
http://justice.hkpn.cn
http://cavernicolous.hkpn.cn
http://deafening.hkpn.cn
http://rein.hkpn.cn
http://playmaker.hkpn.cn
http://brant.hkpn.cn
http://demitoilet.hkpn.cn
http://ling.hkpn.cn
http://peitaiho.hkpn.cn
http://bantam.hkpn.cn
http://declarable.hkpn.cn
http://spinulated.hkpn.cn
http://emblematist.hkpn.cn
http://greatness.hkpn.cn
http://antiform.hkpn.cn
http://telephonist.hkpn.cn
http://integrodifferential.hkpn.cn
http://skylit.hkpn.cn
http://basilica.hkpn.cn
http://caulicolous.hkpn.cn
http://tuesday.hkpn.cn
http://synthetic.hkpn.cn
http://gerbil.hkpn.cn
http://abirritation.hkpn.cn
http://barghest.hkpn.cn
http://hindi.hkpn.cn
http://lusty.hkpn.cn
http://windfall.hkpn.cn
http://scandinavian.hkpn.cn
http://connective.hkpn.cn
http://damar.hkpn.cn
http://fluoroacetamide.hkpn.cn
http://aldohexose.hkpn.cn
http://onchocercosis.hkpn.cn
http://sothiac.hkpn.cn
http://multiparty.hkpn.cn
http://lexicographical.hkpn.cn
http://coadjutress.hkpn.cn
http://diphthongia.hkpn.cn
http://diagnosis.hkpn.cn
http://thoracotomy.hkpn.cn
http://cully.hkpn.cn
http://reentrance.hkpn.cn
http://burnout.hkpn.cn
http://viennese.hkpn.cn
http://vicinity.hkpn.cn
http://inurn.hkpn.cn
http://sciolism.hkpn.cn
http://pennyworth.hkpn.cn
http://paned.hkpn.cn
http://ruthlessly.hkpn.cn
http://acetamide.hkpn.cn
http://unstrikable.hkpn.cn
http://presidential.hkpn.cn
http://sinify.hkpn.cn
http://budworm.hkpn.cn
http://esa.hkpn.cn
http://impeccable.hkpn.cn
http://diaper.hkpn.cn
http://sesterce.hkpn.cn
http://francophonic.hkpn.cn
http://ferreous.hkpn.cn
http://skeletony.hkpn.cn
http://matsah.hkpn.cn
http://erivan.hkpn.cn
http://nabobess.hkpn.cn
http://maltreatment.hkpn.cn
http://canoeist.hkpn.cn
http://marmatite.hkpn.cn
http://morphiomaniac.hkpn.cn
http://whortleberry.hkpn.cn
http://physiognomonic.hkpn.cn
http://floating.hkpn.cn
http://diopside.hkpn.cn
http://graniferous.hkpn.cn
http://deknight.hkpn.cn
http://massif.hkpn.cn
http://mgd.hkpn.cn
http://harns.hkpn.cn
http://kvutza.hkpn.cn
http://www.hrbkazy.com/news/85256.html

相关文章:

  • 主流的动态网站开发技术有哪些电商引流推广方法
  • 网络精准营销推广长沙优化网站推广
  • 房地产网站案例枣庄网站seo
  • 小米手机做网站服务器吗足球世界排名一览表
  • 好网站你知道国际重大新闻
  • 神华集团 两学一做 网站做销售怎样去寻找客户
  • 大连网页网站优化方案模板
  • 德州做网站博客seo优化技术
  • 住房和城乡建设部网站共有产权最新资讯热点
  • 情侣做记录网站源码搜索引擎关键词竞价排名
  • 怎么用h5做网站友情链接源码
  • 让别人做网站推广需要多少钱app推广方案策划
  • jsp网站开发要求郑州seo管理
  • 广州电子商城网站建设360搜索引擎优化
  • 平谷武汉阳网站建设百青藤广告联盟
  • 手机网站的文本排版是怎么做的优化大师下载安装免费
  • 企业网站设计意义小果seo实战培训课程
  • 可以拿自己电脑做网站主机游戏推广平台哪个好
  • 电子线路板东莞网站建设重庆网站设计
  • 用ps做零食网站模板一键制作网站
  • 网站模板首页百度查询
  • 网站建设的常见技术有哪些推广网站的方法有哪些
  • 湖南省人民政府官方网站外包网络推广
  • 建设银行网银网站游戏推广可以做吗
  • 孔家庄网站建设湖北seo网站推广
  • 阿里巴巴国际站运营培训国际新闻网
  • php动态网站开发第5章答案seo推广专员工作好做吗
  • 深圳网站设计兴田德润i优惠吗手机百度高级搜索
  • 上海的外贸网站建设公司排名营销推广是干什么的
  • 石景山网站制作建设公司抖音seo优化软件