Solr
  1. Solr
  2. SOLR-2805

Add a main method to ZkController so that it's easier to script config upload with SolrCloud

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-ALPHA
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      when scripting a cluster setup, it would be nice if it was easy to upload a set of configs - otherwise you have to wait to start secondary servers until the first server has uploaded the config - kind of a pain

      You should be able to do something like:
      java -classpath .:* org.apache.solr.cloud.ZkController 127.0.0.1:9983 127.0.0.1 8983 solr /home/mark/workspace/SolrCloud/solr/example/solr/conf conf1

        Activity

        Hide
        Eric Pugh added a comment -

        I started working on something like this, and noticed that ZkController is marked "final", why is that? I ended up cut'n'paste into my own class.

        Show
        Eric Pugh added a comment - I started working on something like this, and noticed that ZkController is marked "final", why is that? I ended up cut'n'paste into my own class.
        Hide
        Mark Miller added a comment - - edited

        I tend to limit by default and open when needed I guess.

        FWIW, I've got code for this in the solrcloud branch now.

        It lets you temporily launch a zk server, connects to it, and uploads a set of conf files by calling (from the /solr folder in a checkout):

        java -classpath lib/*:dist/* org.apache.solr.cloud.ZkController 127.0.0.1:9983 127.0.0.1 8983 solr ../example/solr/conf conf1 example/solr/zoo_data
        Show
        Mark Miller added a comment - - edited I tend to limit by default and open when needed I guess. FWIW, I've got code for this in the solrcloud branch now. It lets you temporily launch a zk server, connects to it, and uploads a set of conf files by calling (from the /solr folder in a checkout): java -classpath lib/*:dist/* org.apache.solr.cloud.ZkController 127.0.0.1:9983 127.0.0.1 8983 solr ../example/solr/conf conf1 example/solr/zoo_data
        Hide
        Mark Miller added a comment -

        On the solrcloud branch you can see this used in solrcloud.sh - this script starts up a small cluster for testing during development. One of the first things it does is use this to upload the example config files.

        Show
        Mark Miller added a comment - On the solrcloud branch you can see this used in solrcloud.sh - this script starts up a small cluster for testing during development. One of the first things it does is use this to upload the example config files.
        Hide
        Mark Miller added a comment -

        Here is an up to date example of using the tool (run from the solr directory of a lucene/solr checkout):

        java -classpath lib/*:dist/*:build/lucene-libs/* org.apache.solr.cloud.ZkController 127.0.0.1:9983 example/solr 8983 example/solr/conf conf1
        

        It takes the zookeeper address, solrhome, solr port, conf file dir to upload and the name of the conf set.

        You have to run the dist ant target first with the above example.

        Show
        Mark Miller added a comment - Here is an up to date example of using the tool (run from the solr directory of a lucene/solr checkout): java -classpath lib/*:dist/*:build/lucene-libs/* org.apache.solr.cloud.ZkController 127.0.0.1:9983 example/solr 8983 example/solr/conf conf1 It takes the zookeeper address, solrhome, solr port, conf file dir to upload and the name of the conf set. You have to run the dist ant target first with the above example.
        Hide
        Eric Pugh added a comment -

        I have ported a CLI for ZK, inspired heavily by https://github.com/linkedin/linkedin-zookeeper, but using all Java and some solr stuff, that came out of the ZkController main method. I'd love thoughts on this library. Not sure that it's a Solr thing at all, though that was where I started. I marked as "not intended for inclusion", as I think it's orthogonal to solr, but if you saw value, I'd change that. I may put it up on github..

        Show
        Eric Pugh added a comment - I have ported a CLI for ZK, inspired heavily by https://github.com/linkedin/linkedin-zookeeper , but using all Java and some solr stuff, that came out of the ZkController main method. I'd love thoughts on this library. Not sure that it's a Solr thing at all, though that was where I started. I marked as "not intended for inclusion", as I think it's orthogonal to solr, but if you saw value, I'd change that. I may put it up on github..
        Hide
        Mark Miller added a comment -

        Hey Eric - would love to take a look - did you put this on GitHub?

        Show
        Mark Miller added a comment - Hey Eric - would love to take a look - did you put this on GitHub?
        Hide
        Mark Miller added a comment -

        This is essentially done and in trunk - further improvements can get new issues.

        Show
        Mark Miller added a comment - This is essentially done and in trunk - further improvements can get new issues.

          People

          • Assignee:
            Mark Miller
            Reporter:
            Mark Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development