I am trying to install elasticsearch in a corporate environment where all the machines are behind a proxy. The plugin installer does not seem to respect the http_proxy variable which is very different from virtually all other programs. I've tried many iterations of smth like bin/plugin -Dproxy_host=http://user:pass@host -D proxy_port=8080 , bin/plugin -Dproxy_host=user:pass@host -D proxy_port=8080, bin/plugin -Dproxy_host=http://user:pass@host:8080 -D proxy_port=, but none of them seem to work.
It'd be _so_ much easier if it just respected the environment variable just like everybody else does.
@muelli the plugin script does support proxies, see #7150 and the plugin documentation. You need to specify proxyHost and proxyPort (no underscore).
You can also use it from an environment variable via JAVA_OPTS.
Fair enough. So far, I haven't been able to make it work with the corporate proxy which requires authentication.
Again: If it would respect the http_proxy environment variable, just like everybody else, my life would be a tiny bit happier.
FWIW: I can't make it work with proxies requiring authentication. I've tried bin/plugin -i jdbc -DproxyHost=http://username:[email protected] -D8080. But it fails with "failed to download out of all possible locations..."
However, wget, curl, and friends work just fine. So my (annoying) workaround is to download the plugin first and then use a file:// URI to install the plugin.
@muelli I guess the -D8080 is just a typo on your side and you meant proxyPort?
eh. yes. sorry. I couldn't copy and paste easily as it was on a different machine.
all right, I will take a look, write some tests and also it makes sense to add a CLI option instead of having to set properties.. thx for the report!
@muelli any chance you can test this in your environment maybe?
hm. I guess I need to compile Elasticsearch with that patch. I've never done that and I have other priorities atm, so it might take a while. Or is there a binary available that I can replace my bin/plugin with?
Also, I noted that the proposed change does not respect the http_proxy environment variable. Is there a specific reason other than not having gotten around to do it? That environment variable is surely a standard variable on GNU/Linux system and respecting it dramatically increases the compatibility with those systems.
I don't think that https://github.com/spinscale/elasticsearch/commit/9fa5324a752119076628abcceb27c5aab6dd4606 closes this bug, because this bug report is about respecting http_proxy environment variable. That commit does not achieve that.
I agree... the plugin script should honor any https_proxy or http_proxy environment settings automatically. That is why it's there for programs to see.
@muelli @hulu1522 Thanks for the feedback. I opened #16633 to discuss about it.
Closing in favour of #16633
Most helpful comment
Fair enough. So far, I haven't been able to make it work with the corporate proxy which requires authentication.
Again: If it would respect the
http_proxyenvironment variable, just like everybody else, my life would be a tiny bit happier.