Mac es + kibana 環境叢集搭建
阿新 • • 發佈:2021-07-25
1.下載elasticSearch. 下載kibana,注意保持著兩個版本一致, 安裝的路徑不能有中文;
es下載地址:https://www.elastic.co/cn/downloads/elasticsearch;
kibala下載地址:https://www.elastic.co/cn/downloads/kibana;
2.es解壓三份之後檔案,相當於三個節點服務,
3.修改es服務下config/elasticsearch.yml 檔案 主要修改綠背景色部分:
# ======================== Elasticsearch Configuration ========================= # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # Before you set out to tweak and tune the configuration, make sure you # understand what are you trying to accomplish and the consequences. # # The primary way of configuring a node is via this file. This template lists # the most important settings you may want to configure for a production cluster. # # Please consult the documentation for further information on configuration options: # https://www.elastic.co/guide/en/elasticsearch/reference/index.html # # ---------------------------------- Cluster ----------------------------------- # # Use a descriptive name for your cluster: # 叢集名稱,多個要保持一致 cluster.name: app-hospital# # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: #節點名稱,在叢集中保持唯一 node.name: node1 # # Add custom attributes to the node: # #node.attr.rack: r1 # # ----------------------------------- Paths ------------------------------------ # # Path to directory where to store the data (separate multiple locations by comma): # #path.data: /path/to/data # # Path to log files: # #path.logs: /path/to/logs # # ----------------------------------- Memory ----------------------------------- # # Lock the memory on startup: # #bootstrap.memory_lock: true # # 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 ----------------------------------- # # By default Elasticsearch is only accessible on localhost. Set a different # address here to expose this node on the network: #服務ip地址 network.host: 127.0.0.1# # By default Elasticsearch listens for HTTP traffic on the first free port it # finds starting at 9200. Set a specific HTTP port here: #服務埠號: http.port: 9200 #各個node節點資料傳輸的埠號 transport.tcp.port: 9300
#允許跨域訪問 http.cors.enabled: true http.cors.allow-origin: "*" # # For more information, consult the network module documentation. # # --------------------------------- Discovery ---------------------------------- # # Pass an initial list of hosts to perform discovery when this node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] #叢集各個node傳輸的ip+埠號,我這裡ip都是127.0.0.1,這個node節點資料傳輸埠號為9300,其他兩個分別為9301/9302 discovery.seed_hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]# # Bootstrap the cluster using an initial set of master-eligible nodes: #這個配置主要是競選主節點,把需要的node節點資訊都配置進去 cluster.initial_master_nodes: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"] # # For more information, consult the discovery and cluster formation module documentation. # # ---------------------------------- Various ----------------------------------- # # Require explicit names when deleting indices: # #action.destructive_requires_name: true
在這個基礎上把其餘兩個es服務下config/elasticsearch.yml 檔案都修改一下,改下node名稱/埠號/node資料傳輸埠號,即可;
4.啟動es服務,在cmd中切換到對應的es解壓檔案目錄,通過bin/elasticsearch -d 依次啟動。
5.檢驗es服務是否啟動成功,通過在瀏覽器 localhost:9200/_cat/health 檢視,如下圖,green 狀態,說明成功
6. 修改kibana的配置檔案,/config/kibana.yml
主要修改:server.port: 5601
server.host: "localhost"
elasticsearch.hosts: ["http://127.0.0.1:9200","http://127.0.0.1:9201","http://127.0.0.1:9202"]
kibana.index: ".kibana"
啟動kibana ,在cmd到對應的解壓檔案目錄下,通過bin/kibana. -d 啟動。
在瀏覽器localhost:5601 檢視即可。效果圖: