https://www.cnblogs.com/zsl-find/articles/10730458.html

https://www.cnblogs.com/mylovelulu/p/10530002.html

https://www.cnblogs.com/lkun/p/7927308.html

https://www.cnblogs.com/elvi/p/8654021.html
https://www.cnblogs.com/kevingrace/p/5919021.html

https://blog.csdn.net/li123128/article/details/81052374

https://blog.csdn.net/qq_33406938/article/details/80307679清华源带安装

搭建elk 6.8.*版本方法  (一个安装方式,有时候文件的位置不同,所以,尽量按照这种方式安装)

一    elasticsearch

1.配置jdk环境,将selinux改为dis模式

2.配置yum源

导入GPG key
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch 检查机制

yum update curl#如果报错执行一下这个 刷新yum源

vim /etc/yum.repos.d/elasticsearch.repo
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

需要刷新yum源 , yum makecache

安装目录:  mkdir /usr/share/elasticsearch

yum install elasticsearch -y yum安装

3.配置文件的修改

配置自动启动
chkconfig --add elasticsearch
创建数据目录
/data/elasticsearch/lib
/data/elasticsearch/log
chmod 777 -R /data/elasticsearch

vim /etc/elasticsearch/elasticsearch.yml

path.data: /data/elasticsearch/lib #路径没有就去创建

path.logs: /data/elasticsearch/log

修改配置文件/etc/security/limits.conf  添加两行 (elk有效期为默认30天,加上可以是永久)
* soft nofile 65536
* hard nofile 65536

修改配置文件/etc/elasticsearch/jvm.options
-Xms8g
-Xmx8g #需要根据自己的配置修改,内存的大小

启动
service elasticsearch start

如果启动报错

tail -F /var/log/messages

which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)

解决办法:

vi /etc/sysconfig/elasticsearch

JAVA_HOME=/usr/local/jdk1.8.0_211

service elasticsearch restart

验证安装
curl -X GET "localhost:9200/"

端口配置
iptables -I INPUT -p tcp --dport 9200 -j ACCEPT #允许端口9200通过,若清空了防火墙,就无需配置
service iptables save
service iptables restart

二     Logstash

1. yum 源

导入GPG key
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

新建repo文件
vi /etc/yum.repos.d/logstash.repo

[logstash-6.x]
name=Elastic repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

2.安装
yum install logstash -y

配置

参考链接: https://www.cnblogs.com/jsonhc/p/7562412.html
3.测试 加启动 并且 需要持续的启动

/usr/share/logstash/bin/logstash -e 'input { stdin { } } output {stdout {} }'   #测试logstash

4.vi /root/file.conf   #创建日志收集规则

文件内容:

input {
file {
path => "/var/log/messages"
type => "system"
start_position => "beginning"
}
} output {
elasticsearch {
hosts => ["192.168.1.151:9200"]
index => "system-%{+YYYY.MM.dd}"
}
} 5.按照配置好的收集日志的规则去启动logstash

/usr/share/logstash/bin/logstash -f /root/file.conf

/usr/share/logstash/bin/logstash -f /root/file.conf & #后台登录

备注:

配置文件默认目录配置文件拷贝到这下面(/etc/logstash/conf.d/)执行 systemctl restart logstach 是不行的

只能指定文件启动

三. 安装 Kibana

参考链接: https://www.elastic.co/guide/en/kibana/current/rpm.html

导入GPG Key
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

1.新建repo文件: /etc/yum.repos.d/kibana.repo
[kibana-6.x]
name=Kibana repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

2安装
yum install kibana -y

3.配置

vi /etc/kibana/kibana.yml
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]
i18n.locale: "zh-CN" #最后一行汉化

4.启服务

/usr/share/kibana/bin/kibana

 systemctl restart kibana #持续开启服务

5.访问http://192.168.1.151:5601/

添加索引

elk基本配置的更多相关文章

  1. elk安装配置

    ELK介绍   官网https://www.elastic.co/cn/ 中文指南https://www.gitbook.com/book/chenryn/elk-stack-guide-cn/det ...

  2. ELK环境配置+log4j日志记录

    ELK环境配置+log4j日志记录 1. 背景介绍 在大数据时代,日志记录和管理变得尤为重要. 以往的文件记录日志的形式,既查询起来又不方便,又造成日志在服务器上分散存储,管理起来相当麻烦, 想根据一 ...

  3. ELK安装配置及nginx日志分析

    一.ELK简介1.组成ELK是Elasticsearch.Logstash.Kibana三个开源软件的组合.在实时数据检索和分析场合,三者通常是配合使用,而且又都先后归于 Elastic.co 公司名 ...

  4. ELK安装配置简单使用

    ELK是三款软件的总称,包括了elasticsearch.logstash.kibana,其实在生产使用中,我们还需要使用到其他的更多辅助软件来更好更合理的收集展示数据. Elasticsearch: ...

  5. ELK部署配置使用记录

    为什么要用ELK: 一般我们需要进行日志分析场景:直接在日志文件中 grep.awk 就可以获得自己想要的信息.但在规模较大的场景中,此方法效率低下,面临问题包括日志量太大如何归档.文本搜索太慢怎么办 ...

  6. ELK基础配置

    前言 近期在研究日志系统的设计,感觉现在公司的子系统和接口太多了,日志看不过来,就想着有没有一种方法可以把各个程序的日志组合到一起.于是乎就搜到了ELK.开始对ELK的概念完全搞不懂,就照着各个平台文 ...

  7. ELK环境配置

    一.安装java环境 1.下载jre并安装,安装过程中没有什么特殊的,一直默认下一步即可. 2.配置环境变量 其中变量值为我们安装的jre的路径 二.安装elasticsearch 1.下载es安装包 ...

  8. Linux下elk安装配置

    安装jdkJDK版本大于1.8 elk下载地址:https://www.elastic.co/products注意:elk三个版本都要保持一致. rpm -ivh elasticsearch-5.4. ...

  9. ELK简单配置

    input { file { path => ["/usr/local/kencery/tomcat/logs/catalina.out"] type => " ...

随机推荐

  1. UCS内存问题排查

    UCS使用双列直插式内存模块(Dual In-line Memory Module (DIMM) )作为RAM模块. 根据文档介绍,主要有如下部分:1.Memory placement <内存放 ...

  2. 【原】linux两台服务器之间免密登录方法

    搭建集群机器192.168.0.100和192.168.0.200里,需要两台机器中间相互拷贝文件: 方式一:下载192.168.0.100机器文件到本地,再将本地文件拷贝到B机器 方式二:192.1 ...

  3. Codeforces Round #566 (Div. 2)C(字符串,SET)

    #include<bits/stdc++.h>using namespace std;string s[100007];set<int>st[100007][7];int t[ ...

  4. 弱密码检测JR!

    1.JR(Joth the Ripper)简介·一款密码分析工具,支持字典式的暴力破解·通过对 shadow 文件的口令分析,可以检测密码·官方网站:http://www.openwall.com/j ...

  5. idea设置代码提示忽略大小写

  6. teraterm中状态框statusbox

    ;Author : Bing ;Date : 1/17/2019;Usage: modify log drictory according to actual drictorylogfile=&quo ...

  7. java获取指定月份有几个星期x,获取指定月份跨了多少个星期

    例如获取2020年5月一共有多少个星期二,一共跨了多少个星期 public class MainTest { public static void main(String[] args) throws ...

  8. STM32新MCU

    G0的出现完美的替换自家目前的F0系列而且有更好的性能和价格优势; STM32WL世界上首款LoRa Soc单片机嵌入了基于Semtech SX126x的经过特殊设计的无线电,该无线电提供两种功率输出 ...

  9. 嵌入式编程中使用 do{...} while(0) 的解释

    最近在看esp32的idf,有一些宏定义使用了do while(0)这种看起来好像没啥用的代码.然后我查了一下资料,发现在linux内核代码中经常用到这个东西! 现在就将这个东西整理一下. 为什么在内 ...

  10. 「CF1303C Perfect Keyboard」

    前置芝士 图的遍历:通过DFS或者BFS遍历全图. 前向星:用来存边,但是在本题用也可以用一个二维数组解决. 具体做法 先从判断YES和NO开始,可以发现如果一个字母与三个及以上不同的字母相邻时肯定是 ...