ลด 50% ทุกแพ็กเกจ เวลาจำกัด เริ่มต้นที่ $2.48/mo
Elasticsearch

Elasticsearch

Elasticsearch คือ distributed search and analytics engine ที่รองรับการค้นหาแบบ full-text, aggregations และ real-time indexing บนข้อมูลระดับ petabyte ใช้งานจริงที่ Wikipedia, GitHub, eBay และ Slack สำหรับ site search และ log analytics ถือเป็นมาตรฐานสำหรับ full-text search นอกเหนือจากฐานข้อมูล

เวอร์ชัน

ล่าสุด

ระบบปฏิบัติการ

Ubuntu Server 24.04 LTS เซิร์ฟเวอร์

ขั้นต่ำของ RAM

8 GB

ประเภท IP

IPV4,IPV6

เข้าถึง Elasticsearch API

  • URL: http://<server-ip>:9200
  • การสื่อสารภายใน cluster: 127.0.0.1:9300 (ห้ามเปิดเผยต่อภายนอก)

ข้อมูลประจำตัว

  • ผู้ใช้: elastic
  • รหัสผ่าน: จัดเก็บอย่างปลอดภัยใน /root/.cloudzy-creds

ไดเร็กทอรี่ที่สำคัญ

  • การกำหนดค่า: /etc/elasticsearch
  • ข้อมูล: /var/lib/elasticsearch
  • บันทึก: /var/log/elasticsearch
  • ไฟล์ไบนารี่: /usr/share/elasticsearch/bin
  • ปลั๊กอิน: /usr/share/elasticsearch/plugins

การจัดการ Service

ใช้ systemctl คำสั่ง

systemctl status elasticsearch
systemctl restart elasticsearch
systemctl stop elasticsearch
systemctl start elasticsearch

การเพิ่ม Kibana เข้า cluster (ไม่บังคับ)

หากต้องการติดตั้ง Kibana แยกต่างหาก ให้สร้าง enrollment token บน Elasticsearch ก่อน แล้วนำไปใช้ตั้งค่า Kibana อย่างปลอดภัย

1. สร้าง enrollment token บนเซิร์ฟเวอร์ Elasticsearch:

/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana

2. คัดลอก token ที่ได้ แล้วรันคำสั่งต่อไปนี้บนเซิร์ฟเวอร์ Kibana:

/usr/share/kibana/bin/kibana-setup --enrollment-token "<your-token>"

เป็นการเพิ่ม Kibana เข้ากับ Elasticsearch อย่างปลอดภัย

ตัวอย่างคำสั่ง Elasticsearch

ตรวจสอบสถานะ cluster:

curl -X GET -k "https://localhost:9200/_cluster/health?pretty" 
  -u elastic:<password> 
  --cacert /etc/elasticsearch/certs/http_ca.crt

แสดงรายการ index ทั้งหมด:

curl -X GET -k "https://localhost:9200/_cat/indices?v" 
  -u elastic:<password> 
  --cacert /etc/elasticsearch/certs/http_ca.crt

เพิ่มเติมในการติดตามระบบ

แอปพลิเคชันที่เกี่ยวข้อง

ติดตั้ง Elasticsearch เดี๋ยวนี้ เริ่มต้นที่ $2.48/เดือน