Solr6.3 production environment use (Centos6.5)

installation manual

The installation script installs solr in the /opt directory by default . You can modify the installation location through the -i option , and the script will create a soft link:

/opt/solr-X.0.0

/opt/solr -> /opt/solr-X.0.0

In subsequent version upgrades, this link can be modified to the upgraded solr version directory

Detach writable files

It is installed in the /var/solr directory by default , you can use the -d option to modify the path

create solr user

For security reasons, it is not recommended to use root to run solr , the startup script will refuse to use the root account, and the " solr " user is created by default during installation . You can use the -u option to specify the user, and the user needs to be created before running the script. Complete, install The script will set the ownership of /opt/solr and /var/solr to solr

Run the installation script

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

This command will decompress install_solr_service.sh to the current directory. When running, confirm that lsof is installed on the system ( sudo yum install lsof ) , and the installation script needs root privileges to run

bash ./install_solr_service.sh solr-6.3.0.tgz

The following script works as above

bash ./install_solr_service.sh solr-6.3.0.tgz-i /opt -d /var/solr -u solr –s solr –p 8983

You can customize the installation path, user, service name, port , etc., more options use

 

bash ./install_solr_service.sh -help command to view

After the installation is successful, it will display as follows:

Solr process 4565 running on port 8983

{

  "solr_home":"/var/solr/data",

  "version":"6.3.0 a66a44513ee8191e25b477372094bfa846450316 - shalin - 2016-11-02 19:52:42",

  "startTime":"2016-12-18T06:51:37.926Z",

  "uptime":"0 days, 0 hours, 0 minutes, 17 seconds",

  "memory":"85.4 MB (%17.4) of 490.7 MB"}

 

Check the running status of solr

service solr status

 

Environment variable settings

A series of environment variables for solr are defined in the installation script. If the -s option is used during installation, the generated script will be different. For example, if the service name is solr-demo , the generated script will be /etc/default/solr-demo.in .sh , Solr related parameters can be set in the script ,

#SOLR_JAVA_HOME=""

#SOLR_STOP_WAIT="180"

#SOLR_JAVA_MEM="-Xms512m -Xmx512m"

#ZK_HOST=""

#ZK_CLIENT_TIMEOUT="15000"

#SOLR_LOG_LEVEL=INFO

……

SOLR_PID_DIR="/var/solr"

SOLR_HOME="/var/solr/data"

#Log settings, solr uses log4j to output logs

LOG4J_PROPS="/var/solr/log4j.properties"

SOLR_LOGS_DIR="/var/solr/logs"

SOLR_PORT="8983"

init.d script settings

In the Linux system, it is recommended to set the init.d script. The system can use the service tool to manage the solr service. The default generation path of the installation script is /etc/init.d/solr . After the -s parameter is used, the script with the corresponding name

SOLR_INSTALL_DIR=/opt/solr

SOLR_ENV=/etc/default/solr.in.sh

RUNAS=solr #Set the owner of the solr process, if not set to root , it is not recommended to use root to run in the production environment

 

Support start , stop , restart , status commands

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326808385&siteId=291194637