ElasticSearch插件安裝

  

  1、安裝Kiabna

    

    Kibana是一個爲 ElasticSearch 提供的數據分析的 Web 接口。可以使用它對日誌進行高效的搜索、可視化、分析等各類操做。


    Kiabna的介紹可查考官方的說明:https://www.elastic.co/cn/products/kibana html

    下載地址爲:https://www.elastic.co/cn/downloads/kibanajava

    

    下載解壓後:git

    

    修改config / kibana.yml文件,加入如下內容:github

    

 

    把註釋去掉,並修改以下:sql

 

    

  

    而後執行bin目錄下的kibana.bat啓動服務瀏覽器

    

 

    瀏覽器訪問地址:http://127.0.0.1:5601/安全

    

    出現警告服務器

    Unable to fetch mapping. Do you have indices matching the pattern?   app

    解決辦法:利用kibana中的Dev Tools 進入https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html框架

    

PUT /logstash-2015.05.18
{
  "mappings": {
    "log": {
      "properties": {
        "geo": {
          "properties": {
            "coordinates": {
              "type": "geo_point"
            }
          }
        }
      }
    }
  }
}

 

    

          

PUT /shakespeare
{
 "mappings" : {
  "_default_" : {
   "properties" : {
    "speaker" : {"type": "keyword" },
    "play_name" : {"type": "keyword" },
    "line_id" : { "type" : "integer" },
    "speech_number" : { "type" : "integer" }
   }
  }
 }
}
 

    

 

 

    執行如下,而後在返回到kibana首頁,就會發現不會出現警告了!!!

    

    而後點擊"Create"

    

  

  2、下載安裝x-pack

      x-pack是elasticsearch的一個擴展包,將安全,警告,監視,圖形和報告功能捆綁在一個易於安裝的軟件包中,雖然x-pack被設計爲一個無縫的工做,可是你能夠輕鬆的啓用或者關閉一些功能,X-Pack主要是添加身份權限的驗證,

    以及原先須要安裝其餘各類Marvel、Head等各類功能插件添加到Kibana上使用才能使用的功能。

    一、直接下載安裝

     轉到elasticsearch\bin目錄:

  

     打開命令框輸入:elasticsearch-plugin install x-pack

      

    

      若是不須要該插件,也能夠經過很是簡單的方式刪除:
      卸載:elasticsearch-plugin remove x-pack

     二、也能夠先下載文件再安裝

      下載路徑:https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-5.5.2.zip

      

    

      轉到elasticsearch\bin目錄:

  

      打開命令框輸入:elasticsearch-plugin install file:///D:\work\ElasticSearch\x-pack-5.5.2.zip

      

      從新啓動elasticsearch報下面的錯誤:

 

      moreCaused by: java.io.FileNotFoundException: //./pipe/controller_log_4992 (系統找不到指定的文件。)在網上找了半天才找到解決方法

      在網上查詢資料

      在Elasticsearch/config/elasticsearch.yml加入如下參數:

      #action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
      xpack.security.enabled: true
      xpack.monitoring.enabled: false
      xpack.graph.enabled: false
      xpack.watcher.enabled: false
      xpack.ml.enabled: false

      再次啓動

 

      

      成功運行

 

    而後在Kibana中也安裝x-pack,安裝方式以下:

    直接命令安裝:kibana-plugin install x-pack

    卸載:kibana-plugin remove x-pack

    

    或下載後安裝

    安裝命令:kibana-plugin install file:///D:\work\ElasticSearch\x-pack-5.5.2.zip

    

 

     啓動ElasticSearch服務和kibana.bat

    打開瀏覽器,輸入:http://127.0.0.1:5601

    會自動彈出登陸框,輸入初始用戶名和密碼

    用戶名:elastic
    密碼:changeme
    登陸到Kibana會發現 elastic是一個最高級別的user,擁有全部權限,其角色是superuser。
    固然在這裏咱們也能夠添加自定義的用戶,併爲其分配角色,不一樣的角色對應不一樣的功能。
    

 

     

 

 

 

 

   3、安裝Logstash

     Logstash是一款輕量級的日誌蒐集處理框架,能夠方便的把分散的、多樣化的日誌蒐集起來,並進行自定義的處理,而後傳輸到指定的位置,好比某個服務器或者文件。

    

    官網下載地址爲:https://www.elastic.co/downloads/logstash

    

    下載下來以後,解壓以下:

    

    

 

    

    而後添加配置文件:first-pipeline.conf

    

    添加內容

    

    

 

    而後啓動服務:logstash.bat -f first-pipeline.conf  

     

 

  4、Elasticsearch SQL查詢插件

    Elasticsearch-sql 是給予es的提供sql查詢服務。你能夠很方便的用sql的方式查詢es的數據。沒必要困擾於ES變態的查詢表達式,同時提供了超越sql的功能。Github地址: https://github.com/NLPchina/elasticsearch-sql/

    安裝命令:elasticsearch-plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/5.5.1.0/elasticsearch-sql-5.5.1.0.zip  

    

 

    而後下載客戶端 :https://github.com/NLPchina/elasticsearch-sql/releases

    

相關文章
相關標籤/搜索