1.下载Elasticsearch7
直接去官网下载.可慢了.下载了一个小时才下完.
2.下载完了解压压缩包
tar -zxvf xxxx
3.移动目录
mv elasticsearch-7.2.0 /usr/local/
3.新建一个用户,es不让你用root.
useradd es
passwd es
chown -R es elasticsearch-7.2.0
4.修改配置文件
vim config/elasticsearch.yml
#修改为自己的ip
network.host: x.x.x.x
#把这个注释先放开
cluster.initial_master_nodes: ["node-1", "node-2"]
5.启动
./elasticsearch
6.错误解决,如果出现以下错误.
[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
vim /etc/security/limits.conf
* soft nofile 65536 * hard nofile 65536
* soft nproc 4096 * hard nproc 4096
vi /etc/sysctl.conf
vm.max_map_count=262144
sysctl -p
至此可以启动了.