1. 程式人生 > >CentOS6.5安裝ElasticSearch6.2.3 CentOS6.5安裝ElasticSearch6.2.3

CentOS6.5安裝ElasticSearch6.2.3 CentOS6.5安裝ElasticSearch6.2.3

CentOS6.5安裝ElasticSearch6.2.3


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

2、安裝包下載:

#官網地址

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

3、新建使用者

       Elastic高版本不建議使用root使用者

(1)建立elastic使用者組

[[email protected]
~]# groupadd elastic

(2)建立使用者elastic

useradd elastic(使用者名稱) -g elastic(組名) -p 123456(密碼)

[[email protected] ~]# useradd elastic -g elastic -p 123456

4、解壓安裝包

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

[[email protected] 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配置檔案, 新增如下內容:

[[email protected] ~]# 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配置檔案, 新增如下內容:

[[email protected] ~]# 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 配置檔案。

[[email protected] ~]# 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

[[email protected] ~]# 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下面:

[[email protected] config]# vim elasticsearch.yml

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

(6)配置host

[[email protected] config]# vim elasticsearch.yml

network.host: 0.0.0.0 #所有使用者都可以訪問
http.port: 9200

 

7、切換使用者

[[email protected] local]# su elastic

8、啟動es     

 [[email protected] elasticsearch-6.2.3]$ bin/elasticsearch

        後臺啟動:

[[email protected] elasticsearch-6.2.3]$ bin/elasticsearch -d
或
[[email protected] elasticsearch-6.2.3]$ bin/elasticsearch &

9、瀏覽器訪問

或者:

安裝完畢!

宣告:本文僅為作者個人筆記,請勿轉載!

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

2、安裝包下載:

#官網地址

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

3、新建使用者

       Elastic高版本不建議使用root使用者

(1)建立elastic使用者組

[[email protected] ~]# groupadd elastic

(2)建立使用者elastic

useradd elastic(使用者名稱) -g elastic(組名) -p 123456(密碼)

[[email protected] ~]# useradd elastic -g elastic -p 123456

4、解壓安裝包

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

[[email protected] 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配置檔案, 新增如下內容:

[[email protected] ~]# 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配置檔案, 新增如下內容:

[[email protected] ~]# 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 配置檔案。

[[email protected] ~]# 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

[[email protected] ~]# 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下面:

[[email protected] config]# vim elasticsearch.yml

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

(6)配置host

[[email protected] config]# vim elasticsearch.yml

network.host: 0.0.0.0 #所有使用者都可以訪問
http.port: 9200

 

7、切換使用者

[[email protected] local]# su elastic

8、啟動es     

 [[email protected] elasticsearch-6.2.3]$ bin/elasticsearch

        後臺啟動:

[[email protected] elasticsearch-6.2.3]$ bin/elasticsearch -d
或
[[email protected] elasticsearch-6.2.3]$ bin/elasticsearch &

9、瀏覽器訪問

或者:

安裝完畢!