CentOS6.5安裝ElasticSearch6.2.3

CentOS6.5安裝ElasticSearch6.2.3


1、Elastic 須要 Java 8 環境。(安裝步驟:http://www.cnblogs.com/hunttown/p/5450463.htmlhtml

2、安裝包下載:java

#官網地址bootstrap

https://www.elastic.co/downloads/elasticsearchvim

3、新建用戶centos

       Elastic高版本不建議使用root用戶瀏覽器

(1)建立elastic用戶組elasticsearch

[root@mycentos ~]# groupadd elastic

(2)建立用戶elasticpost

useradd elastic(用戶名) -g elastic(組名) -p 123456(密碼)url

[root@mycentos ~]# useradd elastic -g elastic -p 123456

4、解壓安裝包spa

       建議將安裝包放到/usr/local目錄下   .放到新建用戶目錄下,要不報錯    錯誤: 找不到或沒法加載主類 org.elasticsearch.tools.java_version_checker.JavaVersionChecker

[root@mycentos local]# unzip elasticsearch-6.2.3.zip
tar zxvf xxx.gz

5、添加權限

chown -R elastic elasticsearch-6.2.3

6、修改配置文件

(1)ERROR: bootstrap checks failed

        memory locking requested for elasticsearch process but memory is not locked

緣由:鎖定內存失敗

解決方案:使用root用戶,編輯limits.conf配置文件, 添加以下內容:

[root@mycentos ~]# vim /etc/security/limits.conf

* soft memlock unlimited
* hard memlock unlimited

備註:* 表明Linux全部用戶名稱,保存、退出、從新登陸生效。

(2)ERROR: bootstrap checks failed

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

緣由:沒法建立本地文件問題,用戶最大可建立文件數過小。

解決方案:使用root用戶,編輯limits.conf配置文件, 添加以下內容:

[root@mycentos ~]# vim /etc/security/limits.conf

* soft nofile 65536    #軟件
* hard nofile 131072   #硬件

(3)max number of threads [1024] for user [es] is too low, increase to at least [2048]

緣由:沒法建立本地線程問題,用戶最大可建立線程數過小

解決方案:使用root用戶,進入limits.d目錄下,修改90-nproc.conf 配置文件。

[root@mycentos ~]# vim /etc/security/limits.d/90-nproc.conf

soft nproc 1024
#修改成:
soft nproc 4096

(4)max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

緣由:最大虛擬內存過小

解決方案:使用root用戶下,修改配置文件sysctl.conf

[root@mycentos ~]# vim /etc/sysctl.conf

添加下面配置:

vm.max_map_count=655360

並執行命令生效:

sysctl -p

(5)system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

緣由:由於Centos6不支持SecComp

解決方法:在elasticsearch.yml中配置bootstrap.system_call_filter爲false,注意要在Memory下面:

[root@mycentos config]# vim elasticsearch.yml

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

(6)配置host

[root@mycentos config]# vim elasticsearch.yml

network.host: 0.0.0.0 #全部用戶均可以訪問
http.port: 9200

 

7、切換用戶

[root@mycentos local]# su elastic

8、啓動es     

 [elastic@mycentos elasticsearch-6.2.3]$ bin/elasticsearch

        後臺啓動:

[elastic@mycentos elasticsearch-6.2.3]$ bin/elasticsearch -d
或
[elastic@mycentos elasticsearch-6.2.3]$ bin/elasticsearch &

9、瀏覽器訪問

或者:

安裝完畢!

聲明:本文僅爲做者我的筆記,請勿轉載!
相關文章
相關標籤/搜索