E
E
evgeniyguba2020-04-12 11:38:31
symfony
evgeniyguba, 2020-04-12 11:38:31

Using ElasticsearchLogstashHandler inside Docker?

there is such an instruction: https://jolicode.com/blog/how-to-visualize-symfony...
Briefly - it tells how to raise 2 containers with kibana and elasticsearch, connect ElasticsearchLogstashHandler (which comes with the monologue) in Symphony.

These two containers + the container with Symfony are united by one network. But there is a problem:

by default, the ElasticsearchLogstashHandler itself tries to make a request to elasticksearch via curl at
127.0.0.1:9200 the symphony inside the container wants to shoot at 127.0.0.1, but it can't because inside itself, it independently creates its own internal ip-address.

I see several solutions:
1. Symphony somehow determines the internal ip address of the network in which it spins and passes this ip to the ElasticsearchLogstashHandler arguments

2. When creating a container with elascticsearch, forward the ip address inside = 127.0.0.1

3. When creating a network, explicitly specify what would the internal ip-address be 127.0.0.1

Maybe someone faced a similar task?
Maybe this can be solved much easier than I painted here?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
serginhold, 2020-04-12
@evgeniyguba

most likely instead of ip you need to substitute the name of the container
when you write something like this in docker-compose:

mysql:
    image: mysql:5.7

you pass host='mysql' to the docrine, not ip
ps https://github.com/symfony/monolog-bridge/blob/fd9...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question