I am currently trying to get Graylog running with Opensearch in a container. Unfortunately I always get an error that Opensearch is not reachable on port 9200. Can someone help me to find the error please?
No service is running on this port:
user@graylog:~/docker-graylog$ sudo ss -tulwn | grep 9200
user@graylog:~/docker-graylog$ sudo lsof -i :9200
user@graylog:~/docker-graylog$
When I start the Compose file, I get this:
-c86e8e2a20c9","connectionId":3,"connectionCount":2}}
mongodb_1 | {"t":{"$date":"2023-11-23T07:55:35.796+00:00"},"s":"I", "c":"-", "id":20883, "ctx":"conn2","msg":"Interrupted operation as its client disconnected","attr":{"opId":206}}
mongodb_1 | {"t":{"$date":"2023-11-23T07:55:35.796+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn2","msg":"Connection ended","attr":{"remote":"172.19.0.4:47738","uuid":"b1507e08-903a-4717-a945-fcb9e5b96f0c","connectionId":2,"connectionCount":1}}
mongodb_1 | {"t":{"$date":"2023-11-23T07:55:35.796+00:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn1","msg":"Connection ended","attr":{"remote":"172.19.0.4:47728","uuid":"74a471ce-2905-4f2d-b84e-a1335acffcb9","connectionId":1,"connectionCount":0}}
graylog_1 | 2023-11-23 07:55:35,800 INFO : org.graylog2.bootstrap.preflight.MongoDBPreflightCheck - Connected to MongoDB version 5.0.22
graylog_1 | 2023-11-23 07:55:36,029 INFO : org.graylog2.plugin.system.FilePersistedNodeIdProvider - Node ID: 26de8f56-9a50-4063-ac92-47d15e85e9d6
graylog_1 | 2023-11-23 07:55:36,170 ERROR: org.graylog2.storage.versionprobe.VersionProbe - Unable to retrieve version from Elasticsearch node: Failed to connect to opensearch/172.19.0.2:9200. - Connection refused.
graylog_1 | 2023-11-23 07:55:36,171 INFO : org.graylog2.storage.versionprobe.VersionProbe - Elasticsearch is not available. Retry #1
graylog_1 | 2023-11-23 07:55:41,173 ERROR: org.graylog2.storage.versionprobe.VersionProbe - Unable to retrieve version from Elasticsearch node: Failed to connect to opensearch/172.19.0.2:9200. - Connection refused.
graylog_1 | 2023-11-23 07:55:41,174 INFO : org.graylog2.storage.versionprobe.VersionProbe - Elasticsearch is not available. Retry #2
graylog_1 | 2023-11-23 07:55:46,177 ERROR: org.graylog2.storage.versionprobe.VersionProbe - Unable to retrieve version from Elasticsearch node: Failed to connect to opensearch/172.19.0.2:9200. - Connection refused.
graylog_1 | 2023-11-23 07:55:46,178 INFO : org.graylog2.storage.versionprobe.VersionProbe - Elasticsearch is not available. Retry #3
graylog_1 | 2023-11-23 07:55:51,180 ERROR: org.graylog2.storage.versionprobe.VersionProbe - Unable to retrieve version from Elasticsearch node: Failed to connect to opensearch/172.19.0.2:9200. - Connection refused.
graylog_1 | 2023-11-23 07:55:51,181 INFO : org.graylog2.storage.versionprobe.VersionProbe - Elasticsearch is not available. Retry #4
graylog_1 | 2023-11-23 07:55:56,183 ERROR: org.graylog2.storage.versionprobe.VersionProbe - Unable to retrieve version from Elasticsearch node: Failed to connect to opensearch/172.19.0.2:9200. - Connection refused.
graylog_1 | 2023-11-23 07:55:56,184 INFO : org.graylog2.storage.versionprobe.VersionProbe - Elasticsearch is not available. Retry #5
graylog_1 | 2023-11-23 07:56:01,187 ERROR: org.graylog2.storage.versionprobe.VersionProbe - Unable to retrieve version from Elasticsearch node: Failed to connect to opensearch/172.19.0.2:9200. - Connection refused.
graylog_1 | 2023-11-23 07:56:01,188 INFO : org.graylog2.storage.versionprobe.VersionProbe - Elasticsearch is not available. Retry #6
My Compose file is:
version: "3.8"
services:
graylog:
image: "graylog/graylog:5.1"
hostname: "server"
depends_on:
- opensearch
- mongodb
entrypoint: "/usr/bin/tini -- wait-for-it opensearch:9200 -- /docker-entrypoint.sh"
environment:
GRAYLOG_NODE_ID_FILE: "/usr/share/graylog/data/config/node-id"
GRAYLOG_PASSWORD_SECRET: "pepperandsaltsmellsgoodright"
GRAYLOG_ROOT_PASSWORD_SHA2: "password"
GRAYLOG_HTTP_BIND_ADDRESS: "0.0.0.0:9000"
GRAYLOG_HTTP_EXTERNAL_URI: "http://localhost:9000/"
GRAYLOG_ELASTICSEARCH_HOSTS: "http://opensearch:9200"
GRAYLOG_MONGODB_URI: "mongodb://mongodb:27017/graylog"
ports:
- "5044:5044/tcp" # Beats
- "5140:5140/udp" # Syslog
- "5140:5140/tcp" # Syslog
- "5555:5555/tcp" # RAW TCP
- "5555:5555/udp" # RAW TCP
- "9000:9000/tcp" # Server API
- "12201:12201/tcp" # GELF TCP
- "12201:12201/udp" # GELF UDP
- "13301:13301/tcp" # Forwarder data
- "13302:13302/tcp" # Forwarder config
- "5514:5514/udp" # Graylog UDP input for log forwarding
volumes:
- "/home/USER/docker-graylog/volumes/graylog_data:/usr/share/graylog/data/data"
- "/home/USER/docker-graylog/volumes/graylog_journal:/usr/share/graylog/data/journal"
restart: "on-failure"
networks:
- graylog-net
mongodb:
image: "mongo:5.0"
volumes:
- "/home/USER/docker-graylog/volumes/mongodb_data:/data/db"
restart: "on-failure"
networks:
- graylog-net
opensearch:
image: "opensearchproject/opensearch:2.4.0"
environment:
- "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g"
- "bootstrap.memory_lock=true"
- "discovery.type=single-node"
- "action.auto_create_index=false"
- "plugins.security.ssl.http.enabled=false"
- "plugins.security.disabled=true"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- "/home/USER/docker-graylog/volumes/os_data:/usr/share/opensearch/data"
restart: "on-failure"
networks:
- graylog-net
networks:
graylog-net:
driver: bridge
volumes:
mongodb_data:
os_data:
graylog_data:
graylog_journal: