zoukankan      html  css  js  c++  java
  • docker日志

    Docker日志:                            //文件系统只允许日志文件最大4G

    Docker logs                   stdout > >>       stderr 2> 2>>    stdin<

    docker attach 51760fc15338  //监听容器日志

    docker run -itd -d -p 80:80 httpd

    docker logs -f a319ffb5fd27  >> /var/log/ct1web.log   //查看的容器并重定向到log下

    curl 192.168.43.71:80     //重启打开一个终端

    cat /var/log/ct1web。Log     //查看一下

                                                                                               

    ELK  --开源日志管理方案

    E:Elastiocsearch:全文搜索引擎   //收集巨额日志

    L:Logstash:读取原始日志并对其进行分析和过滤,然后转发给其他组件

    K:kibana:一个基于javascript的web界面(图形化界面)。

               Dashboard:kibana需要他来完成

    运行顺序  L-E-k

    内存4G 硬盘40

    yum localinstall filebeat-6.3.1-x86_64.rpm   //localinstall:安装本地的rpm包

    修改sysctl.conf  添加一条 vm.max_map_count=655360

    docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -e ES_MIN_MWM=128 -e ES_MAX_MEM=1024m -it --name elk1 sebp/elk     //5601:kibana端口 9200:Elastiocasearch端口  -e 闲置空间大小

    不动了以后就是安装好了 因为没有加-d 所以最好不要推出

    http://192.168.43.192:5601

    http://192.168.43.192:9200/_search?pretty             //访问这三个页面

    http://192.168.43.192:9200/      

    vim /etc/filebeat/filebeat.Yuml

    修改enabled:true

    注释paths:下的两个路径

    添加我们自己的要监控的日志路径 - /var/lib/docker/containers/*/*。Log

    -      /var/log/messages

    Service restart filed

    可以省略这个步骤:注释掉下面host5400端口   //想连接谁就注释掉另外一个

    然后启动几个容器       

    刷新:

    http://192.168.43.192:9200/_search?pretty   会看到日志

    http://192.168.43.192:5601

          //图形化界面点这个

     filebeat-*                 //然后点击方框输入这个

    @timestamp                //类型选择它

    Fluented

    Graylog

  • 相关阅读:
    异常
    JAVA Math类
    Spring Cloud微服务Sentinel+Apollo限流、熔断实战总结
    JAVA之JDBC数据库连接池总结篇
    利用Python-docx 读写 Word 文档中的正文、表格、段落、字体等
    python3 最基本且简单的实现组合设计模式
    原生工程接入Flutter实现混编
    a[i][j] 和 a[j][i] 有什么区别?
    iconv函数报错 Detected an illegal character in input string
    用Python把20年的GDP、人口以及房价数据进行了可视化
  • 原文地址:https://www.cnblogs.com/guarderming/p/9455888.html
Copyright © 2011-2022 走看看