0

So I have a rather simple Node.js application running on a single server, using mongoDB as primary database and elasticsearch as a "replica set" with only search-relevant fields indexed in ES. I need the upgrade, because the older version conflicts with fields starting with an underscore (eg. "_id").

Is there a way to upgrade elasticsearch with little to no downtime - without falling back to the mongoDB? Also what's the proper way to backup elasticsearch in this scenario? What would be the steps to restore a backup, in case something goes wrong?

TLDR: what's the proper way to backup and then upgrade between those versions?

BenMann
  • 248
  • 3
  • 15
  • How much data do you have and how long would it take to reindex it? – Val Oct 21 '15 at 03:21
  • Should be really quick! There isn't much data yet. Three collections (of which only two are index by ES) which contain around 200 and 100 items. I'm also looking into other ways to just just get rid of the underscore. Maybe that's an option. – BenMann Oct 21 '15 at 04:44

2 Answers2

2

I would definitely not do that live. And I doubt it's really doable as 0.90 is not compatible with 1.0 when it comes to serialization of data between nodes.

Also, I guess you JVM will need to be updated.

About backup, you should:

  • stop indexing
  • flush remaining operations
  • potentially optimize the index
  • make a copy of each shard of each index (rsync for example)

My 2 cents.

dadoonet
  • 14,109
  • 3
  • 42
  • 49
  • That's bad news.. my java version:"1.7.0_79" OpenJDK Runtime Environment (IcedTea 2.5.6)(7u79-2.5.6-0ubuntu1.14.04.1) OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode) – BenMann Oct 20 '15 at 19:39
0

Since the amount of data you have currently is not that big, maybe the solution is to set up a brand new 1.7 cluster, index your data in it and then flip the switch, i.e. you make your node app you point to the new 1.7 cluster instead of the old 0.90.7 one. That should do the trick.

Note: ES 1.7 ideally requires Java 8 but also supports Java 1.7.0_55 or later, so with 1.7.0_79 you should be good to go on the Java front.

Val
  • 207,596
  • 13
  • 358
  • 360
  • That sounds like a neat solution! Is it possible to run the new 1.7 cluster on the same server - different port or something? I really have to do some more reading on Elasticsearch for cases like this :P – BenMann Oct 21 '15 at 06:38
  • Yes, you can definitely run two ES clusters on the same server, but you need to configure the new one with a different cluster name, diff TCP/HTTP ports, diff data folder, etc. Try it out and don't hesitate to come back if you need some help setting this up (preferably in a new question to not mix things up). – Val Oct 21 '15 at 06:45
  • Thanks a ton! This looks like a decent guide to install a second cluster: http://techhari.blogspot.se/2013/03/elasticsearch-cluster-setup-in-2-minutes.html and i guess the change of ports etc. can simply be done in the elasticsearch.yml. I'll give it a shot when I have the chance (probably tomorrow) and report back here or open a new Q - if needed. – BenMann Oct 21 '15 at 07:18
  • Awesome, let us know! – Val Oct 21 '15 at 07:20