安装步骤
1.创建用户
[root@localhost bin]# groupadd es
[root@localhost bin]# useradd es -g es
[root@localhost bin]# mkdir -p /usr/local/elasticsearch-7.0.0/
[root@localhost bin]# chown -R es:es /usr/local/elasticsearch-7.0.0/
2.解压缩,启动命令./bin/elasticsearch,后台启动./bin/elasticsearch -d
3.修改conf文件
#cluster.name: my-application 解开屏蔽
#node.name: node-1 解开屏蔽
#network.host: 192.168.0.1 修改:network.host: 0.0.0.0
#http.port: 9200 解开屏蔽
#cluster.initial_master_nodes: ["node-1", "node-2"] 修改:cluster.initial_master_nodes: ["node-1"]
4.访问测试:http://192.168.5.226:9200/
问题1
1.[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
vi /etc/security/limits.conf
[root@localhost pub]# ulimit -Hn
4096
[root@localhost pub]# ulimit -Sn
1024
* soft nofile 65536
* hard nofile 65536
重新登录
2.[2]: max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
vm.max_map_count:限制一个进程可以拥有的VMA(虚拟内存区域)的数量
vi /etc/sysctl.conf
vm.max_map_count=655360
重新登录
3.[1]: 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
cluster.initial_master_nodes: ["node-1"] 替换为对应的node名称