ELK框架的搭建基于ubuntu14.04

来源:互联网 发布:私奔 郑钧 知乎 编辑:程序博客网 时间:2024/06/07 23:21

elasticsearch的安装

elasticsearch需要java 8的支持,应先安装jdk1.8

1.下载并安装.tar.gz

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.2.tar.gz

tar -xzf elasticsearch-5.3.2.tar.gz

cd elasticsearch-5.3.2

2.运行elasticsearch

在elasticsearch文件夹根目录下

./bin/elasticsearch

elasticsearch的安装过程还是很简单的,一下列出一些常见的问题与解决方法


[WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]

org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

elasticsearch不允许使用root启动,su到普通用户即可


main ERROR Could not register mbeans java.security.AccessControlException: access denied

因为elasticsearch需要读写配置文件,应给予elasticsearch文件夹权限

su

chmod -R 777 elasticsearch-5.3.2


正常运行elasticsearch后,在浏览器地址栏输入localhost:9200即可查看状态,可是此时通过外网 并不能访问

修改config/elasticsearch.yml配置

network.host:0.0.0.0

即可成功通过外网访问


ERROR: bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

ERROR: bootstrap checks failed elastic_1 | max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

以上两个问题总会一起出现

1.通过root用户修改配置文件sysctl.conf

vim /etc/sysctl.conf

添加配置  vm.max_map_count=655360

执行命令 sysctl -p

2.添加文件

vim /etc/security/limits.d/90-nproc.conf

添加配置 

* hard nproc 64000

* soft nproc 64000

3.修改配置文件 /etc/security/limits.conf

* soft nofile 65536

* hard nofile 65536

* soft nproc 2048

* hard nproc 2048

即可解决





0 0