Elasticsearch Monitoring

Marvel-Agent in Kibana

這個是官方出的監控系統

  1. 在 elasticsearch-2.4.1 中安裝 marvel-agent plugin
  2. restart elasticsearch 測試安裝: http://host:2812/.marvel-es-data-1/_search?pretty
  3. 到 kibana 中安裝 bin/kibana plugin –install elasticsearch/marvel/2.4.5
  4. 確認 kibana/config/kibana.yml 中的 elasticsearch-url 有正確設定
  5. 啟動 kibana
  6. 連線到 port 5601

目前出現這樣的狀況

有可能是:

一般是人为删除(比如在sense插件里执行删除命令)marvel数据,导致marvel采集出错(删除了半天数据,另外半天数据将无法正常采集),不能统计;对于这种情况,等第二天marvel就可以正常使用了。
也有可能是9300端口被占用,marvel默认使用9300端口;对于这种情况,找到9300端口占用进程,kill掉,重启kibana即可。
10 Bad Request, you must reconsidered your request. <400>

正常的情況應該馬上就會出現 elasticsearch 的項目,有一個可能是因為 license expired 了

測試 marvel-agent 的輸出

"license" : {
  "status" : "expired",
  "uid" : "aaaca7d3-ee84-448a-92ab-f57d426f5406",
  "type" : "trial",
  "issue_date" : "2017-02-13T10:12:06.302Z",
  "issue_date_in_millis" : 1486980726302,
  "expiry_date" : "2017-03-15T10:12:06.302Z",
  "expiry_date_in_millis" : 1489572726302,
  "max_nodes" : 1000,
  "issued_to" : "elasticsearch",
  "issuer" : "elasticsearch",
  "hkey" : "3d510ac4c9b5954a11e607d64a62d569468b1283f2e332523f6cfa51db06fa87"
}

這邊有說

At the end of the trial period, you can purchase a subscription to keep using the full functionality of Shield along with Marvel and Watcher.

When your license expires, Shield operates in a degraded mode where access to the Elasticsearch cluster health, cluster stats, and index stats APIs is blocked. Shield keeps on protecting your cluster, but you won’t be able to monitor its operation until you update your license.

不過只要到那邊的這邊,選擇 BASIC 的 Free 方案,註冊一個新的 product 後就可以下載新的 license 了,時間一樣是一年

然後我更新了 license

floodfire@r420:~/install/elasticsearch-2.4.1$ curl -XPUT -u admin 'http://localhost:2812/_license?pretty&acknowledgement=true' -d @veck-hsiao-641d2d44-175d-41c8-84c2-e1b330d1d38f-v2.json
Enter host password for user 'admin':
{
  "acknowledged" : false,
  "license_status" : "valid",
  "acknowledge" : {
    "message" : "This license update requires acknowledgement. To acknowledge the license, please read the following messages and update the license again, this time with the \"acknowledge=true\" parameter:",
    "marvel" : [ "basic", "Automatic index cleanup is locked to 7 days for clusters with [{}] license.basic" ]
  }
}
floodfire@r420:~/install/elasticsearch-2.4.1$ curl -XPUT -u admin 'http://localhost:2812/_license?pretty&acknowledge=true' -d @veck-hsiao-641d2d44-175d-41c8-84c2-e1b330d1d38f-v2.json
Enter host password for user 'admin':
{
  "acknowledged" : true,
  "license_status" : "valid"
}

測試 marvel-agent 的輸出中就更新了

"license" : {
  "status" : "active",
  "uid" : "641d2d44-175d-41c8-84c2-e1b330d1d38f",
  "type" : "basic",
  "issue_date" : "2017-05-25T00:00:00.000Z",
  "issue_date_in_millis" : 1495670400000,
  "expiry_date" : "2018-05-25T23:59:59.999Z",
  "expiry_date_in_millis" : 1527292799999,
  "max_nodes" : 100,
  "issued_to" : "Veck Hsiao (National Chengchi University)",
  "issuer" : "Web Form",
  "hkey" : "e69f88819c65320cd6b62c16e9eee7ffa72957205e48265f967f3a9b08fe8e41"
},

但是剛更新完不會馬上能夠讓 marvel 正常運作,所以不要啟動了 kibana 看到還是 No date 就罵幹,讓子彈飛一會,就會看到鬆了一口氣的畫面:

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com 標誌

您的留言將使用 WordPress.com 帳號。 登出 /  變更 )

Google photo

您的留言將使用 Google 帳號。 登出 /  變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 /  變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 /  變更 )

連結到 %s