Reloading SolrCloud configuration (stored on Zookeeper) - schema.xml

后端 未结 4 754
傲寒
傲寒 2020-12-13 10:21

I have setup a SolrCloud replication using standalone zookeeper. But now I wish to make some changes to my Schema.xml and reload the core. The problem is that when I run a s

4条回答
  •  难免孤独
    2020-12-13 11:21

    Below is the Command for Windows,

    IT will be almost same in Unix we just need to change the path of Solr lib and class-path separator ; & : Because its java command so should run in Unix also.

    java  -Dlog4j.configuration="file:E:/solr-5.5.1/server/scripts/cloud-scripts/log4j.properties" -classpath .;E:/solr-5.5.1/server/solr-webapp/webapp/WEB-INF/lib/*;E:/solr-5.5.1/server/lib/ext/* org.apache.solr.cloud.ZkCLI -cmd upconfig -zkhost 192.168.42.13:2787 -confdir E:/New_Solor_Conf -confname Solor_conf
    

    Brief details about command as follows:

    Configuration of log4j for logging.

    • -Dlog4j.configuration="file:E:/solr-5.5.1/server/scripts/cloud-scripts/log4j.properties

    Class path to run "org.apache.solr.cloud.ZkCLI". class.

    make sure UNIX and Windows will have different : (Unix seperator) ;(Windows Separator)

    • -classpath .;E:/solr-5.5.1/server/solr-webapp/webapp/WEB-INF/lib/;E:/solr-5.5.1/server/lib/ext/
    • -zkhost 192.168.42.13:2787 (Remote Host and port where Solr Zookeeper is running)
    • -confdir E:/New_Solor_Conf (Local directory what we need to upload.)
    • -confname Solor_conf Remote instance name.

    If you will not use correct class path you will get error like :

      Error: Could not find or load main class org.apache.solr.cloud.ZkCLI
    

    or

     Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFacto
        ry
                at org.apache.solr.common.cloud.SolrZkClient.(SolrZkClient.java:
        71)
                at org.apache.solr.cloud.ZkCLI.main(ZkCLI.java:183)
        Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
                at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    

    I am able to upload my local configuration changes without physically login to remote Solr box. Hope it will work for other also.

提交回复
热议问题