節前將oracle數據遷移到cassandra後,查詢表的總記錄數(千萬級以上),總會報超時錯誤,找了下相關資料,須要更改配置文件裏的相關超時參數。node
cqlsh:spacewalk> select count(*) from rhnpackagecapability; ReadTimeout: Error from server: code=1200 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 1 responses." info={'received_responses': 1, 'required_responses': 1, 'consistency': 'ONE'} cqlsh:spacewalk> exit
遇到此報錯,只需增長如下幾個參數的值:oracle
[root@db03 ~]# vi /etc/cassandra/default.conf/cassandra.yaml read_request_timeout_in_ms: 600000 range_request_timeout_in_ms: 600000 slow_query_log_timeout_in_ms: 600000 [root@db03 ~]# systemctl restart cassandra
修改完成後,重啓cassandra服務。再次查詢,結果以下圖:
ide
系統默認的客戶端請求時間是10秒,若是遇到此報錯,需增長客戶端請求超時。以下:優化
[root@db03 ~]# vi .cassandra/cqlshrc ... [connection] request_timeout = 600 ....
後續遇到相似錯誤還會繼續更新此博文。ui