首页 > 编程知识 正文

elk使用教程,docker部署elk

时间:2023-05-03 05:04:19 阅读:12702 作者:3457

ELK是ElasticSearch LogStash Kibana。 公司使用ELK进行日志收集的可视化。 我觉得ELK是一个非常有用的工具。 为了了解ELK的原理并熟悉ELK的操作,我自己准备在测试服务器上部署ELK系统

1. LogStash它可以流到每个服务器上收集Log日志,通过内置的ElasticSearch插件分析后输出到ES。 2.ElasticSearch这是一个基于Lucene的分布式全文搜索框架,可以分布式存储logs。 就像hdfs 3. Kibana的所有日志都送到ElasticSearch后,都需要给他看一样,对吧? 这时,Kibana出手了。 可以多维地展示es的数据。 这还解决了mysql存储难以可视化的问题。 一、ELK软件下载1进入官网https://www.elastic.co/cn/products /,下载linux版本安装包2并在tar -txvf上解压缩。 解压缩后的文件如下。

二、电子搜索安装其实也是ELK的核心,启动时要注意。 es无法启动根帐户,需要打开El搜索帐户

1首先使用mv从根目录2移动elasticsearch文件夹,然后使用elsearch帐户groupadd elsearch #新建elsearch组useradd elsearch -g elsearch -p密码创建新的elsearch用户chown-relsearch : elsearch./elastic search (这里是您的目录) # elasticsearch所属的El search组,然后单击, 报告1: org.elastic search.bootstrap.startup exception : Java.lang.illegalstateeexception 33660错误的tried [/opt/] maybetheselocationsarenotwritableormultiplenodeswerestartedwithoutincreasing [ node.max _ local _ storage _ nodes ] (错误

错误原因:以前运行的es可能未成功关闭

解决方法:

第一步:使用命令: ps aux | grep elasticsearch显示的第二步:命令: kill -9进程号关闭此进程。 步骤3 :重新启动es。 /长情寒风/elasticsearch错误2:maxfiledescriptors [ 4096 ] forelasticsearchprocessistoolow,increase to at least [65536]错误说明

错误原因:当前配置的硬件和软件限制较小

解决方法:

将以下代码添加到vim /etc/security/limits.conf,然后再次登录到elsearch用户: 不需要重新启动。 * soft nofile 65536 * hard nofile 131072 * soft nproc 2048 * hard nproc 4096三、logstash安装1进入logstash文件夹、config文件夹2、vim LLE 包含input、fillter和output三个模块的input { file { path=[ '/data/log/flask _ API/nginx.log ' ] codec=JSON type=% { int : score : int } } if [ type ]==' internal _ log ' { grok { match={ ' message '=' % { timestamp _ ist amp 3 } % { log level 3360 level }-% { greedy data 3360 msg }-% { greedy data 3360 locate } } mutate { remove _ field=[ ' messate }==' nginx ' { elastic search } hosts=[ ' host 133609200 ', ' host 233609200 ' ] index=' flask _ API _ nginx ' } if [ type ]==' internal _ log ' { elastic search { hosts=' hosts config.reload.automatic在更改配置后为33555

./log stash-f ./config/log stash.conf-- config.reload.automatic4psaux|greplogstash

查看当前用户下的Main进程,那是logstash进程,掉kill就可以了。 如果有多个,请仔细检查,安全kill为四,kibana安装1位于config文件夹中,vim kibana.yml可以更改配置。 默认参数为elastic search.hosts : [“http://localhost :9200”],可以自行修改2进入长情寒风文件夹,关闭./kibana开始3kibana 以下代码netstat -apn|grep 5601kill -9 .错误1成功启动,但无法访问网站,修改kibana.yml文件,修改主机,将localhost更改为本地实际ip,然后单击

无需重启

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。