elasticsearch5.x在linux上分布式安裝(多節點)__linux

來源:互聯網
上載者:User

一.首先去elastic官網下載(http://www.elastic.co/downloads/elasticsearch)對應版本的elasticsearch,選擇tar包下載


二.將下載的elasticsearch-5.5.0.tar.gz檔案分成兩份拷貝到不同節點的伺服器上,解壓。

三.修改elasticsearch設定檔

1.例如我這邊的兩個台節點伺服器ip分別是"10.224.2.15"和"10.224.2.25"

2.分別修改兩個elasticsearch檔案下/config下的elasticsearch.yml設定檔

3.在10.224.2.15下配置如下:

cluster.name: elasticsearch node.name: es-node1path.data: /opt/elasticsearch-path/datapath.logs: /opt/elasticsearch-path/lognetwork.host: 10.224.2.15http.port: 9200node.master: truenode.data: truehttp.enabled: truehttp.cors.enabled: truehttp.cors.allow-origin: "*"discovery.zen.ping.unicast.hosts: ["10.224.2.15","10.224.2.25"]discovery.zen.minimum_master_nodes: 1

在10.224.2.25下配置如下:

cluster.name: elasticsearchnode.name: es-node2path.data: /export/es/datapath.logs: /export/es/logsnetwork.host: 10.224.2.25http.port: 9200node.master: falsenode.data: truehttp.enabled: truehttp.cors.enabled: truehttp.cors.allow-origin: "*"discovery.zen.ping.unicast.hosts: ["10.224.2.15","10.224.2.25"]discovery.zen.minimum_master_nodes: 1

cluster.name:cluster.name為叢集的名稱,多個節點的cluster.name名稱必須是一樣。

node.name:node-name為節點名稱,不同節點取不同名稱。

path.data:資料檔案位置。

path.logs:記錄檔位置。3

network.host:當前節點ip地址。

http.port:elasticsearch服務連接埠 預設填9200。

discovery.zen.ping.unicast.hosts:所有節點的ip地址,這裡我裝到兩個節點上,所以我填了2個節點的ip,有3個就3個節點ip。


四.啟動

進入到bin目錄,執行命令./elasticsearch -d  

(-d表示在後台啟動)

六.報錯:
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解決辦法: 
1、在root使用者修改配置sysctl.conf
vi /etc/sysctl.conf 
添加下面配置:
vm.max_map_count=655360
並執行命令:
sysctl -p
然後,重新啟動elasticsearch,即可啟動成功。

報錯:
[2]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
原因:
這是在因為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

[3]:Elasticsearch requires at least Java 8 but your Java version from /root/jdk1.7.0_79/bin/java does not meet this requirement

如果你的系統裝的是jdk1.8的,java -vesion 出來的也是1.8的,那麼執行一下source /etc/profile 這個命令再重新啟動就可以了。

成功啟動訪問頁面:


運行命令ps -ef|grep elasticsearch,看服務啟動沒有。








相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.