关于elastic-stack:Elastic-Stack-搭建最新-ELK-日志分析系统-822版
前言大家好,我是无名小歌。明天给大家分享一个centos7零碎搭建2022年最新ELK日志剖析零碎,目前版本是8.2.2。值得注意的是装置 ELK 时,您必须在整个ELK中应用雷同的版本,如:Elasticsearch 8.2.2,则装置Kibana 8.2.2 和 Logstash 8.2.2,如果呈现不对应的状况,如:Elasticsearch 是8.2.2版本、Kibana-6.8等或是其余版本,则须要进行对应版本的降级到8.2.2版本。 就说这么多,上面正式开始吧!!! ELK日志剖析零碎(介绍)Elasticsearch:ELK中最外围的是E(elasticsearch),咱们能够从单词上了解翻译过去就是“弹性搜寻”。提供搜寻、剖析、存储数据三大性能,特点稳固,牢靠,疾速(弹性)。Logstash:一个具备实时流水线性能的开源数据收集引擎。Logstash 能够动静地对立来自不同起源的数据,并将数据规范化到您抉择的目的地。为各种高级上游剖析和可视化用例清理和遍及所有数据。简略了解的话就是用来收集日志log的。Kibana:ELK日志剖析零碎十分敌对的 Web 界面,能够帮忙咱们搜寻、察看、爱护数据、剖析数据、治理、监控和爱护 Elastic Stack( Elasticsearch、Kibana、Beats 和 Logstash等组合在一起的统称) 日志是非结构化的数据(数据量大,不易查问),这也是应用ELK的次要起因之一。 环境筹备本次教程采纳单节点形式 零碎内存IP网卡模式Linux12G192.168.200.4NAT举荐内存12G,以下ELK零碎占用内存为靠近8G,所以只有大于8G应该问题不大,但为了保障体验举荐10G、12G。 部署ELK Elasticsearch调整过程最大关上文件数数量cat >> /etc/security/limits.conf << EOFhard nofile 65535soft nofile 65535EOF调整过程最大虚拟内存区域数量cat >> /etc/sysctl.conf << EOFvm.max_map_count=262144EOFsysctl -p装置公共签名密钥 rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch配置 elasticsearch yum源 cat >> /etc/yum.repos.d/ELK.repo << EOF[elasticsearch]name=Elasticsearch repository for 8.x packagesbaseurl=https://artifacts.elastic.co/packages/8.x/yumgpgcheck=1gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearchenabled=0autorefresh=1type=rpm-mdEOF应用yum install命令装置,装置过程须要期待一段时间,因为下载的包有足足的502M(挺大的) 留神看装置实现后会呈现 Security autoconfiguration information 字段(平安主动配置信息)装置 Elasticsearch 时,默认启用并配置平安性能,会主动进行以下平安配置: 启用身份验证和受权,并为elastic内置超级用户生成明码。为传输层和 HTTP 层生成 TLS 的证书和密钥,并应用这些密钥和证书启用和配置 TLS。过程中如果呈现下载中断,继续执行下列命令即可直至实现。$ yum install --enablerepo=elasticsearch elasticsearch -y......--------------------------- Security autoconfiguration information ------------------------------Authentication and authorization are enabled.TLS for the transport and HTTP layers is enabled and configured.#弹性内置超级用户生成的明码为:se_pNHcZwLawBfF7pxUsThe generated password for the elastic built-in superuser is : se_pNHcZwLawBfF7pxUs#如果此节点应退出现有群集,则能够应用下列命令If this node should join an existing cluster, you can reconfigure this with'/usr/share/elasticsearch/bin/elasticsearch-reconfigure-node --enrollment-token <token-here>'after creating an enrollment token on your existing cluster.You can complete the following actions at any time:#重置弹性内置超级用户的明码Reset the password of the elastic built-in superuser with'/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic'.#应用为Kibana实例生成注册令牌Generate an enrollment token for Kibana instances with '/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana'.#应用为Elasticsearch节点生成注册令牌Generate an enrollment token for Elasticsearch nodes with'/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node'.-------------------------------------------------------------------------------------------------### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd#自启动命令 sudo systemctl daemon-reload sudo systemctl enable elasticsearch.service### You can start elasticsearch service by executing#启动命令 sudo systemctl start elasticsearch.service启动Elasticsearch ...