Ok, I understand. I succeeded to create Docker container w/ Solr in standalone mode (non-cloud). Enough to test some features, but in the future we will use non-embedded Zookeeper for production use.
Thanks again. BR, Tom On Thu, 27 Sep 2018 at 15:34, Mike Thomsen <mikerthom...@gmail.com> wrote: > Tom, > > What I meant was a "non-production" sort of test. You definitely wouldn't > want to build anything mission-critical using Solr w/ embedded ZooKeeper > instead of multiple Solr nodes w/ a full production-grade ZooKeeper cluster. > > With that said, I'm pretty rusty w/ Solr (been using ElasticSearch instead > for going on 2 years), but this should suffice: > > docker run --name SOMETHING -p 8983:8983 -d solr:latest > > That'll bring up a vanilla single node of non-Cloud Solr that you can mess > with. > > Beyond that, you're going to need to dig into Solr documentation on doing > a Docker deployment of a cluster. > > One caveat about Python is the last time my colleagues and I used Python > w/ SolrCloud, the API we used skipped ZooKeeper and went directly to an > enumerated list of Solr nodes that we provided. So I would not consider > your experience with Python to be fungible with the Java APIs because they > use ZooKeeper for SolrCloud. > > Mike > > On Thu, Sep 27, 2018 at 9:24 AM Tomislav Novosel <to.novo...@gmail.com> > wrote: > >> Hi Mike, thanks for the answer. >> >> How should I configure PutSolrContentStream processor to go directly to >> Solr? >> This is not a local test. Docker with running Solr container is on remote >> server. >> I don't understand how can I access Solr collection on docker host >> address and Solr port <Docker hostname>:<Solr port> >> from Python script using pysolr, but from Nifi I can't do that. >> >> BR, >> Tom >> >> On Thu, 27 Sep 2018 at 14:28, Mike Thomsen <mikerthom...@gmail.com> >> wrote: >> >>> I think I've run into similar problems with SolrCloud in the past w/ >>> Docker. SolrCloud stores the IP address it binds to in ZooKeeper, which is >>> why you see the Docker internal IP address there and not localhost:8983 >>> since presumably you're using localhost:<ZK_PORT> as the Solr Location. I >>> think you can force Solr to use a particular IP address with an environment >>> variable on startup. >>> >>> If this is a local test, you shouldn't have any problems skipping >>> ZooKeeper and going straight to Solr since the interface is the same >>> between cloud and non-cloud Solr for everything that matters here. >>> >>> On Thu, Sep 27, 2018 at 7:56 AM Tomislav Novosel <to.novo...@gmail.com> >>> wrote: >>> >>>> Hi all, >>>> >>>> >>>> >>>> I'm trying to put data in Solr Index using Nifi. Solr is v7.5.0 and >>>> Nifi is v1.6.0. >>>> >>>> I'm using PutSolrContentStream processor and Solr in Solrcloud mode >>>> with embedded zookeeper >>>> >>>> Inside docker container. I exposed Solr admin port and zookeeper port >>>> to be accessible through browser. >>>> >>>> >>>> >>>> I configured Nifi processor to Solr Cloud, gave collection name and >>>> Solr location(hostname where docker with Solr container is >>>> >>>> and port to embedded zookeeper) >>>> >>>> >>>> >>>> After I tried to put data into collection, i got error: >>>> >>>> >>>> >>>> rg.apache.solr.client.solrj.SolrServerException: No live SolrServers >>>> available to handle this request:[ >>>> http://172.17.0.16:8983/solr/monitoringapi_shard1_replica_n1] >>>> >>>> at >>>> org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:382) >>>> >>>> at >>>> org.apache.solr.client.solrj.impl.CloudSolrClient.sendRequest(CloudSolrClient.java:1291) >>>> >>>> at >>>> org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:1061) >>>> >>>> at >>>> org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:997) >>>> >>>> at >>>> org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:149) >>>> >>>> at >>>> org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:166) >>>> >>>> at >>>> org.apache.nifi.processors.solr.PutSolrContentStream$1.process(PutSolrContentStream.java:242) >>>> >>>> at >>>> org.apache.nifi.controller.repository.StandardProcessSession.read(StandardProcessSession.java:2207) >>>> >>>> at >>>> org.apache.nifi.controller.repository.StandardProcessSession.read(StandardProcessSession.java:2175) >>>> >>>> at >>>> org.apache.nifi.processors.solr.PutSolrContentStream.onTrigger(PutSolrContentStream.java:199) >>>> >>>> at >>>> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27) >>>> >>>> at >>>> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1147) >>>> >>>> at >>>> org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:175) >>>> >>>> at >>>> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117) >>>> >>>> at >>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) >>>> >>>> at >>>> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) >>>> >>>> at >>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) >>>> >>>> at >>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) >>>> >>>> at >>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) >>>> >>>> at >>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) >>>> >>>> at java.lang.Thread.run(Thread.java:748) >>>> >>>> Caused by: org.apache.solr.client.solrj.SolrServerException: Server >>>> refused connection at: >>>> http://172.17.0.16:8983/solr/monitoringapi_shard1_replica_n1 >>>> >>>> at >>>> org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:599) >>>> >>>> at >>>> org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:261) >>>> >>>> at >>>> org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:250) >>>> >>>> at >>>> org.apache.solr.client.solrj.impl.LBHttpSolrClient.doRequest(LBHttpSolrClient.java:403) >>>> >>>> at >>>> org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:355) >>>> >>>> ... 20 common frames omitted >>>> >>>> Caused by: java.net.ConnectException: Connection timed out: connect >>>> >>>> at >>>> java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) >>>> >>>> at >>>> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) >>>> >>>> at >>>> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) >>>> >>>> at >>>> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) >>>> >>>> at >>>> java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) >>>> >>>> at >>>> java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) >>>> >>>> at java.net.Socket.connect(Socket.java:589) >>>> >>>> at >>>> org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117) >>>> >>>> at >>>> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177) >>>> >>>> at >>>> org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304) >>>> >>>> at >>>> org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611) >>>> >>>> at >>>> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446) >>>> >>>> at >>>> org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882) >>>> >>>> at >>>> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) >>>> >>>> at >>>> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107) >>>> >>>> at >>>> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) >>>> >>>> at >>>> org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:497) >>>> >>>> ... 24 common frames omitted >>>> >>>> >>>> >>>> I checked in Solr Admin web UI and everything is fine, shards and >>>> replicas are alive, zookeeper is alive and running. >>>> >>>> I also tried to put data using REST API from Python (pysolr) and >>>> everything is working fine, but with Nifi doesn't. >>>> >>>> What could be the issue? Please help. >>>> >>>> >>>> >>>> BR, >>>> >>>> Tom >>>> >>>