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

Support for remote path in reindex api #22913

Closed
huawangpp opened this issue Feb 1, 2017 · 8 comments
Closed

Support for remote path in reindex api #22913

huawangpp opened this issue Feb 1, 2017 · 8 comments
Labels
:Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >enhancement v6.4.0 v7.0.0-beta1

Comments

@huawangpp
Copy link

Elasticsearch version: 5.x

Plugins installed: []

JVM version:

OS version:

Describe the feature:
In the 5.x reindex api, support for remote is added, e.g,
POST _reindex
{
"source": {
"remote": {
"host": "http://otherhost:9200",
"username": "user",
"password": "pass"
},
...

However the host property is strictly enforced to three parts, scheme, host and port. We host elasticsearch behind a proxy and need the ability to specify a path too. I found code in https://github.com/elastic/elasticsearch/blob/v5.2.0/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestReindexAction.java, that enforces this rule.

...
private static final Pattern HOST_PATTERN = Pattern.compile("(?[^:]+)://(?[^:]+):(?\d+)");
...

Can we add the support for path?

@nik9000
Copy link
Member

nik9000 commented Feb 2, 2017

Can we add the support for path?

Is everything in elasticsearch prefixed with some path? Like curl -XGET proxy/elasticsearch gets root url and curl -XPOST proxy/elasticsearch/test/_search is how you'd do a search? If so, path prefix wouldn't be too hard to add.

@clintongormley
Copy link

a path prefix is supported by most of the REST clients too (including the Java REST client)

@huawangpp
Copy link
Author

@nik9000, the url is like http://host:port/path for us. There is no additional elasticsearch needed in the url, e.g, curl -XPOST proxy/test/_search

@alsyia
Copy link

alsyia commented Jul 11, 2017

We are accessing ES endpoints through a reverse proxy, and this would be really useful.

@lcawl lcawl added :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. and removed :Reindex API labels Feb 13, 2018
@ajhewett
Copy link

Just got bitten by this. We also have ES endpoints behind reverse proxies and are not able to use them as a source for remote reindex.
Our url is like http://host:port/elasticsearch

@DaveyDevOps
Copy link

Also a problem for us since we keep elastic behind a load balancer.

@suraj-soni
Copy link

Any updates on this ? I just got bitten by this one as well

@bleskes
Copy link
Contributor

bleskes commented May 22, 2018

@suraj-soni no concrete plans at the moment. That said, we will definitely help anyone that is willing put up a PR.

@bleskes bleskes removed the help wanted adoptme label Jun 12, 2018
@vladimirdolzhenko vladimirdolzhenko self-assigned this Jun 12, 2018
vladimirdolzhenko pushed a commit to vladimirdolzhenko/elasticsearch that referenced this issue Jun 13, 2018
vladimirdolzhenko added a commit that referenced this issue Jun 15, 2018
Support for remote path in reindex api
Closes #22913
vladimirdolzhenko pushed a commit that referenced this issue Jun 15, 2018
Closes #22913

(cherry picked from commit dbc9d60)
dnhatn added a commit that referenced this issue Jun 19, 2018
* 6.x:
  Add get stored script and delete stored script to high level REST API
  Increasing skip version for failing test on 6.x
  Skip get_alias tests for 5.x (#31397)
  Fix defaults in GeoShapeFieldMapper output (#31302)
  Test: better error message on failure
  Mute DefaultShardsIT#testDefaultShards test
  Fix reference to XContentBuilder.string() (#31337)
  [DOCS] Adds monitoring breaking change (#31369)
  [DOCS] Adds security breaking change (#31375)
  [DOCS] Backports breaking change (#31373)
  RestAPI: Reject forcemerge requests with a body (#30792)
  Docs: Use the default distribution to test docs (#31251)
  Use system context for cluster state update tasks (#31241)
  [DOCS] Adds testing for security APIs (#31345)
  [DOCS] Removes ML item from release highlights
  [DOCS] Removes breaking change (#31376)
  REST high-level client: add validate query API (#31077)
  Move language analyzers from server to analysis-common module. (#31300)
  Expose lucene's RemoveDuplicatesTokenFilter (#31275)
  [Test] Fix :example-plugins:rest-handler on Windows
  Delete typos in SAML docs (#31199)
  Ensure we don't use a remote profile if cluster name matches (#31331)
  Test: Skip alias tests that failed all weekend
  [DOCS] Fix version in SQL JDBC Maven template
  [DOCS] Improve install and setup section for SQL JDBC
  Add ingest-attachment support for per document `indexed_chars` limit (#31352)
  SQL: Fix rest endpoint names in node stats (#31371)
  [DOCS] Fixes small issue in release notes
  Support for remote path in reindex api Closes #22913
  [ML] Put ML filter API response should contain the filter (#31362)
  Remove trial status info from start trial doc (#31365)
  [DOCS] Added links in breaking changes pages
  [DOCS] Adds links to release notes and highlights
  Docs: Document changes in rest client
  QA: Fix tribe tests to use node selector
  REST Client: NodeSelector for node attributes (#31296)
  LLClient: Fix assertion on windows
  LLClient: Support host selection (#30523)
  Add QA project and fixture based test for discovery-ec2 plugin (#31107)
  [ML] Hold ML filter items in sorted set (#31338)
  [ML] Add description to ML filters (#31330)
dnhatn added a commit that referenced this issue Jun 19, 2018
* master:
  Add get stored script and delete stored script to high level REST API - post backport fix
  Add get stored script and delete stored script to high level REST API (#31355)
  Core: Combine Action and GenericAction (#31405)
  Fix reference to XContentBuilder.string() (#31337)
  Avoid sending duplicate remote failed shard requests (#31313)
  Fix defaults in GeoShapeFieldMapper output (#31302)
  RestAPI: Reject forcemerge requests with a body (#30792)
  Packaging: Remove windows bin files from the tar distribution (#30596)
  Docs: Use the default distribution to test docs (#31251)
  [DOCS] Adds testing for security APIs (#31345)
  Clarify that IP range data can be specified in CIDR notation. (#31374)
  Use system context for cluster state update tasks (#31241)
  Percentile/Ranks should return null instead of NaN when empty (#30460)
  REST high-level client: add validate query API (#31077)
  Move language analyzers from server to analysis-common module. (#31300)
  [Test] Fix :example-plugins:rest-handler on Windows
  Expose lucene's RemoveDuplicatesTokenFilter (#31275)
  Reload secure settings for plugins (#31383)
  Remove some cases in FieldTypeLookupTests that are no longer relevant. (#31381)
  Ensure we don't use a remote profile if cluster name matches (#31331)
  [TEST] Double write alias fault (#30942)
  [DOCS] Fix version in SQL JDBC Maven template
  [DOCS] Improve install and setup section for SQL JDBC
  SQL: Fix rest endpoint names in node stats (#31371)
  Support for remote path in reindex api - post backport fix Closes #22913
  [ML] Put ML filter API response should contain the filter (#31362)
  Support for remote path in reindex api (#31290)
  Add byte array pooling to nio http transport (#31349)
  Remove trial status info from start trial doc (#31365)
  [DOCS] Adds links to release notes and highlights
  add is-write-index flag to aliases (#30942)
  Add rollover-creation-date setting to rolled over index (#31144)
  [ML] Hold ML filter items in sorted set (#31338)
  [Tests] Fix edge case in ScriptedMetricAggregatorTests (#31357)
@jimczi jimczi removed the v7.0.0 label Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >enhancement v6.4.0 v7.0.0-beta1
Projects
None yet
Development

No branches or pull requests