I have written a SOLR custom query parser (implementation of org.apache.solr.search.QParser). My query parser uses some third-party jars. One of the third-party jar requires a native library(.so file) to work. This plugin is working fine when running solr in non-cloud mode, but when I run it on cloud mode, SOLR throws these errors:
java.lang.UnsatisfiedLinkError: Native Library /opt/solr-6.2.0/lib/xyz.so already loaded in another classloader
I have kept all my third-party and query parser jars and .so file in SOLR_HOME/lib directory and have modified:
Added lib dir= "${solr.install.dir:../../../..}/lib/" to solrconfig.xml
In SOLR_HOME/bin/solr file:
SOLR_START_OPTS= "-Djava.library.path=$SOLR_TIP/lib/"
Please help. Thanks in advance.
Finally, I found the solution for this(credit goes to my one of my senior). When running in cloud mode, follow these instructions:
lib
directory inside SOLR_HOME
and put native-library(.so) file there. In SOLR_HOME/bin/solr
file, add this line to SOLR_START_OPTS
:
SOLR_START_OPTS= "-Djava.library.path=$SOLR_TIP/lib/"
Create lib
folders in each node library (ie SOLR_HOME/example/cloud/node1/lib, SOLR_HOME/example/cloud/node2/lib) and put all your custom plugin jars into these newly created lib folders.
Restart the solr in cloud mode.
Hope, it will help !
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.