Installing packages next to cloudron
-
I know I'm not supposed to do this and am fully aware of all possible consequences (this is merely a small development server to play on).
But I would like to install elasticsearch next to cloudron and have nextcloud access it. However, the containers don't seem to be able to call to elasticsearch.
curl "http://localhost:9200"fails withcurl: (7) Failed to connect to localhost port 9200 after 0 ms: Connection refusedI have the feeling there is a way to do that though?
-
If you want to connect to services exposing ports on the host system, then you have to use
172.18.0.1the gateway IP address.localhostwithin the container will refer to the container itself.@nebulon Still running into problems. Running curl on machine via terminal resolves fine:
root@my:~# curl -u elastic:PASSWORD http://localhost:9200 { "name" : "my", "cluster_name" : "elasticsearch", "cluster_uuid" : "LpqIch-iRl2KRaK6-_DvuQ", "version" : { "number" : "8.17.2", "build_flavor" : "default", "build_type" : "deb", "build_hash" : "747663ddda3421467150de0e4301e8d4bc636b0c", "build_date" : "2025-02-05T22:10:57.067596412Z", "build_snapshot" : false, "lucene_version" : "9.12.0", "minimum_wire_compatibility_version" : "7.17.0", "minimum_index_compatibility_version" : "7.0.0" }, "tagline" : "You Know, for Search" }But
root@539fd472-7ce9-455f-80b0-869ffba5faab:/app/code# curl -u elastic:PASSWORD http://172.18.0.1:9200 curl: (28) Failed to connect to 172.18.0.1 port 9200 after 132415 ms: Connection timed outfrom the CLI within the app fails for some reason.
-
To which interfaces is you elasticsearch binding to? Maybe it explicitly only binds to localhost on the host itself and not any other interfaces like the docker bridge?
-
Ah, have you put that port into the allowlist https://docs.cloudron.io/networking/#whitelist-ports ? Generally apps cannot randomly connect to services on the host and requests from within app containers are treated more or less similar to external connections from that perspective.
-
Ah, have you put that port into the allowlist https://docs.cloudron.io/networking/#whitelist-ports ? Generally apps cannot randomly connect to services on the host and requests from within app containers are treated more or less similar to external connections from that perspective.
-
Ah, have you put that port into the allowlist https://docs.cloudron.io/networking/#whitelist-ports ? Generally apps cannot randomly connect to services on the host and requests from within app containers are treated more or less similar to external connections from that perspective.
-
@nebulon Yup that did the trick, thank you
@andreasdueren If you successfully integrate Elastic with Nextcloud - a little writeup a.k.a. community guide would be awesome!
-
@andreasdueren If you successfully integrate Elastic with Nextcloud - a little writeup a.k.a. community guide would be awesome!
@necrevistonnezr It's working, but it is running next to Cloudron which isn't really optimal. I wanted to test and see if it breaks anything though, currently there seem to be no issues.
-
A andreasdueren referenced this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login