cassandra大表讀寫timeout的配置解決
阿新 • • 發佈:2017-11-14
edge tex san 原因 nbsp cal repl clas 響應
程序異常如下:Caused by: com.datastax.driver.core.exceptions.WriteTimeoutException: Cassandra timeout during write query at consistency LOCAL_ONE (1 replica were required but only 0 acknowledged the write)
原因很顯然是coordinator,就是node沒有及時響應寫完成
解決方法無外乎,減少數據量,提高超時時間
在cassandra.yaml裏
# How long the coordinator should wait for writes to complete write_request_timeout_in_ms: 2000 # How long the coordinator should wait for counter writes to complete counter_write_request_timeout_in_ms: 5000
將這2項都調大,默認是2s和5s
調整後,重啟節點生效
ps auwx | grep cassandra sudo kill pid bin/cassandra
cassandra大表讀寫timeout的配置解決