略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