2017-05-15 31 views
0

crate版本:1.1.3 插入数据后,我发送一个密钥到activemq立即查询这个数据,但不幸的是,它每次都失败,所以我睡了2000ms的线程,它的工作,所以我想集群需要一些时间来这里同步数据 是crate.yaml:如何避免数据查询laterncy在板条箱中

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 

是这涉及到多区设置?或者我想念一些设置? 如何避免这种

感谢

+0

这是一个3节点的集群,我想它与 – MayI

回答

1

由于箱子是最终一致,并非所有插入的文件立即可用于查询。新/更改文档的可用性取决于不同的影响,最重要的是配置的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,如果插入不是经常发生(例如,在插入完成后刷新,在发出下一个语句之前),这是推荐的方法。

+0

区域无关,请注意,通过那里主键访问单个记录将立即生效。 “写后写一致性” –