Linux installation and deployment of solr 7.1

Original address: http://peihexian.iteye.com/blog/2398355

1. Download the latest version of solr, the solr 7.1 version used here, download and get a solr-7.1.0.tar compressed package, pay attention to the extension (.tar) here, there is a pit that needs to be dealt with later.

 

2. The second place that cannot be considered a pit is that the installation script of solr for linux is in the compressed package just downloaded, and then the entire compressed package is required when the script runs. . . .

First unzip the installation script separately.

 

tar xzf solr-7.1.0.tar solr-7.1.0/bin/install_solr_service.sh --strip-components=2

 

After execution, the install_solr_service.sh installation script file is obtained.

 

3. Install and configure jdk, configure the JAVA_HOME environment variable

  If there is already a jdk environment in the machine, just configure the JAVA_HOME environment variable directly. If not, go to the Oracle official website to download the latest jdk version. I use the jdk 1.8 rpm compressed package here. After downloading, yum install jdk-8u131-linux-x64 .rpm, it is no problem to allow java -version and javac -version after installation, but I can't find the path under which jdk is installed for me, and I have to find it according to the following method:

  First

 

 

Java code   Favorite code
  1. which java  

 Look at what java is facing. After getting the result, ls -lrt /usr/bin/java, and then ls -lrt /etc/alternatives/java until you find the real jdk installation path and write it down.

 



 

The following is how to configure the JAVA_HOME environment variable. I directly configured it as a system global variable, vi /etc/profile

Add export JAVA_HOME=/usr/java/jdk1.8.0_131 , after saving, source /etc/profile to make the new configuration parameters take effect.

 

4. Install solr

  The root account must be used to run the installation script. Oh, by the way, the hole mentioned above should be filled in. The compressed package downloaded from the official website of solr has a tar extension. The installation script of solr only recognizes tgz or zip format, so first rename the file

 

 

Java code   Favorite code
  1. mv solr-7.1.0.tar solr-7.1.0.tgz  

 

then run the install script

 

Java code   Favorite code
  1. sudo bash ./install_solr_service.sh solr-7.1.0.tgz -i /opt -d /var/solr -u solr -s solr -p 8983  

 

 

 

 

 

 



 

After coming out of this interface, turn off the firewall, and the client machine can use the browser to access port 8983 of the target ip.

 



 That's basically the fucking installation.

-----------------------------------------------------------------

The following is the process of modifying configuration parameters, such as setting the memory size.

 

First find the environment variable configuration parameter file solr.in.sh file for solr work, where is the file, the step is to edit the solr service script to see the settings inside,

 

Java code   Favorite code
  1. vi /etc/init.d/solr  

 

then find


 

The configuration file is in the configuration parameter of SOLR_ENV, here I am /etc/default/solr.in.sh

 

 

Next, edit the solr.in.sh file, and adjust the memory and other parameter configurations according to your needs. Even if you don't adjust the memory settings, you have to find these parameter values ​​at the end of the solr.in.sh file and Remember to use them later.



 

 

 

Next, create a stand-alone version of solr core, and create a new core through the browser core admin


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326072534&siteId=291194637