下载 elasticsearch-6.8.0.tar.gz java
目标服务器 172.16.119.100node
上传目录:/home/hadoop/apps/,linux
解压:bootstrap
tar -zxf elasticsearch-6.8.0.tar.gz
重命名:vim
mv elasticsearch-6.8.0/ elasticsearch
建立elk用户,并将elasticsearch受权给elkbash
注意:因为elasticsearch启动的时候不能直接用root用户启动,因此须要建立普通用户服务器
[root@hadoop1 apps]# useradd elk [root@hadoop1 apps]# chown -R elk:elk elasticsearch
修改配置文件config/elasticsearch.ymlapp
network.host: 172.16.119.100
启动:bin/elasticsearchjvm
报错(一)elasticsearch
Error: Could not find or load main class org.elasticsearch.tools.java_version_checker.JavaVersionChecker
解决:因为个人安装文件是放在hadoop用户的目录下的,切换hadoop用户给权限再启动
报错(二)
ERROR: [4] 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 [hadoop] 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]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
缘由:es对启动内存是有要求的如今修改虚拟内存大小
修改操做系统的内核配置文件sysctl.conf
# vim /etc/sysctl.conf #在配置文件最后面添加以下内容 vm.max_map_count=262144
解释:max_map_count文件包含限制一个进程能够拥有的VMA(虚拟内存区域)的数量。虚拟内存区域是一个连续的虚拟地址空间区域。
在进程的生命周期中,每当程序尝试在内存中映射文件,连接到共享内存段,或者分配堆空间的时候,这些区域将被建立。
当进程达到了VMA上线但又只能释放少许的内存给其余的内核进程使用时,操做系统会抛出内存不足的错误。
#使修改以后的配置文件生效
[root@hadoop1 ~]# sysctl -p
修改limits.conf文件
#limits.conf:用来保护系统的资源访问,和sysctl.conf很像,可是limits.conf是针对于用户,而sysctl.conf是针对于操做系统. [root@hadoop1 ~]# vim /etc/security/limits.conf #在文件末尾添加以下内容: elk soft nofile 65536 elk hard nofile 131072 elk soft nproc 4096 elk hard nproc 4096
修改elasticsearch-node1节点的配置文件jvm.options
[root@hadoop1 ~]# cd /home/hadoop/apps/elasticsearch/config/ [root@hadoop1 config]# vim jvm.options
修改以下两个选项:
注意:若是内存足够大,能够不用修改,默认为1G
解决问题2
vi /etc/security/limits.d/90-nproc.conf
缘由:
这是在由于Centos6不支持SecComp,而ES5.2.0默认bootstrap.system_call_filter为true进行检测,因此致使检测失败,失败后直接致使ES不能启动。
vim elasticsearch.yml bootstrap.memory_lock: false bootstrap.system_call_filter: false
shutdown -r now
前台启动:
[hadoop@hadoop1 bin]$ ./elasticsearch
后台启动:
[hadoop@hadoop1 bin]$ ./elasticsearch -d