Elastic Stack安装

为君一笑 提交于 2019-12-01 18:40:58

环境:

OS: Centos 7.6

JDK: 1.8.0_91

下载地址:

https://artifacts.elastic.co/downloads/beats/heartbeat/heartbeat-7.4.2-linux-x86_64.tar.gz
https://artifacts.elastic.co/downloads/beats/packetbeat/packetbeat-7.4.2-linux-x86_64.tar.gz
https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.4.2-linux-x86_64.tar.gz
https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.4.2-linux-x86_64.tar.gz
https://artifacts.elastic.co/downloads/logstash/logstash-7.4.2.tar.gz
https://artifacts.elastic.co/downloads/kibana/kibana-7.4.2-linux-x86_64.tar.gz
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.2-linux-x86_64.tar.gz

安装ElasticSearch

cd /data/apps/es
#上传elasticsearch-7.4.2-linux-x86_64.tar.gz到此目录

tar -xzvf elasticsearch-7.4.2-linux-x86_64.tar.gz
cd elasticsearch-7.4.2/

#创建用户jerval
adduser jerval
passwd jerval

#授权文件夹
chown -R jerval /data

#创建ElasticSearch工作文件夹
mkdir -p /data/apps/es/data
mkdir -p /data/logs/es

su jerval

vim elasticsearch.yml
#修改:
path.data: /data/apps/es/data
path.logs: /data/logs/es
network.host: 0.0.0.0

#错误处理:
#[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
su root
vim /etc/security/limits.conf

#在文件最后,增加如下配置:
jerval    hard     nofile     65536 
jerval    soft     nofile     65536
*         soft     nproc      4096
*         hard     nproc      4096

#[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
su root
vim /etc/sysctl.conf
#在/etc/sysctl.conf文件最后添加一行
vm.max_map_count=655360

#添加完毕之后,执行命令:
sysctl -p

[3]: 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
vim config/elasticsearch.yml
在#node.name: node-1下面添加一行:
node.name: node-1

#在#cluster.initial_master_nodes: ["node-1", "node-2"]下面添加一行:
cluster.initial_master_nodes: ["node-1"]

#启动ES
./bin/elasticsearch

浏览器访问: http://192.168.31.119:9200/
或者 curl http://192.168.31.119:9200, 如果出现下面信息则启动成功。

{
  "name" : "node-1",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "RklnWm34TAOA9iqSO2ZvNQ",
  "version" : {
    "number" : "7.4.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "2f90bbf7b93631e52bafb59b3b049cb44ec25e96",
    "build_date" : "2019-10-28T20:40:44.881551Z",
    "build_snapshot" : false,
    "lucene_version" : "8.2.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

 

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!