zoukankan      html  css  js  c++  java
  • elasticsearch 优化

    启动优化

    • 配置服务器open file的最大数量(使用ulimit -a  查看)
    • 配置启动内存,修改bin/elasticsearch 文件,增加 ES_HEAP_SIZE=4g(最大不可超过32G)
    • 配置 禁止物理内存交换  config/elasticsearch.yml   bootstrap.memory_lock: true
    • 禁用监控  marvel.agent.enabled(很耗CPU)
    • 配置一些线程池

        #---------------------------------thread pool-----------------------------------
        threadpool.index.type: fixed
        thread_pool.index.size: 500
        thread_pool.index.queue_size: 2000

        threadpool.bulk.type: fixed
        threadpool.bulk.size: 100
        threadpool.bulk.queue_size: 500

    集群部署优化

    • 各司其职,配置只作为master或者data的节点,还可以配置客户端节点

    数据分布优化

    • 修改分片和副本的数量,太大太小都不合适
    • 定时对索引进行合并优化 _forcemerge接口
    • 删除已标记为删除的文档:curl -XPOST localhost:9200/uploaddata/_forcemerge?max_num_segments=1  

        curl -XPOST localhost:9200/uploaddata/_forcemerge?only_expunge_deletes=true

    常规问题:

    报错:data for [event] would be larger than limit of

    一般是缓存太小,超出!

    一种方式增加堆缓存;

    另一种是清除缓存  curl localhost:9200/uploaddata/_cache/clear?fielddata=true

    可以设置filter,fielddata,query_cache,或者id_cache为true

    --------------------------------------------------------------------------------

  • 相关阅读:
    H264--2--语法及结构
    LIB和DLL的区别与使用
    动态库与静态库优缺点比较
    网络摄像机连接图
    作为一名安防人,你真的了解网络摄像机吗?
    帧率、分辨率、码流的关系
    视频监控存储空间大小与传输带宽计算方法
    如何配置监控系统的电源功率?
    Websocket通信过程
    Python进阶点
  • 原文地址:https://www.cnblogs.com/tengpan-cn/p/8683240.html
Copyright © 2011-2022 走看看