centos7安装elasticsearch
-
去官网https://www.elastic.co/cn/downloads/past-releases下载对应的安装包包 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.3.tar.gz -
解压 tar -zxvf elasticsearch-6.4.3.tar.gz -
修改配置文件,默认不支持远程连接 cluster.name: es6
node.name: node0
path.data: /usr/local/elasticsearch-6.4.3/data
path.logs: /usr/local/elasticsearch-6.4.3/logs
network.host: 0.0.0.0
-
ElasticSearch 可以接收脚本执行,默认不支持root用户启动
- 添加专门用户
useradd elastic - 修改解压后elasticsearch文件夹所属用户
chown -R elastic:elastic elasticsearch-6.4.3 - 切换用户
su elsearch 后台启动./elasticsearch -d -
启动后会占用两个端口
- 9200 是ES节点与外部通讯使用的端口, 是http协议的RESTful接口.
- 9300 是ES节点之间通讯使用的端口, 是tcp通讯端口,集群间和TCPclient都走的9300。(java程序中使用ES时,在配置文件中要配置该端口)
中文分词
图形化界面 kibana
问题及处理
-
线程数不够
-
错误日志 ERROR: [2] bootstrap checks failed
[1]: max number of threads [3000] for user [elastic] is too low, increase to at least [4096]
-
vi /etc/security/limits.conf * soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65536
-
max_map_count too low
- 错误日志
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
vi /etc/sysctl.conf vm.max_map_count = 655360
|