wtxnpw 发表于 2019-1-29 09:00:31

elasticsearch5.2.2 压测配置

  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]
查看完整版本: elasticsearch5.2.2 压测配置