You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by bhavik patel <bh...@gmail.com> on 2019/02/26 08:55:49 UTC

Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 8ea728b 


Diff: https://reviews.apache.org/r/70057/diff/1/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.

> On March 18, 2019, 3:14 p.m., Kevin Risden wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 276 (patched)
> > <https://reviews.apache.org/r/70057/diff/4/?file=2132659#file2132659line276>
> >
> >     Seems like there are a bunch of duplicate lines here? Could be refactored to be simpler

Move the code to private. method and invoke when require


- bhavik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213777
-----------------------------------------------------------


On March 18, 2019, 2:58 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 18, 2019, 2:58 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/4/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Kevin Risden <kr...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213777
-----------------------------------------------------------




embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 70 (patched)
<https://reviews.apache.org/r/70057/#comment299768>

    Order of variables is all over the place? Spacing as well.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 247 (patched)
<https://reviews.apache.org/r/70057/#comment299769>

    Spacing all over the place here - Looks like there are tabs/spaces intermingled?



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 276 (patched)
<https://reviews.apache.org/r/70057/#comment299770>

    Seems like there are a bunch of duplicate lines here? Could be refactored to be simpler


- Kevin Risden


On March 18, 2019, 9:58 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 18, 2019, 9:58 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/4/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Oliver Szabo <os...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review214202
-----------------------------------------------------------


Ship it!




Ship It!

(as follow up changes are here: https://issues.apache.org/jira/browse/RANGER-2377)

- Oliver Szabo


On March 28, 2019, 4:10 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 28, 2019, 4:10 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/11/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Zsombor Gegesy <zs...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review214200
-----------------------------------------------------------


Ship it!




Ship It!

- Zsombor Gegesy


On March 28, 2019, 4:10 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 28, 2019, 4:10 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/11/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

(Updated March 28, 2019, 4:10 p.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs (updated)
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 0296652 


Diff: https://reviews.apache.org/r/70057/diff/11/

Changes: https://reviews.apache.org/r/70057/diff/10-11/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.

> On March 28, 2019, 11:36 a.m., Zsombor Gegesy wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 237 (patched)
> > <https://reviews.apache.org/r/70057/diff/10/?file=2134628#file2134628line237>
> >
> >     In this case, when config is not specified correctly, I don't think re-trying the same would make sense

I have shifted the check of zkhost under run() so if no zkhost provided in that it won't even enter connect().


- bhavik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review214169
-----------------------------------------------------------


On March 28, 2019, 4:10 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 28, 2019, 4:10 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/11/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Zsombor Gegesy <zs...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review214169
-----------------------------------------------------------




embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 176 (patched)
<https://reviews.apache.org/r/70057/#comment300361>

    You can move this repeating pattern to a separate function:
    
    void logAndWait(String msg, Exception e) {
       logger.severe(msg + "[retrying after " + time_interval + " ms]", e);
       try {
           Thread.sleep(time_interval);
       } catch (InterruptedException e) {
           logger.info("sleep interrupted: " + e.getMessage());
       }
    }



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 237 (patched)
<https://reviews.apache.org/r/70057/#comment300360>

    In this case, when config is not specified correctly, I don't think re-trying the same would make sense


- Zsombor Gegesy


On March 27, 2019, 1:04 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 27, 2019, 1:04 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/10/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

(Updated March 27, 2019, 1:04 p.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Changes
-------

Removed the support for solr standalone because it was adding complexities.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs (updated)
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 0296652 


Diff: https://reviews.apache.org/r/70057/diff/10/

Changes: https://reviews.apache.org/r/70057/diff/9-10/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

(Updated March 26, 2019, 11:55 a.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs (updated)
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 0296652 


Diff: https://reviews.apache.org/r/70057/diff/9/

Changes: https://reviews.apache.org/r/70057/diff/8-9/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Don Bosco Durai <bo...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213989
-----------------------------------------------------------




embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 134 (patched)
<https://reviews.apache.org/r/70057/#comment300140>

    We should get principal only if it is Kerberos mode. Otherwise, we will be log warning message on every startup


- Don Bosco Durai


On March 25, 2019, 9:42 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 25, 2019, 9:42 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/8/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

(Updated March 25, 2019, 9:42 a.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs (updated)
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 0296652 


Diff: https://reviews.apache.org/r/70057/diff/8/

Changes: https://reviews.apache.org/r/70057/diff/7-8/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Don Bosco Durai <bo...@apache.org>.

> On March 23, 2019, 4:49 p.m., Don Bosco Durai wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 239 (patched)
> > <https://reviews.apache.org/r/70057/diff/7/?file=2133416#file2133416line239>
> >
> >     Any reason we are giving write ot others, but not to group?
> 
> bhavik patel wrote:
>     Solr user will be creating properties file and data dir on standalone location.
>     Added comment for other developer reference

Not sure I understood this:
pfpSet.add(PosixFilePermission.OTHERS_EXECUTE);
					pfpSet.add(PosixFilePermission.OTHERS_READ);
					pfpSet.add(PosixFilePermission.OTHERS_WRITE);
                    
Does this mean everyone (other) has read, write and execute permission?


- Don Bosco


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213946
-----------------------------------------------------------


On March 25, 2019, 9:42 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 25, 2019, 9:42 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/8/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.

> On March 23, 2019, 4:49 p.m., Don Bosco Durai wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
> > Lines 280 (patched)
> > <https://reviews.apache.org/r/70057/diff/7/?file=2133415#file2133415line280>
> >
> >     We are catching the exception and ignoring it. What happens when BootStrap is not started?

We are logging the error and going ahead to start the ranger service. Its like we should not stop ranger from starting in case solr setup is fails for some reason such no live node available , not able to connect etc. If solr setup fails the process should try again after supplied interval of time.


> On March 23, 2019, 4:49 p.m., Don Bosco Durai wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 169 (patched)
> > <https://reviews.apache.org/r/70057/diff/7/?file=2133416#file2133416line169>
> >
> >     Why would these calls give exceptions? If it does, then solrFileDir could be null, which might not be a good thing

basedir can never be null.


> On March 23, 2019, 4:49 p.m., Don Bosco Durai wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 175 (patched)
> > <https://reviews.apache.org/r/70057/diff/7/?file=2133416#file2133416line175>
> >
> >     Don't see any difference for the path in cloud and standalone more.

pathForCloud = {solrFileDir}/contrib/solr_for_audit_setup/conf
pathForStandalone = {solrFileDir}/contrib/solr_for_audit_setup


> On March 23, 2019, 4:49 p.m., Don Bosco Durai wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 239 (patched)
> > <https://reviews.apache.org/r/70057/diff/7/?file=2133416#file2133416line239>
> >
> >     Any reason we are giving write ot others, but not to group?

Solr user will be creating properties file and data dir on standalone location.
Added comment for other developer reference


> On March 23, 2019, 4:49 p.m., Don Bosco Durai wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 377 (patched)
> > <https://reviews.apache.org/r/70057/diff/7/?file=2133416#file2133416line377>
> >
> >     Are we assuming that Solr will be always in Kerberos mode?

Added Kerberos check before calling this method.


> On March 23, 2019, 4:49 p.m., Don Bosco Durai wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 389 (patched)
> > <https://reviews.apache.org/r/70057/diff/7/?file=2133416#file2133416line389>
> >
> >     connect doesn't throw exception, so we should be checking whether it succeeded.

solrCloudClient.connect() is the void method.
i have added null check for zkClient


> On March 23, 2019, 4:49 p.m., Don Bosco Durai wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 599 (patched)
> > <https://reviews.apache.org/r/70057/diff/7/?file=2133416#file2133416line599>
> >
> >     Can we document what we are doing here? Seems we are looping and setting/overwriting this variable in some cases

Added comment as part of method description.


> On March 23, 2019, 4:49 p.m., Don Bosco Durai wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 602 (patched)
> > <https://reviews.apache.org/r/70057/diff/7/?file=2133416#file2133416line602>
> >
> >     Might be good to put couple of lines of documentation on what permissions we are setting and for what purpose

Added comment as part of method description.


- bhavik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213946
-----------------------------------------------------------


On March 25, 2019, 9:42 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 25, 2019, 9:42 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/8/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.

> On March 23, 2019, 4:49 p.m., Don Bosco Durai wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 239 (patched)
> > <https://reviews.apache.org/r/70057/diff/7/?file=2133416#file2133416line239>
> >
> >     Any reason we are giving write ot others, but not to group?
> 
> bhavik patel wrote:
>     Solr user will be creating properties file and data dir on standalone location.
>     Added comment for other developer reference
> 
> Don Bosco Durai wrote:
>     Not sure I understood this:
>     pfpSet.add(PosixFilePermission.OTHERS_EXECUTE);
>     					pfpSet.add(PosixFilePermission.OTHERS_READ);
>     					pfpSet.add(PosixFilePermission.OTHERS_WRITE);
>                         
>     Does this mean everyone (other) has read, write and execute permission?

Removed support for solr standalone.


- bhavik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213946
-----------------------------------------------------------


On March 27, 2019, 1:04 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 27, 2019, 1:04 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/10/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Don Bosco Durai <bo...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213946
-----------------------------------------------------------




embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
Lines 280 (patched)
<https://reviews.apache.org/r/70057/#comment300052>

    We are catching the exception and ignoring it. What happens when BootStrap is not started?



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 89 (patched)
<https://reviews.apache.org/r/70057/#comment300055>

    Good to have the unit in the variable name itself. E.g. _MS for milliseconds or _SEC for seconds.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 169 (patched)
<https://reviews.apache.org/r/70057/#comment300053>

    Why would these calls give exceptions? If it does, then solrFileDir could be null, which might not be a good thing



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 175 (patched)
<https://reviews.apache.org/r/70057/#comment300054>

    Don't see any difference for the path in cloud and standalone more.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 239 (patched)
<https://reviews.apache.org/r/70057/#comment300059>

    Any reason we are giving write ot others, but not to group?



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 257 (patched)
<https://reviews.apache.org/r/70057/#comment300058>

    Can we give enough information? E.g. collection name



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 261 (patched)
<https://reviews.apache.org/r/70057/#comment300060>

    Same here, give more information of the context during error



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 377 (patched)
<https://reviews.apache.org/r/70057/#comment300061>

    Are we assuming that Solr will be always in Kerberos mode?



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 389 (patched)
<https://reviews.apache.org/r/70057/#comment300062>

    connect doesn't throw exception, so we should be checking whether it succeeded.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 511 (patched)
<https://reviews.apache.org/r/70057/#comment300056>

    Can we print all parameters? Including solr_config_name, max_node_per_shards, etc.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 599 (patched)
<https://reviews.apache.org/r/70057/#comment300063>

    Can we document what we are doing here? Seems we are looping and setting/overwriting this variable in some cases



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 602 (patched)
<https://reviews.apache.org/r/70057/#comment300064>

    Might be good to put couple of lines of documentation on what permissions we are setting and for what purpose


- Don Bosco Durai


On March 22, 2019, 10:03 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 22, 2019, 10:03 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/7/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

(Updated March 22, 2019, 10:03 a.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs (updated)
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 0296652 


Diff: https://reviews.apache.org/r/70057/diff/7/

Changes: https://reviews.apache.org/r/70057/diff/6-7/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Kevin Risden <kr...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213885
-----------------------------------------------------------




embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 570 (patched)
<https://reviews.apache.org/r/70057/#comment299997>

    So there could be a method that you just send in the list of ACLs to update? I don't think it makes sense to duplicate most of the logic here.


- Kevin Risden


On March 21, 2019, 11:36 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 21, 2019, 11:36 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/6/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

(Updated March 21, 2019, 4:36 p.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs (updated)
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 0296652 


Diff: https://reviews.apache.org/r/70057/diff/6/

Changes: https://reviews.apache.org/r/70057/diff/5-6/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.

> On March 21, 2019, 12:24 a.m., Kevin Risden wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
> > Lines 570 (patched)
> > <https://reviews.apache.org/r/70057/diff/5/?file=2132831#file2132831line570>
> >
> >     Lines 570-607 are the same as lines 609-646? Looks like maybe copy/paste or something.
> >     
> >     Note: Did not open in an IDE just eyeballing. They are close enough.

Lines 570-607 => its for setting ACLOnConfigPath
lines 609-646 =>its for setting ACLOnCollectionPath


- bhavik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213868
-----------------------------------------------------------


On March 19, 2019, 3:12 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 19, 2019, 3:12 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/5/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Kevin Risden <kr...@apache.org>.

> On March 20, 2019, 7:24 p.m., Kevin Risden wrote:
> >

Overall, looks a lot better. I don't commit to Ranger but just saw that it related to Solr. So trying to be helpful and review. :)


- Kevin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213868
-----------------------------------------------------------


On March 19, 2019, 10:12 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 19, 2019, 10:12 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/5/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Kevin Risden <kr...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213868
-----------------------------------------------------------




embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 173 (patched)
<https://reviews.apache.org/r/70057/#comment299977>

    Do we need to worry about say Windows? Might not want to constuct the path as a String. Paths.get may be helpful here.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 479 (patched)
<https://reviews.apache.org/r/70057/#comment299978>

    Path has a toFile() option



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java
Lines 570 (patched)
<https://reviews.apache.org/r/70057/#comment299976>

    Lines 570-607 are the same as lines 609-646? Looks like maybe copy/paste or something.
    
    Note: Did not open in an IDE just eyeballing. They are close enough.


- Kevin Risden


On March 19, 2019, 10:12 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 19, 2019, 10:12 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 0296652 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/5/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

(Updated March 19, 2019, 3:12 p.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs (updated)
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 0296652 


Diff: https://reviews.apache.org/r/70057/diff/5/

Changes: https://reviews.apache.org/r/70057/diff/4-5/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

(Updated March 18, 2019, 2:58 p.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs (updated)
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrCollectionBoostrapper.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 0296652 


Diff: https://reviews.apache.org/r/70057/diff/4/

Changes: https://reviews.apache.org/r/70057/diff/3-4/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.

> On March 14, 2019, 11:44 p.m., Oliver Szabo wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
> > Lines 63 (patched)
> > <https://reviews.apache.org/r/70057/diff/3/?file=2132313#file2132313line63>
> >
> >     overall, it's much closer for that how i thought it first how it should work. 
> >     
> >     few things:
> >     - would make sense to rename this thread to something else, because it's not realy a util class, maybe SolrCollectionBoostrapper or something similar.
> >     
> >     - not only ranger should be used as sasl user (like ranger should be able to edit the configs, but solr user as well), it should be a way to provide additional users, because with Ambari/CM, that will be needed.
> >     
> >     - what if solrconfig.xml is changed on the filesystem? because it should be uploaded again by the bootstrapper on startup. (TTL can be changed in the solrconfig.xml, but in that case we can just upload that file, as for example, managed-schema mostly edited by Solr itself, so that one should not be touched) ... so that solrconfig.xml file should be downloaded to the application memory from the znode and check is it differs from the uploaded one. 
> >     
> >     - an atomic shared variable would be useful (for example that can be passed by the constructor) that can be used even on REST API side to filter out any Solr Query and answer that Solr is not ready yet (or ZK) ... but this is not really essential of course

1.) Changed the name from SolrSetupUtil.java to SolrCollectionBoostrapper.java
2.) Added new prop for sasl users
3.) When any changes are been made in solrconfig.xml, as it the configuration changes we need to restart the ranger. On restart we check the content of solrconfig.xml in uploadConfiguration() ---> doIfConfigExists() ---> updateConfigIfNeeded() and in case it differ we do re upload new solrconfig.xml


- bhavik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213730
-----------------------------------------------------------


On March 14, 2019, 3:31 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 14, 2019, 3:31 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 8ea728b 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/3/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Oliver Szabo <os...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213730
-----------------------------------------------------------




embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 63 (patched)
<https://reviews.apache.org/r/70057/#comment299706>

    overall, it's much closer for that how i thought it first how it should work. 
    
    few things:
    - would make sense to rename this thread to something else, because it's not realy a util class, maybe SolrCollectionBoostrapper or something similar.
    
    - not only ranger should be used as sasl user (like ranger should be able to edit the configs, but solr user as well), it should be a way to provide additional users, because with Ambari/CM, that will be needed.
    
    - what if solrconfig.xml is changed on the filesystem? because it should be uploaded again by the bootstrapper on startup. (TTL can be changed in the solrconfig.xml, but in that case we can just upload that file, as for example, managed-schema mostly edited by Solr itself, so that one should not be touched) ... so that solrconfig.xml file should be downloaded to the application memory from the znode and check is it differs from the uploaded one. 
    
    - an atomic shared variable would be useful (for example that can be passed by the constructor) that can be used even on REST API side to filter out any Solr Query and answer that Solr is not ready yet (or ZK) ... but this is not really essential of course


- Oliver Szabo


On March 14, 2019, 3:31 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 14, 2019, 3:31 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 8ea728b 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/3/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

(Updated March 14, 2019, 3:31 p.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs (updated)
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 8ea728b 


Diff: https://reviews.apache.org/r/70057/diff/3/

Changes: https://reviews.apache.org/r/70057/diff/2-3/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.

> On Feb. 26, 2019, 12:56 p.m., Zsombor Gegesy wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
> > Lines 204 (patched)
> > <https://reviews.apache.org/r/70057/diff/2/?file=2126968#file2126968line204>
> >
> >     I don't get, why do you want to return an empty list here - I guess, you can't do anything after this, the code will only report, that 'Core with name ... Already exists' - which is misleading.
> >     
> >     I would rather not catch these exceptions here.

In this case returning null.


> On Feb. 26, 2019, 12:56 p.m., Zsombor Gegesy wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
> > Lines 334 (patched)
> > <https://reviews.apache.org/r/70057/diff/2/?file=2126968#file2126968line334>
> >
> >     Am I right, that you just want to upload one file, which name match getConfigFileName()? 
> >     
> >     If yes, then it's simpler to check if 'getConfigSetFolder()/getConfigFileName()' exists, and just upload that.

I also need to check the content inside.


> On Feb. 26, 2019, 12:56 p.m., Zsombor Gegesy wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
> > Lines 415 (patched)
> > <https://reviews.apache.org/r/70057/diff/2/?file=2126968#file2126968line415>
> >
> >     Catching Throwable is not too good solution - if you really want to log problems here, please pick a more specific Exception, and rethrow it after the log.
> >     
> >     Or just remove this catch, and throw the exception to the caller as is - I mean, the original, specific exception

I think its good to catch any exception here because it will let us know exactly on which operation exception occured. In this case like while "creating collection"


> On Feb. 26, 2019, 12:56 p.m., Zsombor Gegesy wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
> > Lines 510 (patched)
> > <https://reviews.apache.org/r/70057/diff/2/?file=2126968#file2126968line510>
> >
> >     Catching Exception is not too good solution - if you really want to log problems here, please pick a more specific exception, and rethrow it after the log.
> >     
> >     Or just remove this catch, and throw the exception to the caller as is - I mean, the original, specific exception

I think its good to catch any exception here because it will let us know exactly on which operation exception occured. In this case like while "setting acl"


> On Feb. 26, 2019, 12:56 p.m., Zsombor Gegesy wrote:
> > embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
> > Lines 531 (patched)
> > <https://reviews.apache.org/r/70057/diff/2/?file=2126968#file2126968line531>
> >
> >     I don't think, that you can do anything, if you can't talk to Solr, and you don't get the collections, I would rather have the exception propagated to the top.

In this case returning null.


- bhavik


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213222
-----------------------------------------------------------


On March 14, 2019, 3:31 p.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated March 14, 2019, 3:31 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-default-site.xml 686f720 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 8ea728b 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/3/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by Zsombor Gegesy <zs...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/#review213222
-----------------------------------------------------------




embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 97 (patched)
<https://reviews.apache.org/r/70057/#comment299102>

    The convention for constants in Java is full upper case, eg CONFIG_FILES



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 101 (patched)
<https://reviews.apache.org/r/70057/#comment299103>

    The convention for constants in Java is full upper case, eg CONFIG_FILE



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 111 (patched)
<https://reviews.apache.org/r/70057/#comment299105>

    This can be a constructor - without the startProcess call, and maybe taking a 'configFile' parameter. 
    
    This way, most of the variables can be set to final.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 169 (patched)
<https://reviews.apache.org/r/70057/#comment299104>

    Tabs and whitespaces are a bit inconsistently used.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 184 (patched)
<https://reviews.apache.org/r/70057/#comment299108>

    I would rather re-throw an exception from here, and handle it with System.exit in the EmbeddedWebServer code.
    
    Or just remove this catch, and allow throwing the exception to the caller as is.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 203 (patched)
<https://reviews.apache.org/r/70057/#comment299117>

    I guess, the log messages are copy pasted from getCollections() call :-)



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 204 (patched)
<https://reviews.apache.org/r/70057/#comment299106>

    I don't get, why do you want to return an empty list here - I guess, you can't do anything after this, the code will only report, that 'Core with name ... Already exists' - which is misleading.
    
    I would rather not catch these exceptions here.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 240 (patched)
<https://reviews.apache.org/r/70057/#comment299107>

    Catching Throwable is not too good solution - if you really want to log problems here, please pick a more specific Exception, and rethrow it after the log.
    
    Or just remove this catch, and throw the exception to the caller as is.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 258 (patched)
<https://reviews.apache.org/r/70057/#comment299109>

    solrClient is never null here - it is just initialized to non-null a line before.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 278 (patched)
<https://reviews.apache.org/r/70057/#comment299110>

    Catching Throwable is not too good solution - if you really want to log problems here, please pick a more specific Exception, and rethrow it after the log.
    
    Or just remove this catch, and throw the exception to the caller as is - I mean, the original, specific exception



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 291 (patched)
<https://reviews.apache.org/r/70057/#comment299111>

    You can use java.nio.file.FileSystem more easily:
    
    File tmpDir = FileSystem.getPath(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString(), "RangerAudit")).toFile();



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 308 (patched)
<https://reviews.apache.org/r/70057/#comment299118>

    Catching Throwable is not too good solution - if you really want to log problems here, please pick a more specific Exception, and rethrow it after the log.
    
    Or just remove this catch, and throw the exception to the caller as is - I mean, the original, specific exception



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 334 (patched)
<https://reviews.apache.org/r/70057/#comment299112>

    Am I right, that you just want to upload one file, which name match getConfigFileName()? 
    
    If yes, then it's simpler to check if 'getConfigSetFolder()/getConfigFileName()' exists, and just upload that.



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 356 (patched)
<https://reviews.apache.org/r/70057/#comment299113>

    You can use Path/FileSystem directly as in previous locations



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 368 (patched)
<https://reviews.apache.org/r/70057/#comment299114>

    You can use Path/FileSystem directly as in previous locations



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 374 (patched)
<https://reviews.apache.org/r/70057/#comment299115>

    You can use Path/FileSystem directly as in previous locations



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 415 (patched)
<https://reviews.apache.org/r/70057/#comment299119>

    Catching Throwable is not too good solution - if you really want to log problems here, please pick a more specific Exception, and rethrow it after the log.
    
    Or just remove this catch, and throw the exception to the caller as is - I mean, the original, specific exception



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 510 (patched)
<https://reviews.apache.org/r/70057/#comment299116>

    Catching Exception is not too good solution - if you really want to log problems here, please pick a more specific exception, and rethrow it after the log.
    
    Or just remove this catch, and throw the exception to the caller as is - I mean, the original, specific exception



embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java
Lines 531 (patched)
<https://reviews.apache.org/r/70057/#comment299120>

    I don't think, that you can do anything, if you can't talk to Solr, and you don't get the collections, I would rather have the exception propagated to the top.


- Zsombor Gegesy


On Feb. 26, 2019, 10:17 a.m., bhavik patel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70057/
> -----------------------------------------------------------
> 
> (Updated Feb. 26, 2019, 10:17 a.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2324
>     https://issues.apache.org/jira/browse/RANGER-2324
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> We are handling the solr bootstrapping in below mentioned manner for Ranger
> 1.) Connection to solr
> 2.) Upload Configuration
> 3.) Create Collection
> 4.) Setting ACL
> 
> 
> Diffs
> -----
> 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
>   embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java PRE-CREATION 
>   security-admin/scripts/install.properties fdcee1b 
>   security-admin/scripts/setup.sh bd4bd4c 
>   security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
>   src/main/assembly/admin-web.xml 8ea728b 
> 
> 
> Diff: https://reviews.apache.org/r/70057/diff/2/
> 
> 
> Testing
> -------
> 
> Tested Below Scenario on ranger manual start / restart
> 1.) Solr configuration were uploaded successfully
> 2.) Solr collections were created successfully
> 3.) ACL were setup as required.
> 
> 
> Thanks,
> 
> bhavik patel
> 
>


Re: Review Request 70057: RANGER-2324 Bootstrapping Solr in Ranger service start-up

Posted by bhavik patel <bh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/70057/
-----------------------------------------------------------

(Updated Feb. 26, 2019, 10:17 a.m.)


Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni, Madhan Neethiraj, Oliver Szabo, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja Polavarapu, and Velmurugan Periasamy.


Bugs: RANGER-2324
    https://issues.apache.org/jira/browse/RANGER-2324


Repository: ranger


Description
-------

We are handling the solr bootstrapping in below mentioned manner for Ranger
1.) Connection to solr
2.) Upload Configuration
3.) Create Collection
4.) Setting ACL


Diffs (updated)
-----

  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java 8d32352 
  embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/SolrSetupUtil.java PRE-CREATION 
  security-admin/scripts/install.properties fdcee1b 
  security-admin/scripts/setup.sh bd4bd4c 
  security-admin/src/main/resources/conf.dist/ranger-admin-site.xml 4d4a1de 
  src/main/assembly/admin-web.xml 8ea728b 


Diff: https://reviews.apache.org/r/70057/diff/2/

Changes: https://reviews.apache.org/r/70057/diff/1-2/


Testing
-------

Tested Below Scenario on ranger manual start / restart
1.) Solr configuration were uploaded successfully
2.) Solr collections were created successfully
3.) ACL were setup as required.


Thanks,

bhavik patel