0

Ich habe einen Elasticsearch Server:Elactic Suchen Nicht reciving Daten aus logstash

{ 
    "cluster_name" : "elasticsearch", 
    "status" : "yellow", 
    "timed_out" : false, 
    "number_of_nodes" : 76, 
    "number_of_data_nodes" : 1, 
    "active_primary_shards" : 297, 
    "active_shards" : 297, 
    "relocating_shards" : 0, 
    "initializing_shards" : 0, 
    "unassigned_shards" : 297, 
    "delayed_unassigned_shards" : 0, 
    "number_of_pending_tasks" : 0, 
    "number_of_in_flight_fetch" : 0 
} 

Es basiert auf einem Dual-Core-Maschine mit 30GB Ram läuft und empfängt Protokolle 3 bis 4 logstash Server und verfügt über insgesamt 30 Eingabe (alle Log-Stash-Server kombiniert), aber für die meisten Eingaben werden die Protokolle verpasst und ich bekomme keine Protokoll für 30-40 Minuten und ich bekomme eine Warnung in Logstash Server wie . Auch der Elastic Search Server hat eine sehr hohe Ram-Auslastung Der Heartbeat der Protokolldateien ist sehr hoch. Ich habe Gork Muster überprüft und sie sind korrekt Dies ist eine meiner Conf-Dateien:

input { 

    exec { 
    command => "/usr/bin/touch /var/run/logstash-monit/input.touch && /bin/echo OK." 
    interval => 60 
    type => "heartbeat" 
    } 

    file { 
    type => 'seller-forever' 
    path => '/var/log/seller/seller.log' 
    sincedb_path => "/opt/logstash/sincedb-access1" 
    } 
    } 
filter { 

grok { 
    type => "seller-forever" 
    match => [ "message", "%{GREEDYDATA:logline} %{GREEDYDATA:extra_fields}" ] 
    } 

geoip { 
     add_tag => [ "GeoIP" ] 
     database => "/opt/logstash/GeoLiteCity.dat" 
     source => "clientip" 
    } 
    if [useragent] != "-" and [useragent] != "" { 
     useragent { 
     add_tag => [ "UA" ] 
     source => "useragent" 
     } 
    } 
    if [bytes] == 0 { mutate { remove => "[bytes]" } } 
    if [geoip][city_name]  == "" { mutate { remove => "[geoip][city_name]" } } 
    if [geoip][continent_code] == "" { mutate { remove => "[geoip][continent_code]" } } 
    if [geoip][country_code2] == "" { mutate { remove => "[geoip][country_code2]" } } 
    if [geoip][country_code3] == "" { mutate { remove => "[geoip][country_code3]" } } 
    if [geoip][country_name] == "" { mutate { remove => "[geoip][country_name]" } } 
    if [geoip][latitude]  == "" { mutate { remove => "[geoip][latitude]" } } 
    if [geoip][longitude]  == "" { mutate { remove => "[geoip][longitude]" } } 
    if [geoip][postal_code] == "" { mutate { remove => "[geoip][postal_code]" } } 
    if [geoip][region_name] == "" { mutate { remove => "[geoip][region_name]" } } 
    if [geoip][time_zone]  == "" { mutate { remove => "[geoip][time_zone]" } } 
    if [urlquery]    == "" { mutate { remove => "urlquery" } } 

    if "apache_json" in [tags] { 
     if [method] =~ "(HEAD|OPTIONS)" { mutate { remove => "method" } } 
     if [useragent] == "-"    { mutate { remove => "useragent" } } 
     if [referer] == "-"    { mutate { remove => "referer" } } 
    } 
    if "UA" in [tags] { 
     if [device] == "Other" { mutate { remove => "device" } } 
     if [name] == "Other" { mutate { remove => "name" } } 
     if [os]  == "Other" { mutate { remove => "os" } } 
    } 

} 


output { 

stdout { codec => rubydebug } 

elasticsearch { 
type => "seller-forever" 
index => "seller-forever" 
host => "10.0.0.89" 
protocol => "node" 
    } 
} 

Ich benutze Kibana für die Visualisierung. Wie soll ich das beheben, was soll ich überprüfen? Jede Hilfe würde geschätzt werden, ich bin nicht in der Lage zu verstehen, was zu tun ist.

+0

Prüfung in das Fehlerprotokoll von logstash, in/var/log/logstash/ –

+0

@NishantSingh nichts in logstash.log, ist es das, was in logstash.err gefunden in 14. Mai 2016 10.28.35 AM 'org.elasticsearch.cluster.service.InternalClusterService $ UpdateTask run INFO: [logstash-ip-10-0-0-105-8431-13990] hinzugefügt {[logstash-ip-10-0-0-105-6096 -13970] [M-skGUKgQXC-_Zt9kHma6w] [ip-10-0-0-105] [inet [/10.0.0.105:9303]] {Klient = true, data = false},}, Grund: zen-disco- empfange (von Master [[Hammer Harrison] [GPRbvuZ4RJW_Cq_iPW1i7A] [ip-10-0-0-89] [inet [/10.0.0.89:9300]]]) " –

+0

429 code bedeutet, dass deine Logstash-Clients zu viele Anfragen senden und Der Knoten kann sie nicht verarbeiten. –

Antwort

1

Haben Sie Ihre Logstash- und Elasticsearch-Protokolle überprüft?

Auf der anderen Seite habe ich Ihre Logstash Config neu geschrieben, weil einige der Optionen, die Sie verwenden, veraltet oder veraltet waren mit meiner Logstash Version 2.3.2.

Ich änderte entfernen in muate zu remov_field (Entfernen ist veraltet). Ich habe das Protokoll entfernt, weil es veraltet ist (Knoten ist die Standardoption).

Geben Sie in grok und elasticsearch ist obsolet. Sie haben den richtigen Typ in Ihrer Eingabe, damit Logstash es mit Ihren Dateien sendet. Wenn Sie auf der Grundlage eines bestimmten Typs im Filter etwas tun möchten. Sie müssen so etwas verwenden.

filter { 
    if [type] == "apacheAccess" { 
     grok { 
      match => [ "message", "%{message}" ] 
     } 

Sie können Ihre unassigned_shards mit 2 Optionen beheben.

  1. Sie können eine Zusammenführung erzwingen, um eine Zusammenführung von einem oder mehreren Indizes zu erzwingen. curl -XPOST 'http://localhost:9200/_forcemerge'Elasticsearch Documentation: Force Merge
  2. Sie können Ihre index.routing.allocation.disable_allocation auf false festlegen. Dies wird Zuweisungen deaktivieren. curl -XPUT 'localhost:9200/_settings' \ -d '{"index.routing.allocation.disable_allocation": false}'
Verwandte Themen