curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.1-linux-x86_64.tar.gz
tar -xzvf elasticsearch-7.5.1-linux-x86_64.tar.gz
cd elasticsearch-7.5.1
./bin/elasticsearch
启动报错异常
ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[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
[2019-12-31T10:28:14,537][INFO ][o.e.n.Node ] [hadoop001] stopping ...
[2019-12-31T10:28:14,552][INFO ][o.e.n.Node ] [hadoop001] stopped
[2019-12-31T10:28:14,553][INFO ][o.e.n.Node ] [hadoop001] closing ...
[2019-12-31T10:28:14,569][INFO ][o.e.n.Node ] [hadoop001] closed
配置文件的修改
[hadoop@hadoop001 config]$ pwd
/home/hadoop/app/elasticsearch/config
[hadoop@hadoop001 config]$ vi elasticsearch.yml
# 设置为0.0.0.0可以让任何计算机节点访问
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
## 如下配置是为了解决 Elasticsearch可视化工具 跨域问题
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers: Authorization, X-Requested-With,Content-Length,Content-Type
# 集群个数
cluster.initial_master_nodes: ["node-1"]
# 切换用户 root 修改文件数 以及虚拟内存大小
[root@hadoop001 ~]# cd /etc/security/
[root@hadoop001 security]# vi limits.conf
<domain> <type> <item> <value>
* soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65000
[root@hadoop001 etc]# vi sysctl.conf
vm.max_map_count=655360
#载入配置 生效
sysctl -p