程序異常如下: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
