1 普通Linux安装
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.11.2-linux-x86_64.tar.gz
- 配置jdk环境变量(elasticsearch 解压后下面有jdk)
mkdir data
cd config/
- 修改elasticsearch.yml核心配置文件
vim elasticsearch.yml
cluster.name: elasticsearch
node.name: es-node0
path.data: /usr/local/elasticsearch-7.11.2/data
path.logs: /usr/local/elasticsearch-7.11.2/logs
http.port: 9200
network.host: 0.0.0.0
cluster.initial_master_nodes: ["es-node0"]
-Xms128m
-Xmx128m
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
vi /etc/sysctl.conf
vm.max_map_count = 262145
# 保存退出,刷新配置文件
sysctl -p
- ES启动不能以ROOT用户来进行,所以需要创建一个用户
- 关闭elasticsearch 可以直接Ctrl+C 因为目前是前台运行的。
- 让elasticsearch 后台运行
./elasticsearch -d
jps
kill '进程号'
ps -ef | grep elasticsearch