在Ubuntu 20 上安装 Apache Solr8

1. 下载APACHE Solr

把solr文件放在/opt路径下面。

2. 解压Solr

unzip solr-8.11.1.zip

3.启动 solr

sudo bin/solr start -e cloud -force
xc194@dku-dspace-app-dev-01:/opt/solr-8.11.1$ sudo bin/solr start -e cloud -force

Welcome to the SolrCloud example!

This interactive session will help you launch a SolrCloud cluster on your local workstation.
To begin, how many Solr nodes would you like to run in your local cluster? (specify 1-4 nodes) [2]: 

Ok, let's start up 2 Solr nodes for your example SolrCloud cluster.
Please enter the port for node1 [8983]: 

Please enter the port for node2 [7574]: 

Creating Solr home directory /opt/solr-8.11.1/example/cloud/node1/solr
Cloning /opt/solr-8.11.1/example/cloud/node1 into
   /opt/solr-8.11.1/example/cloud/node2

Starting up Solr on port 8983 using command:
"bin/solr" start -cloud -p 8983 -s "example/cloud/node1/solr" -force

Waiting up to 180 seconds to see Solr running on port 8983 [-]  
Started Solr server on port 8983 (pid=1214969). Happy searching!

    
Starting up Solr on port 7574 using command:
"bin/solr" start -cloud -p 7574 -s "example/cloud/node2/solr" -z localhost:9983 -force

Waiting up to 180 seconds to see Solr running on port 7574 [/]  
Started Solr server on port 7574 (pid=1215273). Happy searching!

INFO  - 2022-01-04 02:33:58.973; org.apache.solr.common.cloud.ConnectionManager; Waiting for client to connect to ZooKeeper
INFO  - 2022-01-04 02:33:58.990; org.apache.solr.common.cloud.ConnectionManager; zkClient has connected
INFO  - 2022-01-04 02:33:58.991; org.apache.solr.common.cloud.ConnectionManager; Client is connected to ZooKeeper
INFO  - 2022-01-04 02:33:59.023; org.apache.solr.common.cloud.ZkStateReader; Updated live nodes from ZooKeeper... (0) -> (2)
INFO  - 2022-01-04 02:33:59.037; org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider; Cluster at localhost:9983 ready

Now let's create a new collection for indexing documents in your 2-node cluster.
Please provide a name for your new collection: [gettingstarted] 
techproducts

4.关闭

sudo bin/solr delete -c techproducts
sudo bin/solr stop -all 
sudo rm -Rf example/cloud/

实际操作:

xc194@dku-dspace-app-dev-01:/$ cd /opt/solr-8.11.1/
xc194@dku-dspace-app-dev-01:/opt/solr-8.11.1$ sudo bin/solr delete -c techproducts
{
  "responseHeader":{
    "status":0,
    "QTime":283},
  "success":{
    "10.200.14.130:8983_solr":{"responseHeader":{
        "status":0,
        "QTime":37}},
    "10.200.14.130:7574_solr":{"responseHeader":{
        "status":0,
        "QTime":87}}}}


Deleted collection 'techproducts' using command:
http://10.200.14.130:7574/solr/admin/collections?action=DELETE&name=techproducts
xc194@dku-dspace-app-dev-01:/opt/solr-8.11.1$ sudo bin/solr stop -all
Sending stop command to Solr running on port 8983 ... waiting up to 180 seconds to allow Jetty process 1279119 to stop gracefully.
Sending stop command to Solr running on port 7574 ... waiting up to 180 seconds to allow Jetty process 1279323 to stop gracefully.
xc194@dku-dspace-app-dev-01:/opt/solr-8.11.1$ sudo rm -Rf example/cloud/
xc194@dku-dspace-app-dev-01:/opt/solr-8.11.1$ 

参考:Solr Tutorial | Apache Solr Reference Guide 7.7

你可能感兴趣的:(solr,ubuntu,apache,linux)