2013-07-26 125 views
5

如何獲取文件的elasticsearch索引,然後將該數據插入另一個羣集? 我想將數據從一個羣集移動到另一個羣集,但我無法直接連接它們。elasticsearch - 如何將數據複製到另一個羣集

+0

這兩個集羣上的elasticsearch版本是否相同? – javanna

+0

是的,我用0.90.2 – voyagersm

+0

酷,那佈局怎麼樣:有多少個節點?兩個集羣上的節點數量相同? – javanna

回答

1

有腳本可以幫助您將索引從一個集羣備份到另一個集羣。我沒有測試過,但可能會解決你的需求。 檢查此Backup and restore an Elastic search index

而且您還可以使用perl腳本將索引從一個集羣複製到另一個集羣(或同一個集羣)。

檢查此鏈接clintongormley/ElasticSearch.pm

+0

鏈接已死亡。請更新鏈接或刪除答案。 – colidyre

+0

@colidyre檢查這個鏈接,但它的舊,我認爲他們強烈建議使用官方的python api。 https://github.com/eriky/ESClient。檢查這也是我的分支版本有副本腳本https://github.com/kirubar/ESClient – kiruba

2

如果你沒有必要繼續_id相同,唯一重要的一點是_source你可以使用logstash與配置:

input { //from one cluster } output { //to another cluster } 

這裏是詳細信息:http://www.logstash.net/docs/1.4.2/

是的,它的方法很奇怪,但我嘗試過在集羣索引之間通過索引進行即時數據傳輸,並且它是一種魅力(當然,如果您不需要保留由elasticsearch生成的_id)

相關問題