您好,登錄后才能下訂單哦!
目前架構:
n臺filebeat客戶端來將每臺應用上的日志傳到kafka,3臺kafka做集群用于日志隊列,四臺ES做集群,前兩臺存放近兩天熱數據日志,后兩臺存放兩天前的歷史日志,數據保存一個月,目前總數據量44億,大小為6T。logstash與kibana與ES在一臺機器上,kibana域名指向后端三個kibana做輪詢。
出現性能問題:
1、集群中只有第一臺負載很高,其他節點負載一直都很低,偶爾同為hot數據節點的第二臺負載也會稍微有點升高。
2、隊列經常堵塞,kafka中uat,pet,prd三個環境的topic同在一個默認的logstash消費組。只要其中一個環境的列隊積壓,其他環境的隊列就無法消費了。
3、Kibana登陸后首頁打開,需要至少半分鐘,日志查詢也很慢,至少幾分鐘才會出結果。
4、有時候ES常因負載高而脫離集群,導致集群節點數據重新分配,集群狀態顏色為RED,同時kibana頁面打開時顯示Red報錯。kibana頁面間斷無法打開的情況約持續一兩周。
目前ELK中發現有些索引查詢有點慢,于是打開ES索引查詢日志來記錄慢查詢,進而對慢查詢日志進行分析,定位問題。慢日志內容如下:
[2017-08-28T11:21:02,377][WARN ][index.search.slowlog.query] [node-3] [logstash-nginx-2017.08.01][4] took[15s], took_millis[15029], types[], stats[], search _type[QUERY_THEN_FETCH], total_shards[140], source[{"size":0,"query":{"bool":{"filter":[{"match_none":{"boost":1.0}},{"query_string":{"query":"NOT status:200 OR NOT status:304","fields":[],"use_dis_max":true,"tie_breaker":0.0,"default_operator":"or","auto_generate_phrase_queries":false,"max_determined_states":10000,"enable_position _increment":true,"fuzziness":"AUTO","fuzzy_prefix_length":0,"fuzzy_max_expansions":50,"phrase_slop":0,"analyze_wildcard":true,"escape":false,"split_on_whitespace":true, "boost":1.0}}],"disable_coord":false,"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"3":{"terms":{"field":"status","size":5,"min_doc_count":0,"shard_min_doc_ count":0,"show_term_doc_count_error":false,"order":[{"_count":"desc"},{"_term":"asc"}]},"aggregations":{"2":{"date_histogram":{"field":"@timestamp","format":"epoch_mill is","interval":"20m","offset":0,"order":{"_key":"asc"},"keyed":false,"min_doc_count":0,"extended_bounds":{"min":"1503886846372","max":"1503890446372"}}}}}}}], [2017-08-28T11:21:02,377][WARN ][index.search.slowlog.query] [node-3] [logstash-nginx-2017.08.01][2] took[15.7s], took_millis[15787], types[], stats[], sear ch_type[QUERY_THEN_FETCH], total_shards[140], source[{"size":0,"query":{"bool":{"filter":[{"match_none":{"boost":1.0}},{"query_string":{"query":"NOT status:200 OR NOT status:304","fields":[],"use_dis_max":true,"tie_breaker":0.0,"default_operator":"or","auto_generate_phrase_queries":false,"max_determined_states":10000,"enable_positi on_increment":true,"fuzziness":"AUTO","fuzzy_prefix_length":0,"fuzzy_max_expansions":50,"phrase_slop":0,"analyze_wildcard":true,"escape":false,"split_on_whitespace":tru e,"boost":1.0}}],"disable_coord":false,"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"3":{"terms":{"field":"status","size":5,"min_doc_count":0,"shard_min_do c_count":0,"show_term_doc_count_error":false,"order":[{"_count":"desc"},{"_term":"asc"}]},"aggregations":{"2":{"date_histogram":{"field":"@timestamp","format":"epoch_mi llis","interval":"20m","offset":0,"order":{"_key":"asc"},"keyed":false,"min_doc_count":0,"extended_bounds":{"min":"1503886846372","max":"1503890446372"}}}}}}}],
下面進行分析:
待續
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。