Kibana簡(jiǎn)介和安裝

簡(jiǎn)介

Kibana是一個(gè)為Elasticsearch平臺(tái)分析和可視化的開(kāi)源平臺(tái),使用Kibana能夠搜索、展示存儲(chǔ)在Elasticsearch中的索引數(shù)據(jù)。使用它可以很方便用圖表、表格、地圖展示和分析數(shù)據(jù)。
Kibana能夠輕松處理大量數(shù)據(jù),通過(guò)瀏覽器接口能夠輕松的創(chuàng)建和分享儀表盤(pán),通過(guò)改變Elasticsearch查詢時(shí)間,可以完成動(dòng)態(tài)儀表盤(pán)。

安裝

Kibana使用html和js開(kāi)發(fā)的,需要運(yùn)行在Node.js,所以在下載的Kibana包中包含了Node平臺(tái)。
Kibana的版本要和Elasticsearch版本一直,不支持主版本不一致(比如5.x 和2.x),次版本不一致(比如5.2和5.1)會(huì)在logger中打印報(bào)警信息,允許補(bǔ)丁版本不一致但是不建議。

下載

wget https://artifacts.elastic.co/downloads/kibana/kibana-5.3.0-linux-x86_64.tar.gz

解壓縮

tar -zxvf kibana-5.3.0-linux-x86_64.tar.gz
Kibana的所有相關(guān)信息都在$KIBANA_HOME目錄下,無(wú)需創(chuàng)建任何目錄,所以刪除、升級(jí)都是比較方便的。

目錄結(jié)構(gòu)

目錄 描述
bin 二進(jìn)制腳本目錄,包含啟動(dòng)kibana和安裝插件的kibana-plugin
config Kibana的配置文件目錄,包含kibana.yml文件
data kibana或kibana插件寫(xiě)數(shù)據(jù)的存儲(chǔ)目錄
plugins 插件目錄,kibana的每一個(gè)插件都會(huì)存在該目錄
optimize Transpiled source code. Certain administrative actions (e.g. plugin install) result in the source code being retranspiled on the fly.

配置

kibana的配置文件在config目錄下的 kibana.yml中:

配置項(xiàng) 描述
server.port: Default: 5601 Kibana is served by a back end server. This setting specifies the port to use. kibana的端口號(hào)。默認(rèn)是5601
server.host: Default: "localhost" This setting specifies the host of the back end server。kibana安裝主機(jī)。默認(rèn)是localhost
server.maxPayloadBytes: Default: 1048576 The maximum payload size in bytes for incoming server requests。最多服務(wù)請(qǐng)求數(shù)。默認(rèn)是1048576
server.name: Default: "your-hostname" A human-readable display name that identifies this Kibana instance。kibana實(shí)例名稱,用來(lái)顯示kibana實(shí)例。默認(rèn)是你的主機(jī)名稱
server.defaultRoute: Default: "/app/kibana" This setting specifies the default route when opening Kibana. You can use this setting to modify the landing page when opening Kibana。打開(kāi)kibana時(shí)的默認(rèn)路由地址,可以通過(guò)改變?cè)撆渲弥赶蛑付ǖ穆酚?。默認(rèn)是/app/kibana
elasticsearch.url: Default: "http://localhost:9200" The URL of the Elasticsearch instance to use for all your queries。Elasticsearch實(shí)例地址,用來(lái)處理所有查詢請(qǐng)求。默認(rèn)時(shí)http://localhost:9200
kibana.index: Default: ".kibana" Kibana uses an index in Elasticsearch to store saved searches, visualizations and dashboards. Kibana creates a new index if the index doesn’t already exist。kibana需要在es中創(chuàng)建一個(gè)索引來(lái)存儲(chǔ)kibana的搜索、可視化和儀表盤(pán)。如果該索引不存在,則會(huì)自動(dòng)創(chuàng)建。默認(rèn)時(shí).kibana
kibana.defaultAppId: Default: "discover" The default application to load。進(jìn)入kibana時(shí)加載的應(yīng)用。默認(rèn)是discover
elasticsearch.pingTimeout: Default: the value of the elasticsearch.requestTimeout settingTime in milliseconds to wait for Elasticsearch to respond to pings。設(shè)置請(qǐng)求Es的響應(yīng)超時(shí)時(shí)間,單位毫秒。默認(rèn)是elasticsearch.requestTimeout
elasticsearch.requestTimeout: Default: 30000 Time in milliseconds to wait for responses from the back end or Elasticsearch. This value must be a positive integer。Es響應(yīng)超時(shí)時(shí)間,單位毫秒,該值必須是正整數(shù)。默認(rèn)是3000
elasticsearch.shardTimeout: Default: 0 Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
shard的響應(yīng)超時(shí)時(shí)間。默認(rèn)為0,不設(shè)置
logging.dest: Default: stdout Enables you specify a file where Kibana stores log output。kibana日志輸出文件。默認(rèn)是stdout
logging.silent: Default: false Set the value of this setting to true to suppress all logging output。設(shè)置該配置,所有日志都輸出。默認(rèn)為false

更多配置可查看:https://www.elastic.co/guide/en/kibana/current/settings.html

啟動(dòng)

$KIBANA_HOME/bin/kibana
訪問(wèn):localhost:5601或者http://YOUDOMAIN.com:5601

訪問(wèn)配置

當(dāng)?shù)谝淮卧L問(wèn)kibana時(shí)候需要指定一個(gè)或多個(gè)Elasticsearch已經(jīng)存的索引,支持模式匹配。之后可以通過(guò)Management導(dǎo)入索引。
比如你的es中已經(jīng)有了一個(gè)blog索引,你可以輸入blog*將以blog開(kāi)頭的索引導(dǎo)入進(jìn)來(lái)。如果你的索引中有時(shí)間戳字段,可以通過(guò)選中:Index contains time-based events,然后在下面的Time-field name填寫(xiě)字段名稱。如果索引沒(méi)有時(shí)間戳字段的話,可以取消上面選中的。

指定Elasticsearch索引

點(diǎn)擊Create創(chuàng)建,Kibana會(huì)以只讀的形式展示你所配置的索引。
查看Kibana狀態(tài)
可以通過(guò)localhost:5601/status查看kibana狀體,這個(gè)頁(yè)面也包括了所有安裝的插件列表。

Kibana狀態(tài)

使用

搜索和展示信息,可以查看Discover頁(yè)面。
圖表和地圖展示,可以查看Visualize。
創(chuàng)建一個(gè)儀表盤(pán),可以使用Dashboard

配置動(dòng)態(tài)映射

默認(rèn)情況下es是動(dòng)態(tài)mapping信息,.kibana索引存放了kibana的搜索、展現(xiàn)、dashboard信息。為了kibana正常展現(xiàn),可以通過(guò)修改.kibana索引修改為動(dòng)態(tài)mapping映射。
PUT .kibana{
"index.mapper.dynamic": true
}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容