0

crate 版本:1.1.3 将数据插入 crate 后,我向 activemq 发送密钥以立即查询此数据,但不幸的是,每次都失败,所以我将线程休眠 2000ms,它工作了,所以我猜集群需要一些时间在这里同步数据是 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

这与多区域设置有关吗?或者我错过了一些设置?如何避免这种情况

谢谢

4

1 回答 1

1

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

于 2017-05-15T12:54:26.150 回答