Part1:安装单机/集群版ES
-
环境 | 版本 |
---|
Redhat/Centos | 7.0 | Elasticsearch | 7.13.2 | Kibana | 7.13.2 | jdk | 11 |
- 下载
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.2-linux-x86_64.tar.gz
tar -xzvf elasticsearch-7.13.2-linux-x86_64.tar.gz
cd elasticsearch-7.13.2/config
vim elasticsearch.yml
cluster.name: my-application
node.name: node-1
network.host: 0.0.0.0
discovery.seed_hosts: ["192.168.137.127:9300", "192.168.137.128:9300", "192.168.137.129:9300"]
cluster.initial_master_nodes: ["node-1"]
http.cors.enabled: true
http.cors.allow-origin: "*"
启动es报错:
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
vim /etc/sysctl.conf
vm.max_map_count=262144
sysctl -w vm.max_map_count=262144
sysctl -a | grep vm.max_map_count
机器内存不够,启动es报错:
Exception in thread "main" java.nio.file.AccessDeniedException: /opt/soft/elasticsearch-7.13.2/config/jvm.options
vim config/jvm.options
-Xms512m
-Xmx512m
启动es报错:
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [1786] for user [lck] is too low, increase to at least [4096]
vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096
ulimit -Hn
ulimit -Sn
如果是复制的文件夹创建的集群记得把data目录删除,该目录记录了es实例的唯一标识信息,该标识集群中不能重复
bin/elasticsearch
bin/elasticsearch -d
http://192.168.137.127:9200/
http://192.168.137.127:9200/_cat/health?v
|