- 下载
# 注意下载版本
cd /usr/local/src
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.tar.gz
2、安装
cd /usr/local/src
tar -xvf elasticsearch-5.4.0.tar.gz
- 添加es用户
useradd es
添加es用户密码
passwd es
将文件夹elasticsearch-5.4.2赋予es权限
chown -R es:es /usr/local/src/elasticsearch-5.4.0
切换为es用户
su es
3、设置elasticsearch.yml
vi config/elasticsearch.yml
加入内容:
cluster.name: elasticsearch
node.name: node-1
network.host: 0.0.0.0
http.port: 9200
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
cluster.initial_master_nodes: ["node-1"]
4、启动
bin/elasticsearch -d
- 异常1
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /usr/local/src/elasticsearch-7.8.1/logs/elasticsearch.log
解决:
sudo vim /etc/sysctl.conf
#添加参数
...
vm.max_map_count = 262144
重新加载/etc/sysctl.conf配置
sysctl -p