Sunday, July 15, 2012

Installing Solr 3.6.0 on Ubuntu from source


1. Make a solr user

    useradd -d /opt/solr solr

2. Download a tarball of Solr 3.6.0 and install to /opt/solr

    wget http://archive.apache.org/dist/lucene/solr/3.6.0/apache-solr-3.6.0.tgz
    tar -zxf apache-solr-3.6.0.tgz
    mv apache-solr-3.6.0 /opt/solr
    chown -R solr /opt/solr

4. Make log directory

    mkdir /var/log/solr
    chown solr /var/log/solr

5. Create Upstart job at /etc/init/solr.conf:

    description "Solr"


    start on runlevel [2345]
    stop on runlevel [016]
    respawn


    exec su solr -l -c "cd /opt/solr/example && java -Dsolr.solr.home=/etc/solr -Djetty.port=8080 -Djetty.host=0.0.0.0 -Djetty.logs=/var/log/solr -jar start.jar > /var/log/solr/stdouterr.log 2>&1"

6. Create the base data directory for cores:

    mkdir /var/lib/solr
    chown solr /var/lib/solr

7. Make /etc/solr/solr.xml:

    <?xml version="1.0" encoding="UTF-8" ?>
    <solr persistent="false">
      <cores adminPath="/admin/cores">
        <core name="example.com" instanceDir="/etc/solr/example.com">
          <property name="dataDir" value="/var/lib/solr/example.com/data" />
        </core>
      </cores>
    </solr>

8. Make core conf in /etc/solr/example.com/conf/{schema.xml,solrconfig.xml}

1 comment:

  1. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in TECHNOLOGY , kindly Contact MaxMunus
    MaxMunus Offer World Class Virtual Instructor led training on TECHNOLOGY. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 1,00,000 + trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Saurabh srivastava
    MaxMunus
    E-mail: saurabh@maxmunus.com
    Skype id: saurabhmaxmunus
    Ph:+918553576305
    www.MaxMunus.com


    ReplyDelete