当前位置: 首页 > news >正文

ElasticSearch之网络配置

对官方文档Networking的阅读笔记。
ES集群中的节点,支持处理两类通信平面

  • 集群内节点之间的通信,官方文档称之为transport layer。
  • 集群外的通信,处理客户端下发的请求,比如数据的CRUD,检索等,官方文档称之为HTTP layer。

对于这两个平面公共的配置,配置参数可以使用network.*
针对transport layer的配置参数,可以使用transport.*
针对HTTP layer的配置参数,可以使用http.*

参数networkhttptransportremote_cluster说明
hostnetwork.hosthttp.hosttransport.hostremote_cluster.host业务的监听地址。
bind_hostnetwork.bind_hosthttp.bind_hosttransport.bind_hostremote_cluster.bind_host默认值与host相同。
publish_hostnetwork.publish_hosthttp.publish_hosttransport.publish_hostremote_cluster.publish_host默认值与host相同。
publish_portN/Ahttp.publish_porttransport.publish_portremote_cluster.publish_port
portN/Ahttp.porttransport.portremote_cluster.port业务的监听端口。
tcp.keep_alivenetwork.tcp.keep_alivehttp.tcp.keep_alivetransport.tcp.keep_aliveremote_cluster.tcp.keep_aliveTCP socket的SO_KEEPALIVE参数,默认值为true。
tcp.keep_idlenetwork.tcp.keep_idlehttp.tcp.keep_idletransport.tcp.keep_idleremote_cluster.tcp.keep_idleTCP socket的TCP_KEEPIDLE参数,默认值为-1。
tcp.keep_intervalnetwork.tcp.keep_intervalhttp.tcp.keep_intervaltransport.tcp.keep_intervalremote_cluster.tcp.keep_intervalTCP socket的TCP_KEEPINTVL参数,默认值为-1。
tcp.keep_countnetwork.tcp.keep_counthttp.tcp.keep_counttransport.tcp.keep_countremote_cluster.tcp.keep_countTCP socket的TCP_KEEPCNT参数,默认值为-1。
tcp.no_delaynetwork.tcp.no_delayhttp.tcp.no_delaytransport.tcp.no_delayremote_cluster.tcp.no_delayTCP socket的TCP_NODELAY参数,默认值为true。详细说明见wiki。
tcp.reuse_addressnetwork.tcp.reuse_addresshttp.tcp.reuse_addresstransport.tcp.reuse_addressremote_cluster.tcp.reuse_addressTCP socket的SO_REUSEADDR参数,Windows平台的默认值为false,其它平台的默认值为true。
tcp.send_buffer_sizenetwork.tcp.send_buffer_sizehttp.tcp.send_buffer_sizetransport.tcp.send_buffer_sizeremote_cluster.tcp.send_buffer_sizeTCP的发送缓冲区的大小,默认值为-1,表示使用系统的默认值。
tcp.receive_buffer_sizenetwork.tcp.receive_buffer_sizehttp.tcp.receive_buffer_sizetransport.tcp.receive_buffer_sizeremote_cluster.tcp.receive_buffer_sizeTCP的接收缓冲区的大小,默认值为-1,表示使用系统的默认值。
compressionN/Ahttp.compressiontransport.compressionN/A压缩。

transport独有的参数:

  • transport.connect_timeout
  • transport.compress
  • transport.compression_scheme
    压缩算法,可选值包括deflate或者lz4,默认值为lz4。
  • transport.ping_schedule
    指示发送业务心跳的周期,默认值为-1,表示不发送业务心跳。

http独有的参数:

  • http.max_content_length
    HTTP请求消息体的长度的最大值,默认值为100MB。

  • http.max_initial_line_length
    HTTP请求中,URL的长度的最大值,默认值为4KB。

  • http.max_header_size
    HTTP请求中,HTTP头部的总长度的最大值,默认值为16KB。

  • http.compression
    使用HTTPS时,默认取值为false,其它情况下取值为true。

  • http.compression_level
    压缩级别,取值范围为[1, 9],默认值为3。

  • http.detailed_errors.enabled
    指定是否允许在HTTP响应消息中暴露详细的错误提示信息,默认值为true。

  • http.pipelining.max_events
    HTTP请求消息队列的长度,默认值为10000。

  • http.max_warning_header_count
    HTTP响应消息中允许包含的提示信息头部的数量,默认值为-1,即不限制。

  • http.max_warning_header_size
    HTTP响应消息中允许包含的提示信息头部的长度,默认值为-1,即不限制。

  • http.client_stats.enabled
    指示是否记录HTTP通信过程中的统计数据,默认值为true。

  • http.client_stats.closed_channels.max_count
    默认值为10000。

  • http.client_stats.closed_channels.max_age
    关闭HTTP通道之后,上传统计数据的时延值,默认值为5m。

http协议CORS特性相关的参数:

  • http.cors.enabled
    是否启用对CORS的支持。
  • http.cors.allow-origin
  • http.cors.max-age
    指示缓存HTTP方法OPTIONS的返回值的时长,即超时时间,默认值为1728000,即20天。
  • http.cors.allow-methods
    HTTP请求中允许使用的方法,默认值包括:
    • OPTIONS
    • HEAD
    • GET
    • POST
    • PUT
    • DELETE
  • http.cors.allow-headers
    允许在HTTP请求消息中使用的头部,默认值包括:
    • X-Requested-With
    • Content-Type
    • Content-Length
    • Authorization
    • Accept
    • User-Agent
    • X-Elastic-Client-Meta
  • http.cors.expose-headers
    指定在HTTP响应消息中返回的头部,默认值为X-elastic-product
  • http.cors.allow-credentials
    决定头部Access-Control-Allow-Credentials是否返回,默认值为false。

remote_cluster_server独有的参数:

  • remote_cluster_server.enabled
    指示是否启用远端集群,默认值为false。

网络通信的线程模型,这部分内容在处理通信相关的故障时非常意义,后续有空时详细阅读。
导出ES进程的栈时,使用关键字transport_worker来检索,可以看到相关的线程的栈。

参考资料

  • Nodes hot threads API
http://www.lryc.cn/news/454005.html

相关文章:

  • 【C语言进阶】系统测试与调试
  • 多个单链表的合成
  • 『建议收藏』ChatGPT Canvas功能进阶使用指南!
  • Ollama 运行视觉语言模型LLaVA
  • gdb 调试 linux 应用程序的技巧介绍
  • Java项目实战II基于Java+Spring Boot+MySQL的房产销售系统(源码+数据库+文档)
  • aws(学习笔记第一课) AWS CLI,创建ec2 server以及drawio进行aws画图
  • 【Python】Eventlet 异步网络库简介
  • 【JNI】数组的基本使用
  • React跨平台
  • 如何在 SQL 中更新表中的记录?
  • 宠物饮水机的水箱低液位提醒如何实现?
  • EXCEL_光标百分比
  • (一)Web 网站服务之 Apache
  • 英语词汇小程序小程序|英语词汇小程序系统|基于java的四六级词汇小程序设计与实现(源码+数据库+文档)
  • AI学习指南深度学习篇-学习率衰减的实现机制
  • My_qsort() -自己写的 qsort 函数
  • 《向量数据库指南》——Mlivus Cloud打造生产级AI应用利器
  • Electron 进程通信
  • Kubernetes资源详解
  • C++11之线程
  • 界星空科技漆包线行业称重系统
  • RabbitMQ的高级特性-事务
  • Qt Linguist手册
  • 【简介Sentinel-1】
  • 第 17 场小白入门赛蓝桥杯
  • @antv/x6 导出图片下载,或者导出图片为base64由后端去处理。
  • 从零到精通:AI大模型的全方位学习路径解析,非常详细收藏我这一篇就够了
  • PowerShell脚本在自动化Windows开发工作流程中的应用
  • 【力扣 | SQL题 | 每日四题】力扣1783,1757,1747,1623,1468,1661