同花顺面试(部分)

又没录上,只能凭零星记忆来记录了

  • 知识图谱有了解吗,知道用在你们系统哪个环节吗
  • tomcat内存设置的多大。32位系统的话有限制吗?复盘:后面一想,可能是说32位系统地址寻址空间有限,内存最多4G
  • gprc你们用的序列化方式?A:protobuf。Q:网络通信协议是HTTP还是TCP。复盘:HTTP2
  • 如何处理kafka的重复消息
  • elasticSearch集群搭建的情况。index是定时刷新还是实时刷新的?
    我参考了一些文档1 2 ,包括elastic的官网3

Sitting between Elasticsearch and the disk is the filesystem cache. Documents in the in-memory indexing buffer (Figure 1) are written to a new segment (Figure 2). The new segment is written to the filesystem cache first (which is cheap) and only later is it flushed to disk(which is expensive). However, after a file is in the cache, it can be opened and read just like any other file.

在这里插入图片描述

In Elasticsearch, this process of writing and opening a new segment is called a refresh … You can control refreshes through the following means: … Waiting for the refresh interval …

By default, Elasticsearch periodically refreshes indices every second … This is why we say that Elasticsearch has near real-time search

给出了自己的简单概括(这个也可以回答2021年面试乐言时为什么es是近实时的提问):
ES写入数据是先把数据写进内存,再写入 filesystem cache,最后再写入硬盘。在第二步(写入filesystem cache形成新的segment,这一步也被称为refresh)后,新数据就可以被搜索到了。refresh默认一秒执行一次(其实官网原文还有个条件,就是过去30秒有收到查询请求的index)。


  1. ES近实时刷新与refresh_interval参数设置相关问题 ↩︎

  2. elasticsearch的数据写入流程及优化 ↩︎

  3. elastic : Near real-time search ↩︎

猜你喜欢

转载自blog.csdn.net/qq_23204557/article/details/129188997