因為線上系統報錯:
[Java] 01/12/11 11:13:36 WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1297, SQLState: HY000
[Java] 01/12/11 11:13:36 ERROR org.hibernate.util.JDBCExceptionReporter - Got temporary error 291 'Out of scanfrag records in TC (increase MaxNoOfLocalScans)' from NDBCLUSTER
於是修改集群配置:
[ndbd]
MaxNoOfLocalScans=1000
如:
[ndbd]
id=2
hostname=192.168.110.9 # Hostname or IP address
datadir=/usr/local/mysql/MySQL-cluster # Directory for this data node's data files
TransactionDeadlockDetectionTimeout=10000
HeartbeatIntervalDbDb=3000
HeartbeatIntervalDbApi=3000
MaxNoOfLocalScans=1000
[ndbd]
id=3
hostname=192.168.110.10 # Hostname or IP address
datadir=/usr/local/mysql/MySQL-cluster # Directory for this data node's data files
TransactionDeadlockDetectionTimeout=10000
HeartbeatIntervalDbDb=3000
HeartbeatIntervalDbApi=3000
MaxNoOfLocalScans=1000
在集群裡,如果查詢可以在不同的節點上進行並行掃描,這樣的效果是比較理想的。在非並行掃描情形下,就會產生很多的本地掃描。所以,設置這個參數對本地掃描有很大的好處。先加上,看看效果,再對這個值進行調整。
虛擬機測試通過。