I have created Solr war file followed process as mentioned in https://gist.github.com/fschiettecatte/836d13be0c95f1fd159e45d3af861952 as I want to run Solr as standalone application through my specific version of jetty server.
After creating war file I started solr through jetty successfully by
running below command:
$ java -Djetty.home=/var/solr -Djetty.base=/var/solr
-Dsolr.solr.home=/var/solr/solr -Dsolr.log.dir=/var/solr/solr
-Dbootstrap_confdir=/var/solr/solr/conf -Dcollection.configName=conf
-DzkRun -Djava.util.logging.config.file=/var/solr/solr/solr-log.properties
-jar /var/solr/start.jar
2021-08-20 07:49:40.869:INFO::main: Logging initialized @155ms to
org.eclipse.jetty.util.log.StdErrLog
2021-08-20 07:49:41.021:INFO:oejs.Server:main: jetty-9.4.18.v20190429;
built: 2019-05-10T18:03:12.512Z; git:
7ef7435fd940d3eb73c256b765d93aff5849c6e8; jvm 11.0.5+10
2021-08-20 07:49:41.029:INFO:oejdp.ScanningAppProvider:main:
Deployment monitor [file:///data/git/runtime/solr/webapps/] at
interval 1
2021-08-20 07:49:41.568:INFO:oejw.StandardDescriptorProcessor:main: NO
JSP Support for /solr, did not find
org.apache.jasper.servlet.JspServlet
2021-08-20 07:49:41.572:INFO:oejs.session:main:
DefaultSessionIdManager workerName=node0
2021-08-20 07:49:41.573:INFO:oejs.session:main: No SessionScavenger
set, using defaults
2021-08-20 07:49:41.573:INFO:oejs.session:main: node0 Scavenging every 600000ms
2021-08-20 07:49:41.575:WARN:oejs.SecurityHandler:main:
[email protected]@294425a7{solr,/solr,file:///tmp/jetty-0.0.0.0-8983-solr.war-_solr-any-17126331786779836602.dir/webapp/,STARTING}{/solr.war}
has uncovered http methods for path: /
ERROR StatusLogger No Log4j 2 configuration file found. Using default
configuration (logging only errors to the console), or user
programmatically provided configurations. Set system property
'log4j2.debug' to show Log4j 2 internal initialization logging. See
https://logging.apache.org/log4j/2.x/manual/configuration.html for
instructions on how to configure Log4j 2
2021-08-20 07:49:43.647:INFO:oejsh.ContextHandler:main: Started
o.e.j.w.WebAppContext@294425a7{solr,/solr,file:///tmp/jetty-0.0.0.0-8983-solr.war-_solr-any-17126331786779836602.dir/webapp/,AVAILABLE}{/solr.war}
2021-08-20 07:49:43.652:INFO:oejs.AbstractConnector:main: Started
ServerConnector@6da9dc6{HTTP/1.1,[http/1.1]}{0.0.0.0:8983}
2021-08-20 07:49:43.653:INFO:oejs.Server:main: Started @2939ms
My solr is working just fine I run few command to verify:
$ curl "http://0.0.0.0:8983/solr/admin/collections?action=clusterstatus&wt=xml"
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">19</int>
</lst>
<lst name="cluster">
<lst name="collections"/>
<arr name="live_nodes">
<str>192.168.1.2:8983_solr</str>
</arr>
</lst>
</response>
When I tried to create core it was failing with below error, before
running this command I created folder name “a10” under solr home directory “/var/solr/solr/cores”
$ curl "http://0.0.0.0:8983/solr/admin/cores?action=CREATE&name=a10&instanceDir=cores/a10&shard=shard10&collection=conf1&coreNodeName=a10&wt=xml"
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">400</int>
<int name="QTime">10067</int>
</lst>
<lst name="error">
<lst name="metadata">
<str name="error-class">org.apache.solr.common.SolrException</str>
<str name="root-error-class">org.apache.solr.cloud.ZkController$NotInClusterStateException</str>
</lst>
<str name="msg">Error CREATEing SolrCore 'a10': coreNodeName a10 does
not exist in shard shard10, ignore the exception if the replica was
deleted</str>
<int name="code">400</int>
</lst>
</response>
Backtrace because of this error in jetty console:
07:54:36.047 [qtp466505482-21] ERROR org.apache.solr.handler.RequestHandlerBase - org.apache.solr.common.SolrException: Error CREATEing SolrCore 'a1': coreNodeName a1 does not exist in shard shard1, ignore the exception if the replica was deleted at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1136) at org.apache.solr.handler.admin.CoreAdminOperation.lambda$static$0(CoreAdminOperation.java:92) at org.apache.solr.handler.admin.CoreAdminOperation.execute(CoreAdminOperation.java:360) at org.apache.solr.handler.admin.CoreAdminHandler$CallInfo.call(CoreAdminHandler.java:396) at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:180) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:199) at org.apache.solr.servlet.HttpSolrCall.handleAdmin(HttpSolrCall.java:758) at org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:739) at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:511) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:395) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:341) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) at org.eclipse.jetty.server.Server.handle(Server.java:505) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:132) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:724) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:830) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: org.apache.solr.cloud.ZkController$NotInClusterStateException: coreNodeName a1 does not exist in shard shard1, ignore the exception if the replica was deleted at org.apache.solr.cloud.ZkController.checkStateInZk(ZkController.java:1874) at org.apache.solr.cloud.ZkController.preRegister(ZkController.java:1773) at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1180) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1097) ... 41 more