elasticsearch 搭建踩坑记录

elasticearch + kibana下载地址

https://www.elastic.co/start

启动不能使用root用户

创建用户之后,指定用户组和用户可访问elasticsearch包,使用特定用户启动就可以了

 启动命令

sh elasticsearch -d

启动后无法通过ip:9200访问

修改配置elasticsearch.yml配置

node.name: node-1
network.host: 192.168.148.129
http.port: 9200
discovery.seed_hosts: ["192.168.148.129"]

启动后报错

1、bootstrap check failure [1] of [3]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535] 

这个是说ElasticSearch进程的最大文件描述大小需要65535,而当前是4096,解决办法是修改 /etc/security/limits.conf 文件,在末尾加上(存在则修改,数值不能比要求的小):

    * soft nofile 65535
    * hard nofile 65535
    * soft nproc 65535
    * hard nproc 65535

2、bootstrap check failure [2] of [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

这是说最大虚拟内存太小(vm.max_map_count配置),至少需要262144,当前为65530,解决办法是修改 /etc/sysctl.conf 文件,在末尾加上(存在则修改,数值不能比要求的小):

vm.max_map_count=262144

“顺利”启动完成

访问9200

 通过插件_cat访问集群节点,多节点下可以查看互相发现的节点

原文地址:https://www.cnblogs.com/chentingk/p/15353569.html