中央Scribe服務器故障情況下,從屬Scribe服務器會本地緩存日誌,待
中央Scibe服務器恢復後再傳送日誌。
測試過程如下:
1:首先啓動中央Scribe服務器
./bin/scribed examples/example2central.conf
2:使用從屬Scribe服務器記錄日誌信息
echo "test message 1 " | ./bin/scribe_cat -h localhost:1464 test3
3:確定這個日誌寫入正常
cat /tmp/scribetest1/test3/test3_current
4:停止中央Scribe服務器實例
./scribe_ctrl stop 1463
5:查看中央服務器的狀態,因爲已經停止了,隨意會返回失敗信息
./scribe_ctrl status 1463
6:再次寫入日誌
echo "test message 2 " | ./bin/scribe_cat -h localhost:1464 test3
#這條日誌信息會被緩存起來,直到中央服務器恢復後,發送到中央服務器
7:查看從屬Scribe服務器狀態信息,會報出警告信息。
./scribe_ctrl status 1464
8:再次寫入日誌
echo "test message 3 " | ./bin/scribe_cat -h localhost:1464 test3
同樣會本地緩存
9:重新啓動Scribe中央服務器
./bin/scribed examples/example2central.conf
10: 觀察實例狀態,一直等待到都顯示爲ALIVE
./scribe_ctrl status 1463
./scribe_ctrl status 1464
11: 確定3條信息都被接收到了
cat /tmp/scribetest1/test3/test3_current
12: 關閉
./scribe_ctrl stop 1463
./scribe_ctrl stop 1464