ES集群搭建

痛定思痛。 2023-01-09 12:56 304阅读 0赞

以6.2.2为基准因为7.X 需要java11

主要是在于配置 名字host日志,数据以及端口,最大node数,对于新建的node需要把data数据清理,还有yml形式的需要把主机地址,后面空一格

node1

  1. # ======================== Elasticsearch Configuration =========================
  2. #
  3. # NOTE: Elasticsearch comes with reasonable defaults for most settings.
  4. # Before you set out to tweak and tune the configuration, make sure you
  5. # understand what are you trying to accomplish and the consequences.
  6. #
  7. # The primary way of configuring a node is via this file. This template lists
  8. # the most important settings you may want to configure for a production cluster.
  9. #
  10. # Please consult the documentation for further information on configuration options:
  11. # https://www.elastic.co/guide/en/elasticsearch/reference/index.html
  12. #
  13. # ---------------------------------- Cluster -----------------------------------
  14. #
  15. # Use a descriptive name for your cluster:
  16. #
  17. cluster.name: my-application
  18. #
  19. # ------------------------------------ Node ------------------------------------
  20. #
  21. # Use a descriptive name for the node:
  22. #
  23. node.name: node-1
  24. node.master: true
  25. #允许该节点存储数据(默认开启)
  26. node.data: true
  27. #
  28. # Add custom attributes to the node:
  29. #
  30. #node.attr.rack: r1
  31. #
  32. # ----------------------------------- Paths ------------------------------------
  33. #
  34. # Path to directory where to store the data (separate multiple locations by comma):
  35. #
  36. path.data: D:\elasticsearch-6.2.2\data
  37. #
  38. # Path to log files:
  39. #
  40. path.logs: D:\elasticsearch-6.2.2\logs
  41. #
  42. # ----------------------------------- Memory -----------------------------------
  43. #
  44. # Lock the memory on startup:
  45. #
  46. bootstrap.memory_lock: true
  47. #
  48. # Make sure that the heap size is set to about half the memory available
  49. # on the system and that the owner of the process is allowed to use this
  50. # limit.
  51. #
  52. # Elasticsearch performs poorly when the system is swapping the memory.
  53. #
  54. # ---------------------------------- Network -----------------------------------
  55. #
  56. # Set the bind address to a specific IP (IPv4 or IPv6):
  57. #
  58. network.host: 192.168.3.36
  59. #
  60. # Set a custom port for HTTP:
  61. #
  62. http.port: 9200
  63. #
  64. # 设置节点间交互的tcp端口,默认是9300
  65. transport.tcp.port: 9300
  66. # For more information, consult the network module documentation.
  67. #
  68. # --------------------------------- Discovery ----------------------------------
  69. #
  70. # Pass an initial list of hosts to perform discovery when new node is started:
  71. # The default list of hosts is ["127.0.0.1", "[::1]"]
  72. #
  73. discovery.zen.ping.unicast.hosts: ["192.168.3.36:9300", "192.168.3.36:9400"]
  74. #
  75. # Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
  76. #
  77. discovery.zen.minimum_master_nodes: 2
  78. #
  79. # For more information, consult the zen discovery module documentation.
  80. #
  81. # ---------------------------------- Gateway -----------------------------------
  82. #
  83. # Block initial recovery after a full cluster restart until N nodes are started:
  84. #
  85. #gateway.recover_after_nodes: 3
  86. #
  87. # For more information, consult the gateway module documentation.
  88. #
  89. # ---------------------------------- Various -----------------------------------
  90. #
  91. # Require explicit names when deleting indices:
  92. #
  93. #action.destructive_requires_name: true

node2

  1. # ======================== Elasticsearch Configuration =========================
  2. #
  3. # NOTE: Elasticsearch comes with reasonable defaults for most settings.
  4. # Before you set out to tweak and tune the configuration, make sure you
  5. # understand what are you trying to accomplish and the consequences.
  6. #
  7. # The primary way of configuring a node is via this file. This template lists
  8. # the most important settings you may want to configure for a production cluster.
  9. #
  10. # Please consult the documentation for further information on configuration options:
  11. # https://www.elastic.co/guide/en/elasticsearch/reference/index.html
  12. #
  13. # ---------------------------------- Cluster -----------------------------------
  14. #
  15. # Use a descriptive name for your cluster:
  16. #
  17. cluster.name: my-application
  18. #
  19. # ------------------------------------ Node ------------------------------------
  20. #
  21. # Use a descriptive name for the node:
  22. #
  23. node.name: node-2
  24. node.master: true
  25. #允许该节点存储数据(默认开启)
  26. node.data: true
  27. #
  28. # Add custom attributes to the node:
  29. #
  30. #node.attr.rack: r1
  31. #
  32. # ----------------------------------- Paths ------------------------------------
  33. #
  34. # Path to directory where to store the data (separate multiple locations by comma):
  35. #
  36. path.data: D:\es\elasticsearch-6.2.2\data
  37. #
  38. # Path to log files:
  39. #
  40. path.logs: D:\es\elasticsearch-6.2.2\logs
  41. #
  42. # ----------------------------------- Memory -----------------------------------
  43. #
  44. # Lock the memory on startup:
  45. #
  46. bootstrap.memory_lock: true
  47. #
  48. # Make sure that the heap size is set to about half the memory available
  49. # on the system and that the owner of the process is allowed to use this
  50. # limit.
  51. #
  52. # Elasticsearch performs poorly when the system is swapping the memory.
  53. #
  54. # ---------------------------------- Network -----------------------------------
  55. #
  56. # Set the bind address to a specific IP (IPv4 or IPv6):
  57. #
  58. network.host: 192.168.3.36
  59. #
  60. # Set a custom port for HTTP:
  61. #
  62. http.port: 9201
  63. #
  64. # 设置节点间交互的tcp端口,默认是9300
  65. transport.tcp.port: 9400
  66. # For more information, consult the network module documentation.
  67. #
  68. # --------------------------------- Discovery ----------------------------------
  69. #
  70. # Pass an initial list of hosts to perform discovery when new node is started:
  71. # The default list of hosts is ["127.0.0.1", "[::1]"]
  72. #
  73. discovery.zen.ping.unicast.hosts: ["192.168.3.36:9300", "192.168.3.36:9400"]
  74. #
  75. # Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
  76. #
  77. discovery.zen.minimum_master_nodes: 2
  78. #
  79. # For more information, consult the zen discovery module documentation.
  80. #
  81. # ---------------------------------- Gateway -----------------------------------
  82. #
  83. # Block initial recovery after a full cluster restart until N nodes are started:
  84. #
  85. #gateway.recover_after_nodes: 3
  86. #
  87. # For more information, consult the gateway module documentation.
  88. #
  89. # ---------------------------------- Various -----------------------------------
  90. #
  91. # Require explicit names when deleting indices:
  92. #
  93. #action.destructive_requires_name: true

然后再是Kibana由于是6.2.2不支持集群所以配置单个

  1. # Kibana is served by a back end server. This controls which port to use.
  2. server.port: 5601
  3. # The host to bind the server to.
  4. server.host: "0.0.0.0"
  5. # If you are running kibana behind a proxy, and want to mount it at a path,
  6. # specify that path here. The basePath can't end in a slash.
  7. # server.basePath: ""
  8. # The maximum payload size in bytes on incoming server requests.
  9. # server.maxPayloadBytes: 1048576
  10. # The Elasticsearch instance to use for all your queries.
  11. elasticsearch.url: "http://192.168.3.36:9201"
  12. # preserve_elasticsearch_host true will send the hostname specified in `elasticsearch`. If you set it to false,
  13. # then the host you use to connect to *this* Kibana instance will be sent.
  14. # elasticsearch.preserveHost: true
  15. # Kibana uses an index in Elasticsearch to store saved searches, visualizations
  16. # and dashboards. It will create a new index if it doesn't already exist.
  17. kibana.index: ".kibana"
  18. # The default application to load.
  19. # kibana.defaultAppId: "discover"
  20. # If your Elasticsearch is protected with basic auth, these are the user credentials
  21. # used by the Kibana server to perform maintenance on the kibana_index at startup. Your Kibana
  22. # users will still need to authenticate with Elasticsearch (which is proxied through
  23. # the Kibana server)
  24. # elasticsearch.username: "user"
  25. # elasticsearch.password: "pass"
  26. # SSL for outgoing requests from the Kibana Server to the browser (PEM formatted)
  27. # server.ssl.cert: /path/to/your/server.crt
  28. # server.ssl.key: /path/to/your/server.key
  29. # Optional setting to validate that your Elasticsearch backend uses the same key files (PEM formatted)
  30. # elasticsearch.ssl.cert: /path/to/your/client.crt
  31. # elasticsearch.ssl.key: /path/to/your/client.key
  32. # If you need to provide a CA certificate for your Elasticsearch instance, put
  33. # the path of the pem file here.
  34. # elasticsearch.ssl.ca: /path/to/your/CA.pem
  35. # Set to false to have a complete disregard for the validity of the SSL
  36. # certificate.
  37. # elasticsearch.ssl.verify: true
  38. # Time in milliseconds to wait for elasticsearch to respond to pings, defaults to
  39. # request_timeout setting
  40. # elasticsearch.pingTimeout: 1500
  41. # Time in milliseconds to wait for responses from the back end or elasticsearch.
  42. # This must be > 0
  43. # elasticsearch.requestTimeout: 30000
  44. # Header names and values that are sent to Elasticsearch. Any custom headers cannot be overwritten
  45. # by client-side headers.
  46. # elasticsearch.customHeaders: {}
  47. # Time in milliseconds for Elasticsearch to wait for responses from shards.
  48. # Set to 0 to disable.
  49. # elasticsearch.shardTimeout: 0
  50. # Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying
  51. # elasticsearch.startupTimeout: 5000
  52. # Set the path to where you would like the process id file to be created.
  53. # pid.file: /var/run/kibana.pid
  54. # If you would like to send the log output to a file you can set the path below.
  55. # logging.dest: stdout
  56. # Set this to true to suppress all logging output.
  57. # logging.silent: false
  58. # Set this to true to suppress all logging output except for error messages.
  59. # logging.quiet: false
  60. # Set this to true to log all events, including system usage information and all requests.
  61. # logging.verbose: false

分别启动ES就会发现同步完成,可用Kibana查看

发表评论

表情:
评论列表 (有 0 条评论,304人围观)

还没有评论,来说两句吧...

相关阅读

    相关 ES

    以6.2.2为基准因为7.X 需要java11 主要是在于配置     名字host日志,数据以及端口,最大node数,对于新建的node需要把data数据清理,还有yml形