Install Solr
Install Solr at /opt/solr. First, download Solr:
:- # cd /opt/solr
:- # wget http://mirror.symnds.com/software/Apache/lucene/...add version name Find it.......>>>>> (Solr version Name click here)
Uncompress the file:
:- # tar -xzvf ./solr..... press Tab
Now the directory /opt/solr/solr-5.1.0 will contain all the Solr files.
Install Java
First, check if Java is already installed:
:- # which java
If not installed, install the latest version (1.8 in this example):
:- # yum list available java*
:- # yum install java-1.8.0-openjdk.x86_64
Verify install:
:- # which java
[...]
# java -version
openjdk version "1.8.0_45"
OpenJDK Runtime Environment (build 1.8.0_45-b13)
OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)
Start Solr
Start Solr
Next start Solr and test instance:
:- # cd /opt/solr/solr.......pres Tab
:- # bin/solr start -noprompt
Verify Solr is running:
:- # ps aux | grep solr
[...]
# lsof -i :8983
[...]
:- # cd /opt/solr/solr-5.1.0
Auto Start Solr
Finally, Solr can be setup as a service that starts when the server boots. Create the script file /etc/init.d/solr and add:
Finally, Solr can be setup as a service that starts when the server boots. Create the script file /etc/init.d/solr and add:
--------------------------------------------------------------------------------------------------------------------------
#!/bin/sh
#!/bin/sh
# chkconfig: 2345 95 20
# description: Solr Server
# Solr Server service start, stop, restart
# @author Shay Anderson 04.15
SOLR_DIR="/opt/solr/solr-5.1.0"
case $1 in
start)
echo "Starting Solr..."
$SOLR_DIR/bin/solr start -noprompt
sleep 1
lsof -i :8983
;;
stop)
echo "Stopping Solr..."
$SOLR_DIR/bin/solr stop
;;
restart)
$0 stop
sleep 2
$0 start
;;
status)
$SOLR_DIR/bin/solr status
;;
*)
echo "Usage: $0 [start|stop|restart]"
exit 1
;;
esac
exit 0
--------------------------------------------------------------------------------------------------------------------------
Save the file and set permissions:
Save the file and set permissions:
:- # chmod +x /etc/init.d/solr
:-
Now the Solr service can be started/stopped using:
:- # service solr start
[...]
# service solr stop
[...]
Enable auto start service on server boot:
# cd /etc/init.d
# chkconfig --add solr
# chkconfig | grep solr
Now the Solr service will start on server boot.
Create New Core
A new core can be created using:
:- # cd /opt/solr/solr-5.1.0
:- # bin/solr create -c mycore
Check It ..... your IP (Domin):8983 ...EX 192.168.0.205:8983
if you are not able to access then check firewall & change rule open this port 8983 then it, will start working properly.
you are not use the no firewall so you will add this port on firewall rule's
:-# sudo iptables -I INPUT -p tcp --dport 8983 -j ACCEPT
:-# sudo service iptables save
0 comments:
Post a Comment