0

I have a project based on Apache Solr and I would like to upgrade the version from 4.7.2 to 7.6, I refer the doc https://github.com/cominvent/solr-tools/tree/master/upgradeindex for upgrading the index from 4.7.2 to 5 and got the below output.

I don't know how to porcedd with the output. Could you please someone suggest me a guidlines for further procceding the entire Solr index upgrade to higher version.

./upgradeindex.sh -t 5 /home/solr
Target version is 5
Downloading http://central.maven.org/maven2/org/apache/lucene/lucene-backward-codecs/4.10.4/lucene-backward-codecs-4.10.4.jar
curl: (7) couldn't connect to host
Downloading http://central.maven.org/maven2/org/apache/lucene/lucene-backward-codecs/5.5.4/lucene-backward-codecs-5.5.4.jar
curl: (7) couldn't connect to host
Downloading http://central.maven.org/maven2/org/apache/lucene/lucene-backward-codecs/6.6.0/lucene-backward-codecs-6.6.0.jar
######################################################################## 100.0%
Downloading http://central.maven.org/maven2/org/apache/lucene/lucene-core/4.10.4/lucene-core-4.10.4.jar
######################################################################## 100.0%
Downloading http://central.maven.org/maven2/org/apache/lucene/lucene-core/5.5.4/lucene-core-5.5.4.jar
######################################################################## 100.0%
Downloading http://central.maven.org/maven2/org/apache/lucene/lucene-core/6.6.0/lucene-core-6.6.0.jar
######################################################################## 100.0%
Core collection1 - /home/solr/collection1
Exception in thread "main" org.apache.lucene.store.LockObtainFailedException: Lock held by another program: /home/solr/collection1/data/index/write.lock
    at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:118)
    at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41)
    at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45)
    at org.apache.lucene.index.CheckIndex.<init>(CheckIndex.java:401)
    at org.apache.lucene.index.CheckIndex.doMain(CheckIndex.java:2671)
    at org.apache.lucene.index.CheckIndex.main(CheckIndex.java:2599)
Exception in thread "main" org.apache.lucene.store.LockObtainFailedException: Lock held by another program: /home/solr/collection1/data/index/write.lock
    at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:118)
    at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41)
    at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45)
    at org.apache.lucene.index.CheckIndex.<init>(CheckIndex.java:362)
    at org.apache.lucene.index.CheckIndex.doMain(CheckIndex.java:2307)
    at org.apache.lucene.index.CheckIndex.main(CheckIndex.java:2235)
- Backing up index to /home/solr/collection1/data/index_backup_4.7.0.tgz
- Index version is 4.7.0, checking integrity
Exception in thread "main" org.apache.lucene.store.LockObtainFailedException: Lock held by another program: /home/solr/collection1/data/index/write.lock
    at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:118)
    at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41)
    at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45)
    at org.apache.lucene.index.CheckIndex.<init>(CheckIndex.java:362)
    at org.apache.lucene.index.CheckIndex.doMain(CheckIndex.java:2307)
    at org.apache.lucene.index.CheckIndex.main(CheckIndex.java:2235)
- Upgrading 4.x -> 5.x
Exception in thread "main" org.apache.lucene.store.LockObtainFailedException: Lock held by another program: /home/solr/collection1/data/index/write.lock
    at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:118)
    at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41)
    at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45)
    at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:776)
    at org.apache.lucene.index.IndexUpgrader.upgrade(IndexUpgrader.java:167)
    at org.apache.lucene.index.IndexUpgrader.main(IndexUpgrader.java:78)
DONE
kellyfj
  • 6,586
  • 12
  • 45
  • 66
bibincatchme
  • 333
  • 4
  • 10
  • When you are running the upgrade have you shut down the Solr 4 instance(s)? – kellyfj Mar 25 '19 at 17:10
  • 1
    Very similar to https://stackoverflow.com/questions/55300930/apache-solr-index-upgrade-from-4-7-to-5-2 – kellyfj Mar 25 '19 at 17:12
  • @kellyfj My Senior Developer posted the same question. I'm Linux admin, also trying to upgrade from 4.7.2 to higher version. Could you please elaborate your query, I've not much knowledge in indexing upgrading. I've not Shut down the solr 4 instance – bibincatchme Mar 26 '19 at 13:10
  • To run the upgrade process (4.x --> 5.x) you need Solr 4 to let go of the lucene file lock so you need to shutdown the Solr 4 instances to be sure no locks are held. – kellyfj Mar 26 '19 at 13:12
  • @kellyfj Could you please explain what is Lucene file lock ? I will try with stop the solr 4 and update you – bibincatchme Mar 26 '19 at 15:50
  • 1
    Solr is a web app built on top of the Lucene framework. Lucene is the piece of software that manages each of the individual search indexes (a "core" in Solr terminology). It is the piece of software managing all the files representing the index. Since it manages all these files it necessarily maintains a file lock on them to keep the files "open". If Lucene has these files locked then no other process e.g. upgrader can write to them (or even perhaps read from them) – kellyfj Mar 26 '19 at 16:16
  • I've stop the solr service and try again to with script, - Index version is 4.7.0, checking integrity - Upgrading 4.x -> 5.x Exception in thread "main" java.lang.IllegalArgumentException: Could not load codec 'Lucene46'. Did you forget to add lucene-backward-codecs.jar? at org.apache.lucene.index.SegmentInfos.readCodec(SegmentInfos.java:481) at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:361) at org.apache.lucene.index.IndexWriter.(IndexWriter.java:910) at org.apache.lucene.index.IndexUpgrader.upgrade(IndexUpgrader.java:167) – bibincatchme Mar 29 '19 at 08:11
  • Caused by: java.lang.IllegalArgumentException: An SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene46' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath. The current classpath supports the following names: [Lucene54] at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:114) at org.apache.lucene.codecs.Codec.forName(Codec.java:113) at org.apache.lucene.index.SegmentInfos.readCodec(SegmentInfos.java:469) ... 4 more DONE – bibincatchme Mar 29 '19 at 08:13

0 Answers0