ショコラ
ElasticSearch で他のサーバーにコピーする
elasticdumpをインストールする!
もっさん先輩
① elasticdumpコマンド をインストールする。
apt install -y npm
npm install -g elasticdump② コピー先ホストではインデックスを作成しておく
curl -X PUT "http://localhost:9200/category"③ データをエクスポートする
elasticdump --type=data --input=http://localhost:9200/category --output=./category-data.json④ データをエクスポートする
elasticdump --type=data --input=./category-data.json --output=http://localhost:9200/category⑤ マップをエクスポートする
elasticdump --type=mapping --input=http://localhost:9200/category --output=./category-map.json⑥ マップをエクスポートする
elasticdump --type=mapping --input=./category-map.json --output=http://localhost:9200/categoryなのですが、以下のようにダイレクトにエクスポートとインポートができます。これはめちゃくちゃ便利です。
elasticdump --type=data --input=http://localhost:9200/category --output=http://192.168.40.155:9200/category以上