Written by
in
ต่อจาก Cassandra #01 เริ่มต้นใช้งาน
ความสามารถที่สำคัญของ Cassandra คือสามารถทำการ Scale Out หรือขยายความสามารถของระบบได้โดยการเพิ่มเครื่องคอมพิวเตอร์ในระดับ Commodity Hardware [1] เข้าไปใน Cluster
ในบทความนี้ จะแสดงวิธีการสร้าง Cassandra Cluster ที่ประกอบไปด้วย 3 Node ชื่อ cassandra01, cassandra02 และ cassandra03 โดยมีชื่อ Cluster ว่า PSUCluster และกำหนดให้ cassandra01 เป็น Seed Node (ทำหน้าที่เป็นผู้ประสานงานสำหรับ Node ใหม่ๆเข้าร่วม Cluster)
# กำหนดชื่อ Cluster ที่ต้องการ cluster_name: 'PSUCluster' # กำหนด Seed Node ซึ่งมีไว้ให้ node ใหม่ประกาศตัวเองเพื่อเข้าร่วม Cluster # ควรมีไม่เกิน 3 Node ต่อ Data Center # ในที่นี้ กำหนดไว้เพียงตัวเดียว seed_provider: parameters: - seeds: "192.168.107.111" # กำหนด listen_address เป็นค่าว่าง listen_address: # กำหนด endpoint_snitch เป็น GossipingPropertyFileSnitch # เพื่อให้สามารถมี Cluster แบบข้าง Data Center ได้ endpoint_snitch: GossipingPropertyFileSnitch
sudo rm -rf /var/lib/cassandra/data/system/*
sudo rm /etc/cassandra/cassandra-topology.properties
sudo service cassandra restart
วิธีดูสถานะของระบบ
sudo watch nodetool status
ในตอนแรกจะเป็นแบบนี้
เมื่อ cassandra02 เข้ามา
และเมื่อครบ 3 Node
วิธี Debug ว่าเกิดอะไรขึ้น
sudo tail -f /var/log/cassandra/debug.log
[1] http://docs.datastax.com/en/landing_page/doc/landing_page/planning/planningHardware.html
[2] http://docs.datastax.com/en/cassandra/3.0/cassandra/architecture/archIntro.html
[3] https://docs.datastax.com/en/cassandra/3.0/cassandra/initialize/initSingleDS.html
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Δ
Leave a Reply