Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Multistage Build on Docker file " No Elastic Node Aviable " #810

Closed
Navapon opened this issue Jun 26, 2018 · 6 comments
Closed

When Multistage Build on Docker file " No Elastic Node Aviable " #810

Navapon opened this issue Jun 26, 2018 · 6 comments

Comments

@Navapon
Copy link

Navapon commented Jun 26, 2018

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

@olivere
Copy link
Owner

olivere commented 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.

@olivere olivere closed this as completed Jun 26, 2018
@Navapon
Copy link
Author

Navapon commented Jun 26, 2018

actually, my app can access the node I'm trying by exec in the container and curl to elastic directly

screen shot 2561-06-26 at 23 19 00

but when logging this error still happen

screen shot 2561-06-26 at 23 19 33

What i'm doing wrong cause it's work normal when i'm put build file on top image not second images

@olivere
Copy link
Owner

olivere commented 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 olivere reopened this Jun 26, 2018
@olivere
Copy link
Owner

olivere commented Jul 11, 2018

Any news here?

@Navapon
Copy link
Author

Navapon commented Jul 11, 2018

Oh, my bad sorry for no response. After your suggestion, I'm disabled health checks its work fine

@olivere
Copy link
Owner

olivere commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants