- 一、ELK简介
- 二、ElasticSearch安装
- 1、准备环境
- 2、安装
ELK是三个开源软件的缩写,分别表示:
- Elasticsearch
- Logstash
- Kibana
另外新增了一个FileBeat,它是一个轻量级的日志收集处理工具(Agent),适合于在各个服务器上搜集日志后传输给Logstash。
官网下载地址:https://www.elastic.co/cn/downloads/elasticsearch
百度百科上的简介:
- CentOS8
- jdk8
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.16.2-linux-x86_64.tar.gz tar -xvf elasticsearch-7.16.2-linux-x86_64.tar.gz cd elasticsearch-7.16.2 # 修改配置文件 vim config/elasticsearch.yml # 根据需求看是否需要修改绑定端口 #network.host: 192.168.0.1 network.host: 0.0.0.0 # 运行命令启动,如果后台运行则加上 & ./bin/elasticsearch
我这里启动时很不幸地碰到了几个问题:
ERROR: [2] bootstrap checks failed. You must address the points described in the following [2] lines before starting Elasticsearch. bootstrap check failure [1] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] bootstrap check failure [2] of [2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
进行如下修改:
# max virutal memory areas vm.max_map_count [65530] is too low vim /etc/sysctl.conf # 存在则如下修改,不存在则在最后新增 vm.max_map_count=262144 # 使生效 sysctl -p
# the default discovery settings are unsuitable for production use vim config/elasticsearch.yml # 进行如下修改设置 discovery.seed_hosts:集群节点列表,每个值应采用host:port或host的形式(其中port默认为设置transport.profiles.default.port,如果未设置则返回transport.port) discovery.seed_providers:集群节点列表的提供者,作用就是获取discovery.seed_hosts,比如使用文件指定节点列表 cluster.initial_master_nodes:初始化时master节点的选举列表,一般使用node.name(节点名称)配置指定,配置旨在第一次启动有效,启动之后会保存,下次启动会读取保存的数据
# exception during geoip databases update # 禁用geoip数据库
再次启动程序。启动后可以访问:
http://ip:9200/
看到有输出内容:
{
"name" : "node-name",
"cluster_name" : "cluster-name",
"cluster_uuid" : "你的集群uuid",
"version" : {
"number" : "7.16.2",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "2b937c44140b6559905130a8650c64dbd0879cfb",
"build_date" : "2021-12-18T19:42:46.604893745Z",
"build_snapshot" : false,
"lucene_version" : "8.10.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}



