1,官网下载:
https://www.elastic.co/cn/downloads/
2,修改配置文件elasticsearch.yml
cluster.name: shuolid.elk #集群名称,如果有多个集群,那么每个集群名就得是唯一的
node.name: node-1 #节点名称
node.master: true #该节点是否是master,true表示是的,false表示否,默认是true
node.data: true #该节点是否存储数据,默认true表示是的
http.port: 9200 #http访问端口,默认是9200,通过这个端口,调用方可以索引查询请求
transport.tcp.port: 9300 #节点之间通信的端口,默认为9300
network.host: 0.0.0.0 #访问地址 配置外网访问
xpack.security.enabled: false
cluster.initial_master_nodes: ["node-1"]
ingest.geoip.downloader.enabled: false
3,./bin/elasticsearch -d (后台启动)
4,报错总结
报错1:bootstrap check failure [1] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决:在 /etc/sysctl.conf 追加最大虚拟空间限制 vm.max_map_count=655360 ,记得 sysctl -p 使系统配置生效。提示无权限时,使用sudo vi和wq! 保存
报错2: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
解决:elasticsearch.yml增加配置cluster.initial_master_nodes: ["node-1"]
报错3:[node-1] exception during geoip databases update
解决:elasticsearch.yml增加配置 ingest.geoip.downloader.enabled: false