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

[FEATURE] migration guide from spring-data-elasticsearch to spring-data-opensearch #13

Open
rursprung opened this issue Oct 10, 2022 · 19 comments
Labels
enhancement New feature or request

Comments

@rursprung
Copy link

Is your feature request related to a problem?

all users were so far stuck on spring-data-elasticsearch (incompatible with OpenSearch 2.x) and will now want to switch to spring-data-opensearch (once available).

What solution would you like?

please provide a clear step-by-step migration guide on how to migrate an existing project from spring-data-elasticsearch to spring-data-opensearch.
if it is supported (cf. also #12) also mention how a project can support both Elasticsearch and OpenSearch in parallel (only ES 7.10.2 & older; maybe even all 7.x and maybe there's even a way for a project to support OpenSearch & ES 8.x in parallel, e.g. by picking the library at runtime?)

What alternatives have you considered?

everyone can figure it out on their own, leading to greater variation in how it's implemented and lots of questions around it.

Do you have any additional context?

n/a

@rursprung rursprung added the enhancement New feature or request label Oct 10, 2022
@dblock
Copy link
Member

dblock commented Oct 11, 2022

@rursprung It's a good idea. Any interest in contributing? I think we should have USER_GUIDE ala https://github.com/opensearch-project/opensearch-js/blob/main/USER_GUIDE.md, and either make migration a section of it, or a separate MIGRATION_GUIDE.md or UPGRADING.md.

@Neuw84
Copy link

Neuw84 commented Oct 25, 2022

Hi @dblock,

I could contribute if needed :).

Moreover, I have a project https://github.com/aws-samples/opensearch-bootful with Elastic Libraries that I will upgrade with OpenSearch libraries ( will document the process).

Let me know!

@dblock
Copy link
Member

dblock commented Oct 26, 2022

@Neuw84 Amazing! Please do. Also note that we have made a lot of progress on https://github.com/opensearch-project/opensearch-java, so depending on what your sample does use that if you need a client.

@wbeckler
Copy link

@Neuw84 The client has made big strides, now includes sigv4 and is on track for Maven soon. What's your thinking on the documentation?

@Neuw84
Copy link

Neuw84 commented Jan 19, 2023

Hi!

As soon as we have it on Maven will work on it. I tried to upgrade everything like three weeks ago but I got stuck on the manually install the packages ( I know the procedure but I though that if was better to wait).

When do you think that is going to be available on Maven? :)

Bests!

@rursprung
Copy link
Author

When do you think that is going to be available on Maven? :)

in -2 weeks 😆: https://repo1.maven.org/maven2/org/opensearch/client/
(there's also a tag for it in git, but it hasn't been made an official GitHub release yet, so it's not that clearly visible - @reta maybe you'd want to turn that tag into a GitHub Release so it's more prominent?)

@Neuw84
Copy link

Neuw84 commented Jan 19, 2023 via email

@reta
Copy link
Collaborator

reta commented Jan 19, 2023

When do you think that is going to be available on Maven? :)

in -2 weeks 😆: https://repo1.maven.org/maven2/org/opensearch/client/ (there's also a tag for it in git, but it hasn't been made an official GitHub release yet, so it's not that clearly visible - @reta maybe you'd want to turn that tag into a GitHub Release so it's more prominent?)

Thanks a lot for cheerful comments @rursprung ! The 0.1.0 is a pre-release, there is a one minor issue to address with test artifact name but .... things turned out to be more complicated [1], [2] so I don't know when we could have an official release :)

[1] #75
[2] #87

@Neuw84
Copy link

Neuw84 commented Jan 20, 2023

Well, will wait to that security review and the proceed.

My idea is to rebase my repo on top on SpringBoot 3.0 and migrate all the libraries to OpenSearch ones ( and use that process for the guide).

@Neuw84
Copy link

Neuw84 commented Mar 22, 2023

Hi @reta,

Seems that both issues and security review has finished.

Will work on this issue as soon as I can 👍

@reta
Copy link
Collaborator

reta commented Mar 22, 2023

Hey @Neuw84 , thanks a lot!

@Neuw84
Copy link

Neuw84 commented Mar 22, 2023

Hi,

I have been upgrading the code to SpringBoot 3.0.

Some comments ( maybe a little guidance will be great). If I use password based auth I got it working. The only problem that I have is that I get node sniffer problems

2023-03-22T13:30:31.894+01:00 ERROR 38719 --- [nt_sniffer[T#1]] org.opensearch.client.sniff.Sniffer      : error while sniffing nodes
java.net.ConnectException: Connection refused

My client is configured this way

        final ClientConfiguration clientConfiguration = ClientConfiguration.builder()
                .connectedTo(endpoint)
                .usingSsl()
                .withBasicAuth("user","pass")
                .withConnectTimeout(Duration.ofSeconds(10))
                .withSocketTimeout(Duration.ofSeconds(5))
                .build();

I suppose that is related to this issue?

opensearch-project/OpenSearch#3487

@reta
Copy link
Collaborator

reta commented Mar 23, 2023

@Neuw84 I am curious how to do run the OpenSearch server? locally / managed / Docker?

@Neuw84
Copy link

Neuw84 commented Mar 23, 2023

@reta ,

Managed on AWS. Maybe is because it can´t communicate with the nodes directly? (Amazon OpenSearch Service just exposes an endpoint).

Anyway, I have upgraded the code to use OpenSearch libraries and will start working on the migration guide (I also have working code with Elastic libraries).

https://github.com/aws-samples/opensearch-bootful

Will update this post!

@reta
Copy link
Collaborator

reta commented Mar 23, 2023

@Neuw84

Managed on AWS. Maybe is because it can´t communicate with the nodes directly? (Amazon OpenSearch Service just exposes an endpoint).

Exactly, I believe sniffer gets internal IPs which are not accessible.

Anyway, I have upgraded the code to use OpenSearch libraries and will start working on the migration guide (I also have working code with Elastic libraries).

Thank you very much, super helpful

@navaneeth-spotnana
Copy link

@reta I am also facing the same issue with AWS Managed Elasticsearch. Is it possible to disable the sniffer? Is that a good idea?

@reta
Copy link
Collaborator

reta commented Apr 21, 2023

@navaneeth-spotnana

Is it possible to disable the sniffer?

Yes, you just need to remove the pensearch-rest-client-sniffer dependency

Is that a good idea?

I mean in this case it is not useful and only contributes to error logging, so yeah, it is good idea (in this context)

@N4zroth
Copy link

N4zroth commented Aug 16, 2023

When migrating, am I supposed to continue using the (now deprecated) ElasticsearchRestTemplate or should I switch to OpenSearchRestTemplate?

@reta
Copy link
Collaborator

reta commented Aug 16, 2023

When migrating, am I supposed to continue using the (now deprecated) ElasticsearchRestTemplate or should I switch to OpenSearchRestTemplate?

The OpenSearchRestTemplate is the right one

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

No branches or pull requests

7 participants