Hi ae. AE đã từng sử dụng zookeeper có thể chia sẻ cùng em những ứng dụng thực tế của nó trong các hệ thống backend với ạ. Khi sử dụng zookeeper thì sẽ thường sử dụng với những component nào nữa và tại sao ạ?
Cảm ơn anh em.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Zookeeper bản chất là 1 dịch vụ socket (realtime) để lưu trữ trạng thái, nó có thể thông báo cho em biết khi có trạng thái thay đổi. Ví dụ em có thể lưu trữ:
Khi server1 bị tắt thì nó sẽ thông báo cho server 2 là:
2. Chính vì có cơ chế này nên zookeeper mới được kafka sử dụng để quản lý trạng thái của các node và làm HA.
3. Bên anh cũng đang dùng zookeeper để quán lý các node và làm HA (xác định node master). Ví dụ trong case ở trên, server2 nhận được thông báo, và nó thấy nó là người đầu tiên trong danh sách các node còn active, vậy nó tự hiệu nó là node master. Các node khác thì không thấy mình nằm ở đầu danh sách nên tự hiểu mình là node stand by.