Step 1: Installing Java
Solr requires Java, so we will install it if you didn't install it before
First, use apt-get to install python-software-properties:
sudo apt-get install python-software-properties
Install the latest version of Java 8 instead of using the default-jdk or default-jre packages
sudo add-apt-repository ppa:webupd8team/java
You will need to press ENTER to accept adding the repository to your index.
Update the source list and install Java8:
sudo apt-get update
sudo apt-get install oracle-java8-installer
Step 2: Installing Solr
We will begin by downloading the Sorl distribution
wget http://apache.mirror1.spango.com/lucene/solr/5.3.1/solr-5.3.1.tgz
Extract the service installation file:
tar xzf solr-5.3.1.tgz solr-5.3.1/bin/install_solr_service.sh --strip-components=2
Install Solr as a service using the script:
bash ./install_solr_service.sh solr-5.3.1.tgz
Check if the server is running:
sudo service solr status
Step 3: Creating a Collection
Solr canhave mutiple collections, so you can create a collection by browser at this address: http://localhost:8983/solr/#/~cores or by command:
Note: Options of solr servicesudo su - solr -c "/opt/solr/bin/solr create -c collection_name -n data_driven_schema_configs"
Or/etc/init.d/solr {start|stop|restart|status}
sudo service solr {start|stop|restart|status}
0 comments:
Post a Comment