Current Behavior
Graylog not able to connect to elasticsearch as I see in the logs
2017-07-25T15:27:08.292Z INFO [node] [graylog-a2c36082-47d7-446d-acbd-84e010df1fcd] starting ...
2017-07-25T15:27:08.294Z INFO [Periodicals] Starting [org.graylog2.periodical.AlertScannerThread] periodical in [10s], polling every [60s].
2017-07-25T15:27:08.294Z INFO [Periodicals] Starting [org.graylog2.periodical.BatchedElasticSearchOutputFlushThread] periodical in [0s], polling every [1s].
2017-07-25T15:27:08.295Z INFO [Periodicals] Starting [org.graylog2.periodical.ClusterHealthCheckThread] periodical in [120s], polling every [20s].
2017-07-25T15:27:08.296Z INFO [Periodicals] Starting [org.graylog2.periodical.ContentPackLoaderPeriodical] periodical, running forever.
2017-07-25T15:27:08.296Z INFO [Periodicals] Starting [org.graylog2.periodical.GarbageCollectionWarningThread] periodical, running forever.
2017-07-25T15:27:08.296Z INFO [Periodicals] Starting [org.graylog2.periodical.IndexerClusterCheckerThread] periodical in [0s], polling every [30s].
2017-07-25T15:27:08.297Z INFO [Periodicals] Starting [org.graylog2.periodical.IndexRetentionThread] periodical in [0s], polling every [300s].
2017-07-25T15:27:08.297Z INFO [Periodicals] Starting [org.graylog2.periodical.IndexRotationThread] periodical in [0s], polling every [10s].
2017-07-25T15:27:08.297Z INFO [IndexRetentionThread] Elasticsearch cluster not available, skipping index retention checks.
2017-07-25T15:27:08.299Z INFO [Periodicals] Starting [org.graylog2.periodical.NodePingThread] periodical in [0s], polling every [1s].
2017-07-25T15:27:08.300Z INFO [Periodicals] Starting [org.graylog2.periodical.VersionCheckThread] periodical in [300s], polling every [1800s].
2017-07-25T15:27:08.301Z INFO [Periodicals] Starting [org.graylog2.periodical.ThrottleStateUpdaterThread] periodical in [1s], polling every [1s].
2017-07-25T15:27:08.302Z INFO [Periodicals] Starting [org.graylog2.events.ClusterEventPeriodical] periodical in [0s], polling every [1s].
2017-07-25T15:27:08.302Z INFO [Periodicals] Starting [org.graylog2.events.ClusterEventCleanupPeriodical] periodical in [0s], polling every [86400s].
2017-07-25T15:27:08.303Z INFO [Periodicals] Starting [org.graylog2.periodical.ClusterIdGeneratorPeriodical] periodical, running forever.
2017-07-25T15:27:08.303Z INFO [Periodicals] Starting [org.graylog2.periodical.IndexRangesMigrationPeriodical] periodical, running forever.
2017-07-25T15:27:08.303Z INFO [Periodicals] Starting [org.graylog2.periodical.IndexRangesCleanupPeriodical] periodical in [15s], polling every [3600s].
2017-07-25T15:27:08.304Z INFO [connection] Opened connection [connectionId{localValue:3, serverValue:330}] to 127.0.0.1:27017
2017-07-25T15:27:08.304Z INFO [connection] Opened connection [connectionId{localValue:5, serverValue:332}] to 127.0.0.1:27017
2017-07-25T15:27:08.304Z INFO [connection] Opened connection [connectionId{localValue:6, serverValue:333}] to 127.0.0.1:27017
2017-07-25T15:27:08.304Z INFO [connection] Opened connection [connectionId{localValue:4, serverValue:331}] to 127.0.0.1:27017
2017-07-25T15:27:08.307Z INFO [connection] Opened connection [connectionId{localValue:7, serverValue:334}] to 127.0.0.1:27017
2017-07-25T15:27:08.313Z INFO [connection] Opened connection [connectionId{localValue:8, serverValue:335}] to 127.0.0.1:27017
2017-07-25T15:27:08.313Z INFO [connection] Opened connection [connectionId{localValue:9, serverValue:336}] to 127.0.0.1:27017
2017-07-25T15:27:08.334Z INFO [PeriodicalsService] Not starting [org.graylog2.periodical.UserPermissionMigrationPeriodical] periodical. Not configured to run on this node.
2017-07-25T15:27:08.334Z INFO [Periodicals] Starting [org.graylog2.periodical.AlarmCallbacksMigrationPeriodical] periodical, running forever.
2017-07-25T15:27:08.335Z INFO [Periodicals] Starting [org.graylog2.periodical.ConfigurationManagementPeriodical] periodical, running forever.
2017-07-25T15:27:08.340Z INFO [Periodicals] Starting [org.graylog2.periodical.LdapGroupMappingMigration] periodical, running forever.
2017-07-25T15:27:08.340Z INFO [Periodicals] Starting [org.graylog2.periodical.IndexFailuresPeriodical] periodical, running forever.
2017-07-25T15:27:08.341Z INFO [Periodicals] Starting [org.graylog.plugins.usagestatistics.UsageStatsNodePeriodical] periodical in [300s], polling every [21600s].
2017-07-25T15:27:08.341Z INFO [Periodicals] Starting [org.graylog.plugins.usagestatistics.UsageStatsClusterPeriodical] periodical in [300s], polling every [21600s].
2017-07-25T15:27:08.343Z INFO [Periodicals] Starting [org.graylog.plugins.pipelineprocessor.periodical.LegacyDefaultStreamMigration] periodical, running forever.
2017-07-25T15:27:08.344Z INFO [Periodicals] Starting [org.graylog.plugins.collector.periodical.PurgeExpiredCollectorsThread] periodical in [0s], polling every [3600s].
2017-07-25T15:27:08.428Z INFO [LegacyDefaultStreamMigration] Legacy default stream has no connections, no migration needed.
2017-07-25T15:27:08.444Z INFO [IndexerClusterCheckerThread] Indexer not fully initialized yet. Skipping periodic cluster check.
2017-07-25T15:27:08.509Z INFO [V20161130141500_DefaultStreamRecalcIndexRanges] Cluster not connected yet, delaying migration until it is reachable.
2017-07-25T15:27:08.566Z INFO [transport] [graylog-a2c36082-47d7-446d-acbd-84e010df1fcd] publish_address {127.0.0.1:9350}, bound_addresses {127.0.0.1:9350}
2017-07-25T15:27:08.570Z INFO [discovery] [graylog-a2c36082-47d7-446d-acbd-84e010df1fcd] graylog/5dFjDDDvRimPW9VOdogNQg
2017-07-25T15:27:08.684Z INFO [JerseyService] Enabling CORS for HTTP endpoint
2017-07-25T15:27:11.572Z WARN [discovery] [graylog-a2c36082-47d7-446d-acbd-84e010df1fcd] waited for 3s and no initial state was set by the discovery
2017-07-25T15:27:11.573Z INFO [node] [graylog-a2c36082-47d7-446d-acbd-84e010df1fcd] started
2017-07-25T15:27:11.626Z INFO [service] [graylog-a2c36082-47d7-446d-acbd-84e010df1fcd] detected_master {graylog}{alHd4ZyiROS7paFPZjU8sA}{94.130.32.23}{94.130.32.23:9300}{master=true}, added {{graylog}{alHd4ZyiROS7paFPZjU8sA}{94.130.32.23}{94.130.32.23:9300}{master=true},}, reason: zen-disco-receive(from master [{graylog}{alHd4ZyiROS7paFPZjU8sA}{94.130.32.23}{94.130.32.23:9300}{master=true}])
2017-07-25T15:27:16.583Z INFO [NetworkListener] Started listener bound to [0.0.0.0:9000]
2017-07-25T15:27:16.584Z INFO [HttpServer] [HttpServer] Started.
2017-07-25T15:27:16.584Z INFO [JerseyService] Started REST API at <http://0.0.0.0:9000/api/>
2017-07-25T15:27:16.584Z INFO [JerseyService] Started Web Interface at <http://0.0.0.0:9000/>
2017-07-25T15:27:16.585Z INFO [ServiceManagerListener] Services are healthy
2017-07-25T15:27:16.586Z INFO [ServerBootstrap] Services started, startup times in ms: {InputSetupService [RUNNING]=8, KafkaJournal [RUNNING]=11, JournalReader [RUNNING]=11, OutputSetupService [RUNNING]=11, BufferSynchronizerService [RUNNING]=15, ConfigurationEtagService [RUNNING]=18, StreamCacheService [RUNNING]=130, PeriodicalsService [RUNNING]=142, IndexerSetupService [RUNNING]=3347, JerseyService [RUNNING]=8296}
2017-07-25T15:27:16.586Z INFO [InputSetupService] Triggering launching persisted inputs, node transitioned from Uninitialized [LB:DEAD] to Running [LB:ALIVE]
2017-07-25T15:27:16.594Z INFO [ServerBootstrap] Graylog server up and running.
2017-07-25T15:27:16.606Z INFO [InputStateListener] Input [GELF UDP/59774ed1dc3aaa50d9cc7d39] is now STARTING
2017-07-25T15:27:16.640Z WARN [NettyTransport] receiveBufferSize (SO_RCVBUF) for input GELFUDPInput{title=sao, type=org.graylog2.inputs.gelf.udp.GELFUDPInput, nodeId=null} should be 262144 but is 212992.
2017-07-25T15:27:16.642Z INFO [InputStateListener] Input [GELF UDP/59774ed1dc3aaa50d9cc7d39] is now RUNNING
2017-07-25T15:27:17.968Z DEBUG [OffsetIndex] Adding index entry 61454 => 32693296 to 00000000000000039096.index.
2017-07-25T15:27:18.054Z DEBUG [OffsetIndex] Adding index entry 61459 => 32700617 to 00000000000000039096.index.
Context
I am sending some logs to UDP input of graylog . I can see the input is coming as the message count increasing , but there is no output . When I check in the logs its says
2017-07-25T15:27:08.297Z INFO [IndexRetentionThread] Elasticsearch cluster not available, skipping index retention checks.
Configurations are:
Everything is running on the same box
graylog server conf
is_master = True
node_id_file = /etc/graylog/server/node-id
password_secret =***********
root_username = admin
root_password_sha2 = ****************
root_email =
root_timezone = UTC
plugin_dir = /usr/share/graylog-server/plugin
rest_listen_uri = http://0.0.0.0:9000/api/
rest_enable_cors = True
rest_enable_gzip = True
rest_enable_tls = False
rest_tls_cert_file = /path/to/graylog.crt
rest_tls_key_file = /path/to/graylog.key
rest_tls_key_password = secret
rest_max_header_size = 8192
rest_max_initial_line_length = 4096
rest_thread_pool_size = 16
web_enable = True
web_listen_uri = http://0.0.0.0:9000/
web_enable_cors = True
web_enable_gzip = True
web_enable_tls = False
web_tls_cert_file =
web_tls_key_file =
web_tls_key_password =
web_max_header_size = 8192
web_max_initial_line_length = 4096
web_thread_pool_size = 16
rotation_strategy = count
elasticsearch_max_docs_per_index = 20000000
elasticsearch_max_size_per_index = 1073741824
elasticsearch_max_time_per_index = 1d
elasticsearch_disable_version_check = True
no_retention = False
elasticsearch_max_number_of_indices = 30
retention_strategy = delete
elasticsearch_shards = 4
elasticsearch_replicas = 0
elasticsearch_index_prefix = graylog
elasticsearch_template_name = graylog-internal
allow_leading_wildcard_searches = False
allow_highlighting = False
elasticsearch_cluster_name = graylog
elasticsearch_node_name_prefix = graylog-
elasticsearch_discovery_zen_ping_unicast_hosts = 127.0.0.1:9300
elasticsearch_node_master = false
elasticsearch_node_data = false
elasticsearch_transport_tcp_port = 9350
elasticsearch_http_enabled = False
elasticsearch_cluster_discovery_timeout = 5000
elasticsearch_network_host =
elasticsearch_network_bind_host =
elasticsearch_network_publish_host =
elasticsearch_discovery_initial_state_timeout = 3s
elasticsearch_analyzer = standard
elasticsearch_request_timeout = 1m
index_ranges_cleanup_interval = 1h
output_batch_size = 25
output_flush_interval = 1
output_fault_count_threshold = 5
output_fault_penalty_seconds = 30
processbuffer_processors = 5
outputbuffer_processors = 3
outputbuffer_processor_keep_alive_time = 5000
outputbuffer_processor_threads_core_pool_size = 3
outputbuffer_processor_threads_max_pool_size = 30
udp_recvbuffer_sizes = 1048576
processor_wait_strategy = blocking
ring_size = 65536
inputbuffer_ring_size = 65536
inputbuffer_processors = 2
inputbuffer_wait_strategy = blocking
message_journal_enabled = True
message_journal_dir = /var/lib/graylog-server/journal
message_journal_max_age = 12h
message_journal_max_size = 5gb
message_journal_flush_age = 1m
message_journal_flush_interval = 1000000
message_journal_segment_age = 1h
message_journal_segment_size = 100mb
async_eventbus_processors = 2
lb_recognition_period_seconds = 3
lb_throttle_threshold_percentage = 95
stream_processing_timeout = 2000
stream_processing_max_faults = 3
alert_check_interval = 60
output_module_timeout = 10000
stale_master_timeout = 2000
shutdown_timeout = 30000
mongodb_uri = mongodb://127.0.0.1:27017/graylog
mongodb_max_connections = 100
mongodb_threads_allowed_to_block_multiplier = 5
rules_file =
transport_email_enabled = False
transport_email_hostname =
transport_email_port = 587
transport_email_use_auth = True
transport_email_use_tls = True
transport_email_use_ssl = True
transport_email_auth_username =
transport_email_auth_password =
transport_email_subject_prefix = [graylog]
transport_email_from_email =
transport_email_web_interface_url =
http_connect_timeout = 5s
http_read_timeout = 10s
http_write_timeout = 10s
disable_index_optimization = True
index_optimization_max_num_segments = 1
gc_warning_threshold = 1s
ldap_connection_timeout = 2000
disable_sigar = False
dashboard_widget_default_cache_time = 10s
content_packs_loader_enabled = True
content_packs_dir = /usr/share/graylog-server/contentpacks
content_packs_auto_load =
proxied_requests_thread_pool_size = 32
elasticsearch
bootstrap.mlockall: false
cluster.name: graylog
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: 127.0.0.1:9300
http.port: 9200
network.host: 0.0.0.0
node.data: true
node.master: true
node.name: graylog
transport.tcp.port: 9300
path.conf: /etc/elasticsearch/graylog
path.data: /var/lib/elasticsearch/graylog.example-graylog
path.work: /tmp/elasticsearch/graylog.example-graylog
path.logs: /var/log/elasticsearch/graylog.example-graylog
- when I check elasticsearch health that’s green and graylog interface also shows everything good.
curl localhost:9200/_cluster/health?pretty=true
{
"cluster_name" : "graylog",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 1,
"active_primary_shards" : 4,
"active_shards" : 4,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 100.0
}
- I tried with sending a sample message as well, Elasticsearch works.
curl -X POST 'http://localhost:9200/tutorial/helloworld/1' -d '{ "message": "Hello World!" }'
{"_index":"tutorial","_type":"helloworld","_id":"1","_version":1,"_shards":{"total":1,"successful":1,"failed":0},"created":true}root@graylog:/tmp#
root@graylog:/tmp#
curl -X GET 'http://localhost:9200/tutorial/helloworld/1'
{"_index":"tutorial","_type":"helloworld","_id":"1","_version":1,"found":true,"_source":{ "message": "Hello World!" }}root@graylog:/tmp#
- Graylog Version:
graylog-server 2.2.3-1
- Elasticsearch Version:
ii elasticsearch 2.4.3
- MongoDB Version:
ii mongodb-org 3.2.15 amd64 MongoDB open source document-oriented database system (metapackage)
ii mongodb-org-mongos 2.6.12 amd64 MongoDB sharded cluster query router
ii mongodb-org-server 3.2.15 amd64 MongoDB database server
ii mongodb-org-shell 3.2.15 amd64 MongoDB shell client
ii mongodb-org-tools 2.6.12 amd64 MongoDB tools
- Operating System:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
Few more details:
@joschi thanks for help .
I’ve checked there are no iptables rules and the socket is available .
Everything is running on the same.
root@graylog:/etc/elasticsearch# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain sshguard (0 references)
target prot opt source destination
Plus I’ve checked the netstat output as well .
root@graylog:/etc/elasticsearch# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 94.130.32.23:9300 0.0.0.0:* LISTEN 13617/java
tcp 0 0 94.130.32.23:12900 0.0.0.0:* LISTEN 14292/java
tcp 0 0 94.130.32.23:9350 0.0.0.0:* LISTEN 14292/java
tcp 0 0 94.130.32.23:9000 0.0.0.0:* LISTEN 14292/java
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 11188/mongod
tcp 0 0 94.130.32.23:9200 0.0.0.0:* LISTEN 13617/java
root@graylog:/etc/elasticsearch# curl 94.130.32.23:9200/_cat/master?v
id host ip node
iHLQiWFXSKC6QwwLe-dQIA 94.130.32.23 94.130.32.23 graylog-logger
Please help .
many thanks