设为首页 收藏本站
查看: 889|回复: 0

[经验分享] elasticsearch5.2.2 压测配置

[复制链接]

尚未签到

发表于 2019-1-29 09:00:31 | 显示全部楼层 |阅读模式
  1、elasticsearch.yml
  # ---------------------------------- Cluster -----------------------------------
  #
  # Use a descriptive name for your cluster:
  #
  cluster.name: zjf-test
  #
  # ------------------------------------ Node ------------------------------------
  #
  # Use a descriptive name for the node:
  #
  node.name: node1
  

  node.master: true
  node.data: true
  #
  # Add custom attributes to the node:
  #
  #node.attr.rack: r1
  

  index.store.type: niofs
  

  #index.analysis.analyzer.ik.type: "ik"
  

  discovery.zen.fd.ping_interval: 10s
  discovery.zen.fd.ping_timeout: 120s
  discovery.zen.fd.ping_retries: 6
  

  #
  # ----------------------------------- Paths ------------------------------------
  #
  # Path to directory where to store the data (separate multiple locations by comma):
  #
  path.data: ../data
  #
  # Path to log files:
  #
  path.logs: ../logs
  #
  # ----------------------------------- Memory -----------------------------------
  #
  # Lock the memory on startup:
  #
  bootstrap.memory_lock: true
  bootstrap.system_call_filter: false
  #
  # Make sure that the heap size is set to about half the memory available
  # on the system and that the owner of the process is allowed to use this
  # limit.
  #
  # Elasticsearch performs poorly when the system is swapping the memory.
  #
  # ---------------------------------- Network -----------------------------------
  #
  # Set the bind address to a specific IP (IPv4 or IPv6):
  #
  network.host: 192.168.10.158
  #
  # Set a custom port for HTTP:
  #
  http.port: 9200
  transport.tcp.port: 9400
  #
  # For more information, consult the network module documentation.
  #
  # --------------------------------- Discovery ----------------------------------
  #
  # Pass an initial list of hosts to perform discovery when new node is started:
  # The default list of hosts is ["127.0.0.1", "[::1]"]
  #
  discovery.zen.ping.unicast.hosts: ["192.168.10.158:9400"]
  #,"192.168.10.185:9400"]
  #
  # Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
  #
  discovery.zen.minimum_master_nodes: 1
  #
  # For more information, consult the zen discovery module documentation.
  #
  # ---------------------------------- Gateway -----------------------------------
  #
  # Block initial recovery after a full cluster restart until N nodes are started:
  #
  #gateway.recover_after_nodes: 3
  #
  # For more information, consult the gateway module documentation.
  #
  # ---------------------------------- Various -----------------------------------
  #
  # Require explicit names when deleting indices:
  #
  #action.destructive_requires_name: true
  cluster.routing.allocation.node_initial_primaries_recoveries: 4
  cluster.routing.allocation.disk.threshold_enabled: true
  cluster.routing.allocation.node_concurrent_recoveries: 4
  indices.recovery.max_bytes_per_sec: 100mb
  

  

  http.cors.enabled: true
  http.cors.allow-origin: "*"
  

  2、jvm.properties
  

  ## JVM configuration
  ################################################################
  ## IMPORTANT: JVM heap size
  ################################################################
  ##
  ## You should always set the min and max JVM heap
  ## size to the same value. For example, to set
  ## the heap to 4 GB, set:
  ##
  ## -Xms4g
  ## -Xmx4g
  ##
  ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
  ## for more information
  ##
  ################################################################
  

  # Xms represents the initial size of total heap space
  # Xmx represents the maximum size of total heap space
  

  -Xms5g
  -Xmx5g
  

  ################################################################
  ## Expert settings
  ################################################################
  ##
  ## All settings below this section are considered
  ## expert settings. Don't tamper with them unless
  ## you understand what you are doing
  ##
  ################################################################
  

  ## GC configuration
  #-XX:+PrintCompressedOopsMode
  -XX:+UnlockDiagnosticVMOptions
  -XX:+UseCompressedOops
  -XX:+UseG1GC
  -XX:MaxGCPauseMillis=200
  -XX:G1ReservePercent=20
  -XX:+G1SummarizeConcMark
  -XX:InitiatingHeapOccupancyPercent=40
  #-XX:ConcGCThreads=8 #设置对应cpu数
  #-XX:PermSize=512m
  ## optimizations
  

  # disable calls to System#gc
  -XX:+DisableExplicitGC
  

  # pre-touch memory pages used by the JVM during initialization
  -XX:+AlwaysPreTouch
  

  ## basic
  

  # force the server VM (remove on 32-bit client JVMs)
  -server
  

  # explicitly set the stack size (reduce to 320k on 32-bit client JVMs)
  -Xss1m
  

  # set to headless, just in case
  -Djava.awt.headless=true
  

  # ensure UTF-8 encoding by default (e.g. filenames)
  -Dfile.encoding=UTF-8
  

  # use our provided JNA always versus the system one
  -Djna.nosys=true
  

  # use old-style file permissions on JDK9
  -Djdk.io.permissionsUseCanonicalPath=true
  

  # flags to configure Netty
  -Dio.netty.noUnsafe=true
  -Dio.netty.noKeySetOptimization=true
  -Dio.netty.recycler.maxCapacityPerThread=0
  

  # log4j 2
  -Dlog4j.shutdownHookEnabled=false
  -Dlog4j2.disable.jmx=true
  -Dlog4j.skipJansi=true
  

  ## heap dumps
  

  # generate a heap dump when an allocation from the Java heap fails
  # heap dumps are created in the working directory of the JVM
  -XX:+HeapDumpOnOutOfMemoryError
  

  # specify an alternative path for heap dumps
  # ensure the directory exists and has sufficient space
  #-XX:HeapDumpPath=${heap.dump.path}
  

  ## GC logging
  

  #-XX:+PrintGCDetails
  #-XX:+PrintGCTimeStamps
  #-XX:+PrintGCDateStamps
  #-XX:+PrintClassHistogram
  #-XX:+PrintTenuringDistribution
  #-XX:+PrintGCApplicationStoppedTime
  

  # log GC status to a file with time stamps
  # ensure the directory exists
  #-Xloggc:${loggc}
  

  # Elasticsearch 5.0.0 will throw an exception on unquoted field names in JSON.
  # If documents were already indexed with unquoted fields in a previous version
  # of Elasticsearch, some operations may throw errors.
  #
  # WARNING: This option will be removed in Elasticsearch 6.0.0 and is provided
  # only for migration purposes.
  #-Delasticsearch.json.allow_unquoted_field_names=true
  





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-668973-1-1.html 上篇帖子: Elasticsearch内存分配设置详解 下篇帖子: ElasticSearch插件安装
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表