solr-7.7.2 installation and configuration

1. Introduction
Apache Solr is a popular, fast, and open source enterprise search platform based on Apache Lucene. Solr has high reliability, scalability and fault tolerance. It can provide distributed indexing, replication and load balancing queries, automatic failover and recovery, and centralized configuration. Solr provides search and navigation functions for many large Internet sites in the world.
Solr is an independent full-text search server written in Java and running in a servlet container (such as Apache Tomcat or Jetty). Solr uses the Lucene Java search library as the core full-text indexing and search, and has REST-like HTTP/XML and JSON APIs. Solr's powerful external configuration function allows it to be adjusted to suit many types of applications without Java coding.
2. Solr installation
1. Obtain the installation package
wget https://archive.apache.org/dist/lucene/solr/7.7.2/solr-7.7.2.zip
2. Unzip
solr-7.7.2.zip -d /usr/local
3. Create a soft link
ln -s /usr/local/solr-7.7.2 /usr/local/solr
4. Modify the configuration
vim /usr/local/solr/bin/solr.in.sh

#设置内存大小
SOLR_HEAP="512m"
#关闭ulimit检查
SOLR_ULIMIT_CHECKS=false
#时间设置
SOLR_TIMEZONE="UTC+8"

5. Start the service
/usr/local/solr/bin/solr start -p 8983 -force
6. Verification
solr-7.7.2 installation and configuration
3. solrcloud cluster deployment
1. Environment description

operating system zookeeper address solr address
CentOS-7.2 172.16.120.180 172.16.120.201
CentOS-7.2 172.16.120.181 172.16.120.202
CentOS-7.2 172.16.120.182 172.16.120.203

2. The installation and
installation process of zookeeper see: https://blog.51cto.com/7965676/2588531
3. The installation and
installation process of solr see above
4. Modify the configuration
vim /usr/local/solr/bin/solr.in.sh

#指定zookeeper所有节点列表
ZK_HOST="172.16.120.180:2181,172.16.120.181:2181,172.16.120.182:2181”

5. Create a configuration file directory
mkdir /usr/local/solr/server/solr/test/conf
cp -r /usr/local/solr/server/solr/configsets/_default/conf/* /usr/local/solr/server /solr/test/conf/
6. Create a collection (executed on one machine)
/usr/local/solr/bin/solr create_collection -c test -d /usr/local/solr/server/solr/test/conf/ -n test -force
Fourth, common commands #Upload the
configuration file to zookeeper unified management
/usr/local/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost 172.16.120.180:2181,172.16.120.181:2181,172.16 .120.182:2181 -cmd upconfig -confdir /usr/local/solr/server/solr/test/conf -confname test
#Execute
/usr/local/solr/server/scripts/cloud-scripts/zkcli.sh after modifying the confname name -zkhost 172.16.120.180:2181,172.16.120.181:2181,172.16.120.182:2181 --cmd linkconfig -collection test -confname poly #Delete
collection
172.16.120.180:8983/solr/admin/collections?action=DELETE&name=test
# delete slice
172.16.120.180:8983/solr/admin/collections?action=DELETE&name=test&Shards=1
# delete nodes
172.16.120.180:8983/solr /admin/collections?action=DELETE&name=test&Shards=1&replica=core_node1

Guess you like

Origin blog.51cto.com/7965676/2588544