Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Elasticdump migrates elasticsearch data

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Elasticdump migrates elasticsearch data

Elasticdump github address

Https://github.com/taskrabbit/elasticsearch-dump

After tossing about for a while, nodejs lost all patience and decisively used the docker method.

1. Download docker image

Pull the image

Docker pull taskrabbit/elasticsearch-dump2, export data

If you export the data as a file, you need to mount the host directory to the container.

# create a data directory in advance. Mkdir / data

Export the data to the json file, mount the host / data directory to the container / tmp directory, and export the specified file-- output to the / tmp directory.

Docker run-- net=host-- rm-ti-v / data:/tmp taskrabbit/elasticsearch-dump\-- input= http://localhost:9200/info-ad\-- output=/tmp/info-ad-map.json\-- type=data# export log Wed, 11 Dec 2019 09:45:35 GMT | starting dumpWed, 11 Dec 2019 09:45:35 GMT | got 16 objects from source elasticsearch (offset: 0) Wed, 11 Dec 2019 09:45:35 GMT | sent 16 objects to destination file, wrote 16Wed 11 Dec 2019 09:45:35 GMT | got 0 objects from source elasticsearch (offset: 16) Wed, 11 Dec 2019 09:45:35 GMT | Total Writes: 16Wed, 11 Dec 2019 09:45:35 GMT | dump complete# export file [root@localhost / data] # lltotal 20 RW Murray 1 root root 18192 Dec 11 17:45 info-ad-map.json3, import data docker run-- net=host-- rm-ti-v / data:/tmp taskrabbit/elasticsearch-dump\-- input=/tmp/info-ad-map.json\-- output= http://localhost:9200/abcd# Import log Wed, 11 Dec 2019 09:47:43 GMT | starting dumpWed, 11 Dec 2019 09:47:43 GMT | got 16 objects from source file (offset: 0) Wed 11 Dec 2019 09:47:44 GMT | sent 16 objects to destination elasticsearch, wrote 16Wed, 11 Dec 2019 09:47:44 GMT | got 0 objects from source file (offset: 16) Wed, 11 Dec 2019 09:47:44 GMT | Total Writes: 16Wed, 11 Dec 2019 09:47:44 GMT | dump complete

Ps: you need to use-- net=host to mount the network to the container when using localhost:9200

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report