Closed
Description
Using ElasticSearch Version
[ ] elastic.v6 (for Elasticsearch 6.1.2)
Please describe the expected behavior
Expect move binary file to small images && Can run normally
I'm wanna use Docker multistage build images with Olivere / elastic
but when I'm trying to move an executed go binary file from builder stage has to error
time=09-09-26068 09:09:00 level=error msg=no active connection found: no Elasticsearch node available host=045b4f45f939 layer=STORAGE model=NewElastic
But !! if i don't move execute file from builder stage just leave it in to builder container and delete seconds build stage this error is not happen i'm currious what i'm missing
Is this library require some lib. Below is my Dockerfile
FROM 3dsinteractive/go-librdkafka:v1 as builder
ADD ./api-consumer/ /go/
WORKDIR /go/src/pushandmotion.com/pushconsumer
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh && \
dep ensure && \
go build -o /app/pushconsumer -tags static_all
#This can run normally
ENTRYPOINT ["/app/pushconsumer"]
EXPOSE 8000
#Promblem is happen when copy binary file from builder
FROM alpine:3.6
WORKDIR /root/
COPY --from=builder /app/pushconsumer .
ENTRYPOINT ["/root/pushconsumer"]
Please describe the actual behavior
When move execute file to small image has promble " No Elastic Node Aviable "
I'm already open elasticsearch in browser and ping inside the container it's work fine
Activity
olivere commentedon Jun 26, 2018
This doesn't have to do anything with Docker and/or multi-stage builds. It has to do something with the way sniffing works (see details in the Wiki). The node IPs are probably not accessible from your application.
Navapon commentedon Jun 26, 2018
actually, my app can access the node I'm trying by exec in the container and curl to elastic directly
but when logging this error still happen
What i'm doing wrong cause it's work normal when i'm put build file on top image not second images
olivere commentedon Jun 26, 2018
Okay. When you enable sniffing, it will retrieve the node IPs from the
http.publish_address
. And that seems to be routeable, you're right.Where does that
msg=health check timeout: ...
come from? Is that a prefix you use, or does it come from Elastic? Because that might actually mean that sniffing works, but health checks don't.Can you try to disable health checks temporarily to see if that makes a difference?
olivere commentedon Jul 11, 2018
Any news here?
Navapon commentedon Jul 11, 2018
Oh, my bad sorry for no response. After your suggestion, I'm disabled health checks its work fine
olivere commentedon Jul 20, 2018
@Navapon I have been trying to reproduce this with https://github.com/olivere/elastic-with-docker (now updated to work with ES 6.x), but I couldn't. Maybe you can try it with that repo, and I'll re-open here if you can get the bug there. Thank you.