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 查看即可。效果图: