Logging

Graylog2 伺服器無法連接到 Elasticsearch

  • August 6, 2014

除了使用最新版本的組件外,我嘗試遵循Digital Ocean 手冊。我的elasticsearch.yml

cluster.name: graylog2
network.bind_host: localhost
network.publish_host: localhost
script.disable_dynamic: true

Elasticsearch 說沒問題。然後我嘗試了三個版本graylog2.conf

is_master = true
node_id_file = /etc/graylog2-server-node-id
password_secret = YRdFrLaoQQfRuSccOhU7Vy8vfoWlobVK5ZXf9G6joag4KyPQMLiITfO6EMysO2VrAwunhqE2e7gAVhuN4izPK0jakrtQqnRg
root_password_sha2 = 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
plugin_dir = plugin
rest_listen_uri = http://127.0.0.1:12900/
rest_transport_uri = http://127.0.0.1:12900/
elasticsearch_max_docs_per_index = 20000000
elasticsearch_max_number_of_indices = 20
retention_strategy = delete
elasticsearch_shards = 1
elasticsearch_replicas = 0
elasticsearch_index_prefix = graylog2
allow_leading_wildcard_searches = false
allow_highlighting = false
elasticsearch_analyzer = standard
output_batch_size = 25
output_flush_interval = 1
processbuffer_processors = 5
outputbuffer_processors = 3
processor_wait_strategy = blocking
ring_size = 1024
dead_letters_enabled = false
lb_recognition_period_seconds = 3
mongodb_useauth = false
mongodb_host = 127.0.0.1
mongodb_database = graylog2
mongodb_port = 27017
mongodb_max_connections = 100
mongodb_threads_allowed_to_block_multiplier = 5
transport_email_enabled = false
transport_email_hostname = mail.example.com
transport_email_port = 587
transport_email_use_auth = true
transport_email_use_tls = true
transport_email_use_ssl = true
transport_email_auth_username = you@example.com
transport_email_auth_password = secret
transport_email_subject_prefix = [graylog2]
transport_email_from_email = graylog2@example.com

在第二個版本中,我添加了一行elasticsearch_discovery_zen_ping_unicast_hosts = 127.0.0.1:9200,在第三個版本中添加了與9300埠相同的行。

有了這些配置,我有 3 個日誌sudo java -jar /opt/graylog2-server/graylog2-server.jar --debug第一第二第三。他們都失敗了。

是組件的某些版本不兼容嗎?或者有沒有辦法在我的環境中解決這個問題?

必須使用版本 0.90.10 的 Elasticsearch 和 Graylog2 0.20。它使用的是二進制協議,不幸的是,這些協議在版本之間通常不兼容。

這一行:

org.elasticsearch.transport.RemoteTransportException: Failed to deserialize exception response from stream

是什麼讓問題消失了,協議不同,所以 Elasticsearch 客戶端無法連接到伺服器。如果您使用 0.90.10,它將起作用。

引用自:https://serverfault.com/questions/617582