CentOs Solr6.2.1單機安裝部署步驟

chenfeng發表於2017-12-20
Solr體系結構圖


開始安裝:
到網站下載對應的版本,例如版本6.2.1,下載到/usr/local目錄下

# cd /usr/local
# tar -zxf solr-6.2.1.tgz
# cd /usr/local/solr-6.2.1


修改埠號為8983:
cat /usr/local/solr-6.2.1/server/solr/solr.xml
        .....
<solr>


  <solrcloud>


    <str name="host">${host:192.168.18.68}</str>
    <int name="hostPort">${jetty.port:8983}</int>
    <str name="hostContext">${hostContext:solr}</str>
        ......


啟動服務
# /usr/local/solr-6.2.1/bin/solr start
Waiting up to 30 seconds to see Solr running on port 8983 [/]  
Started Solr server on port 8983 (pid=113190). Happy searching!


驗證服務
# /usr/local/solr-6.2.1/bin/solr status


Found 1 Solr nodes: 


Solr process 113190 running on port 8983
{
  "solr_home":"/usr/local/solr-6.2.1/server/solr",
  "version":"6.2.1 43ab70147eb494324a1410f7a9f16a896a59bc6f - shalin - 2016-09-15 05:20:53",
  "startTime":"2017-12-20T02:05:04.303Z",
  "uptime":"0 days, 0 hours, 5 minutes, 8 seconds",
  "memory":"44 MB (%9) of 490.7 MB"}




訪問Web頁面


瀏覽器輸入 ip:port/sor


http://192.168.18.68:8983/solr/


預設沒有core,需要建立。


core是solr的一個索引庫,可以理解為一個資料庫,core可以根據需要,建立多個.


第一次建立core的時候會報錯,例如建立名字為test的core,Add Core時會報錯
Unable to create core [new_core] Caused by: Can't find resource 'solrconfig.xml' in classpath..



解決方法:
需要在/usr/local/solr-6.2.1/server/solr目錄裡建立一個資料庫目錄,名為test,然後需要把basic_configs裡的conf目錄複製到資料庫目錄裡:
[root@alpha-solr-68 local]# mkdir -p /usr/local/solr-6.2.1/server/solr/test
[root@alpha-solr-68 local]# cp -r /usr/local/solr-6.2.1/server/solr/configsets/basic_configs/conf /usr/local/solr-6.2.1/server/solr/test


需要重啟服務:
[root@alpha-solr-68 local]# /usr/local/solr-6.2.1/bin/solr stop
Sending stop command to Solr running on port 8983 ... waiting 5 seconds to allow Jetty process 113190 to stop gracefully.
[root@alpha-solr-68 local]# 
[root@alpha-solr-68 local]# 
[root@alpha-solr-68 local]# /usr/local/solr-6.2.1/bin/solr start
Waiting up to 30 seconds to see Solr running on port 8983 [/]  
Started Solr server on port 8983 (pid=114488). Happy searching!


再次建立成功:






至此,單機安裝完畢

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2148927/,如需轉載,請註明出處,否則將追究法律責任。

相關文章