Elasticdump

หลังจากที่ Server ที่ใช้รัน ELK (Elasticsearch,Logstash,Kibana) ES เริ่มรับการ Query แบบซับซ้อนๆ หน่อยไม่ค่อยไหว ซึ่งถึงขั้น ES ดับกลางอากาศ ตัว Server ตัวนี้เดิมทีเค้าสร้างมารันแค่เว็บเบาๆ แต่เอามาใช้ผิดประเภทไปหน่อย

เลยมองหา Server ที่พาจะฝาก ES ไว้ได้ เมื่อได้แล้วก็ต้องมาดูว่าจะย้าย Index ไปยังไงดี ก็มีสองวิธีหลักๆ ที่พอรู้คือ

  1. เอา log มา index ใหม่
  2. Dump แล้วเอาไปยัดใหม่

คือไม่มีประสบการณ์ทั้งคู่เลยไม่รู้ว่าอันไหนจะใช้เวลาน้อยกว่ากัน เลยลองค้นหาข้อมูล ก็พบเครื่องมือตัวหนึ่งชื่อว่า elasticdump https://www.npmjs.com/package/elasticdump จริงๆ เคยเห็นตอนศึกษา ES ใหม่ๆ แต่ตอนนั้นยังไม่มีโจทย์ให้ทำเลยไม่ได้ลอง เลยเอามาลองสักหน่อย

หลักๆ ก็มีอยู่สามส่วนคือการ Dump Analyzer ,Mapping และ Data ของผมใช้วิธี up tempplate เข้า ES ตัวใหม่ไว้ก่อน แล้วก็ Dump Data มาใส่ได้เลย ซึ่งหลังจากทดลอง dump แบบ Server to Server แล้วพบว่ามันก็ไม่เลวเร็วกว่าตอนทำ index นะ

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade