ElasticSearch下载
https://www.elastic.co/cn/downloads/elasticsearch
Kibana下载地址
https://www.elastic.co/downloads/kibana
Elasticsearch与Kibana的版本需要一致
1、创建用户:elasticsearch
[root@iZbp1bb2egi7w0ueys548pZ bin]# adduser elasticsearch
2、创建用户密码,需要输入两次
[root@iZbp1bb2egi7w0ueys548pZ bin]# passwd elasticsearch
3、将对应的文件夹权限赋给该用户
[root@iZbp1bb2egi7w0ueys548pZ local]# chown -R elasticsearch elasticsearch-6.0.0
4、切换至elasticsearch用户
[root@iZbp1bb2egi7w0ueys548pZ etc]# su elasticsearch
5、进入启动目录启动 /usr/local/elasticsearch-6.0.0/bin 使用后台启动方式:./elasticsearch -d
[elasticsearch@vmt10003 bin]$ ./elasticsearch -d
遇见问题
1.启动后访问ip:9200没有显示json,Failed connect to 10.132.131.51:9200; Connection refused 解决:
修改config/elasticsearch.yml文件,添加
network.host: 0.0.0.0
2.ERROR: [5] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max number of threads [1024] for user [es] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[4]: failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[5]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts
切换root用户
vi /etc/security/limits.conf
在倒数第二行添加
* soft nofile 65536
* hard nofile 65536
vi /etc/sysctl.conf 添加
vm.max_map_count=655360
保存后执行
sysctl -p
vi /etc/security/limits.d/90-nproc.conf(不同机器可能数字不同)
修改为
* soft nproc 4096
修改elasticsearch.yml取消注释保留一个节点,master应该是主机名,有就修改没有就添加
cluster.initial_master_nodes: ["master"]
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
启动,访问http://master:9200