如何避免 crate 中的数据查询延迟
how to avoid data query laterncy in crate
板条箱版本:1.1.3
将数据插入 crate 后,我向 activemq 发送一个密钥以立即查询此数据,但不幸的是,每次都失败,所以我让线程休眠 2000 毫秒,它起作用了,所以我猜集群需要一些时间来同步数据
这是 crate.yaml:
psql.enabled: true
psql.port: 33892
prepareThreshold: 0
http.max_content_length: 150mb
indices.store.throttle.max_bytes_per_sec: 150mb
threadpool.bulk.type: fixed
threadpool.bulk.size: 128
threadpool.bulk.queue_size: 5000
cluster.name: EIn_Cluster
node.name: dscn1
index.number_of_replicas: 2
path.conf: /home/hadmin/crate/config
path.data: /home/hadmin/data/crate
path.work: /home/hadmin/data/crate/tmp
path.logs: /home/hadmin/data/crate/logs
path.plugins: /home/hadmin/crate/plugins
blobs.path: /home/hadmin/data/crate/crate_blob_data/disk
network.host: 192.168.13.50
gateway.recover_after_nodes: 3
discovery.zen.minimum_master_nodes: 3
gateway.expected_nodes: 3
discovery.zen.ping.timeout: 10s
discovery.zen.fd.ping_interval: 10s
#transport.tcp.port: 4399
discovery.zen.ping.unicast.hosts:
- dscn1:4300
- dscn2:4300
- dscn3:4300
这与多区域设置有关吗?或者我错过了一些设置?
如何避免这种情况
谢谢
由于 crate 是最终一致的,因此并非所有插入的文档都可以立即用于查询。 new/changed 文档的可用性取决于不同的影响,最重要的是配置的 refresh_interval
(参见 https://crate.io/docs/reference/sql/reference/create_table.html#sql-ref-refresh-interval)。
但请注意,降低此值会导致摄取性能降低。
您还可以使用 refresh table
命令强制刷新,参见 https://crate.io/docs/reference/sql/refresh.html,如果插入不是经常发生,这是推荐的方法(例如,插入完成后刷新,在发出下一条语句)。
板条箱版本:1.1.3 将数据插入 crate 后,我向 activemq 发送一个密钥以立即查询此数据,但不幸的是,每次都失败,所以我让线程休眠 2000 毫秒,它起作用了,所以我猜集群需要一些时间来同步数据 这是 crate.yaml:
psql.enabled: true
psql.port: 33892
prepareThreshold: 0
http.max_content_length: 150mb
indices.store.throttle.max_bytes_per_sec: 150mb
threadpool.bulk.type: fixed
threadpool.bulk.size: 128
threadpool.bulk.queue_size: 5000
cluster.name: EIn_Cluster
node.name: dscn1
index.number_of_replicas: 2
path.conf: /home/hadmin/crate/config
path.data: /home/hadmin/data/crate
path.work: /home/hadmin/data/crate/tmp
path.logs: /home/hadmin/data/crate/logs
path.plugins: /home/hadmin/crate/plugins
blobs.path: /home/hadmin/data/crate/crate_blob_data/disk
network.host: 192.168.13.50
gateway.recover_after_nodes: 3
discovery.zen.minimum_master_nodes: 3
gateway.expected_nodes: 3
discovery.zen.ping.timeout: 10s
discovery.zen.fd.ping_interval: 10s
#transport.tcp.port: 4399
discovery.zen.ping.unicast.hosts:
- dscn1:4300
- dscn2:4300
- dscn3:4300
这与多区域设置有关吗?或者我错过了一些设置? 如何避免这种情况
谢谢
由于 crate 是最终一致的,因此并非所有插入的文档都可以立即用于查询。 new/changed 文档的可用性取决于不同的影响,最重要的是配置的 refresh_interval
(参见 https://crate.io/docs/reference/sql/reference/create_table.html#sql-ref-refresh-interval)。
但请注意,降低此值会导致摄取性能降低。
您还可以使用 refresh table
命令强制刷新,参见 https://crate.io/docs/reference/sql/refresh.html,如果插入不是经常发生,这是推荐的方法(例如,插入完成后刷新,在发出下一条语句)。