略java
groupadd bigdata
useradd es passwd es
usermod -G bigdata es
找到root ALL=(ALL) ALL一行,添加es用户,以下。bootstrap
## Allow root to run any commands anywhere root ALL=(ALL) ALL es ALL=(ALL) ALL
su es
官网: https://www.elastic.co/produc...
下载:浏览器
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.2.tar.gz
解压:elasticsearch
tar -zxf elasticsearch-6.4.2.tar.gz
vi config/elasticsearch.yml
修改host和portide
# ---------------------------------- Network ----------------------------------- # # Set the bind address to a specific IP (IPv4 or IPv6): # network.host: 192.168.70.4 # # Set a custom port for HTTP: # http.port: 9200
添加spa
vm.max_map_count=262144
使用修改生效code
sysctl -p
添加如下内容server
* hard nofile 65536 * soft nofile 65536 * soft nproc 2048 * hard nproc 4096
直接启动ip
bin/elasticsearch 中止 ctrl+c
后台启动ci
bin/elasticsearch -d
jps 61562 Jps 61503 Elasticsearch
浏览器 :http://hserver3:9200/
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file logs/gc.log due to Permission denied Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.AccessDeniedException: /home/es/elasticsearch-6.4.2/config/elasticsearch.keystore Likely root cause: java.nio.file.AccessDeniedException: /home/es/elasticsearch-6.4.2/config/elasticsearch.keystore
解决方法:
由于第一次启动不当心用了root启动,致使用root生成了对应的文件。切换es帐号以后,没有对应文件的权限致使,删除相关的东西便可。
ERROR: [2] bootstrap checks failed [1]: max number of threads [1024] for user [es] is too low, increase to at least [4096] [2]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
解决:
ulimit -a max user processes (-u) 1024 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
vi /etc/security/limits.d/90-nproc.conf # Default limit for number of user's processes to prevent # accidental fork bombs. # See rhbz #432903 for reasoning. * hard nproc 4096 * soft nproc 4096 * soft nproc 4096 root soft nproc unlimited
缘由:
这是在由于Centos6不支持SecComp,而ES5.2.0默认bootstrap.system_call_filter为true进行检测,因此致使检测失败,失败后直接致使ES不能启动。
解决:
在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面: bootstrap.memory_lock: false bootstrap.system_call_filter: false