> On Sept. 9, 2019, 3:16 p.m., Don Bosco Durai wrote: > > plugin-solr/src/main/java/org/apache/ranger/services/solr/client/ServiceSolrConnectionMgr.java > > Line 33 (original), 35 (patched) > > <https://reviews.apache.org/r/71449/diff/1/?file=2164383#file2164383line35> > > > > Instead of spliting the URLs and taking the last URL, can we support > > SolrCloud client using Zookeeper? > > Kehua Wu wrote: > Thank you for your reply! > However, in some scenarios, SolrCloud does not require ZooKeeper to work > with. For example, my own test environment is just a simple SolrCloud mode > without Zookeeper, so I think the way Solr Url needs to be retained. But in > the future, I can open a new feature list to support the SolrCloud > configuration method of ZooKeeper. > > Don Bosco Durai wrote: > In your current implementation, you are connecting to the last Solr URL > in the list. So if that Solr instance is down, we won't be automatically > connecting to the other URLs. Correct me if I am wrong. I feel, the correct > implementation will be to use Zookeeper, else we have to modify our calling > code to use other Solr URLs when one of them fails with connection error. > > Kehua Wu wrote: > Thank you, but my implementation logic is to select the first connection > in the Solr URL to connect, if the connection fails, take the next one until > it succeeds. > And the method "getSolrClient" will be called every time when testing > connection or get SolrCloud resources. > > org.apache.ranger.services.solr.client.ServiceSolrConnectionMgr.getSolrClient(String, > Map<String, String>) > So every time Ranger connects to SolrCloud, it will try every Solr URL > connection until it succeeds.
I am not sure whether it works like the way you are envisioning. Can you test by bringing your Solr instance down in alternate order, but don't restart your Ranger. Also, I was not aware you can have SolrCloud without Zookeeper. Can you point to the documentation which mentions how to create SolrCloud without Zookeeper. I can do a quick test. Thanks - Don Bosco ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/71449/#review217653 ----------------------------------------------------------- On Sept. 9, 2019, 8:23 a.m., Kehua Wu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/71449/ > ----------------------------------------------------------- > > (Updated Sept. 9, 2019, 8:23 a.m.) > > > Review request for ranger, Ankita Sinha, Don Bosco Durai, Colm O > hEigeartaigh, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Mehul Parikh, > Nitin Galave, pengjianhua, Pradeep Agrawal, Ramesh Mani, Selvamohan > Neethiraj, Sailaja Polavarapu, sam rome, Venkat Ranganathan, Velmurugan > Periasamy, Qiang Zhang, and Barna Zsombor Klara. > > > Bugs: RANGER-2562 > https://issues.apache.org/jira/browse/RANGER-2562 > > > Repository: ranger > > > Description > ------- > > When create a new Solr service, we can set only one Solr URL, but as we know > Solr cloud model has more than one Solr service, so we should support for > configuration of multiple Solr URLs in the Solr service. > > eg. > > When I set "http://192.166.1.1:18983/solr" for "Solr URL" in the Solr > service, I click the "Test Connection" button, it will be ok, it shows > "Connected Successfully." > > But when I set "http://192.166.1.1:18983/solr,http://192.166.1.2:28983/solr" > for "Solr URL" in the Solr service, I click the "Test Connection" button, it > will show "Connection Failed." > > > Diffs > ----- > > > plugin-solr/src/main/java/org/apache/ranger/services/solr/client/ServiceSolrConnectionMgr.java > f56373b > > > Diff: https://reviews.apache.org/r/71449/diff/1/ > > > Testing > ------- > > > Thanks, > > Kehua Wu > >