ElasticSearch插件安裝


  

  一、安裝Kiabna

    

    Kibana是一個為 ElasticSearch 提供的數據分析的 Web 接口。可使用它對日志進行高效的搜索、可視化、分析等各種操作。


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

    下載地址為:https://www.elastic.co/cn/downloads/kibana

    

    下載解壓后:

    

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

    

 

    把注釋去掉,並修改如下:

 

    

  

    然后執行bin目錄下的kibana.bat啟動服務

    

 

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

    

    出現警告

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

    解決辦法:利用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"

    

  

  二、下載安裝x-pack

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

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

    1、直接下載安裝

     轉到elasticsearch\bin目錄:

  

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

      

    

      如果不需要該插件,也可以通過非常簡單的方式刪除:
      卸載:elasticsearch-plugin remove x-pack

     2、也可以先下載文件再安裝

      下載路徑: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。
    當然在這里我們也可以添加自定義的用戶,並為其分配角色,不同的角色對應不同的功能。
    

 

     

 

 

 

 

   三、安裝Logstash

     Logstash是一款輕量級的日志搜集處理框架,可以方便的把分散的、多樣化的日志搜集起來,並進行自定義的處理,然后傳輸到指定的位置,比如某個服務器或者文件。

    

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

    

    下載下來之后,解壓如下:

    

    

 

    

    然后添加配置文件:first-pipeline.conf

    

    添加內容

    

    

 

    然后啟動服務:logstash.bat -f first-pipeline.conf  

     

 

  四、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

    

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM