- Apache Solr 教程
- Apache Solr - 首頁
- Apache Solr - 概述
- Apache Solr - 搜尋引擎基礎
- Apache Solr - Windows 環境
- Apache Solr - 在 Hadoop 上
- Apache Solr - 架構
- Apache Solr - 術語
- Apache Solr - 基本命令
- Apache Solr - Core
- Apache Solr - 索引資料
- Apache Solr - 新增文件 (XML)
- Apache Solr - 更新資料
- Apache Solr - 刪除文件
- Apache Solr - 檢索資料
- Apache Solr - 查詢資料
- Apache Solr - 分面搜尋
- Apache Solr 有用資源
- Apache Solr - 快速指南
- Apache Solr - 有用資源
- Apache Solr - 討論
Apache Solr - 基本命令
啟動 Solr
安裝 Solr 後,瀏覽到 Solr 主目錄中的 **bin** 資料夾,並使用以下命令啟動 Solr。
[Hadoop@localhost ~]$ cd [Hadoop@localhost ~]$ cd Solr/ [Hadoop@localhost Solr]$ cd bin/ [Hadoop@localhost bin]$ ./Solr start
此命令在後臺啟動 Solr,並在埠 8983 上監聽,並顯示以下訊息。
Waiting up to 30 seconds to see Solr running on port 8983 [\] Started Solr server on port 8983 (pid = 6035). Happy searching!
在前景啟動 Solr
如果使用 **start** 命令啟動 **Solr**,則 Solr 將在後臺啟動。相反,您可以使用 **–f 選項** 在前景啟動 Solr。
[Hadoop@localhost bin]$ ./Solr start –f 5823 INFO (coreLoadExecutor-6-thread-2) [ ] o.a.s.c.SolrResourceLoader Adding 'file:/home/Hadoop/Solr/contrib/extraction/lib/xmlbeans-2.6.0.jar' to classloader 5823 INFO (coreLoadExecutor-6-thread-2) [ ] o.a.s.c.SolrResourceLoader Adding 'file:/home/Hadoop/Solr/dist/Solr-cell-6.2.0.jar' to classloader 5823 INFO (coreLoadExecutor-6-thread-2) [ ] o.a.s.c.SolrResourceLoader Adding 'file:/home/Hadoop/Solr/contrib/clustering/lib/carrot2-guava-18.0.jar' to classloader 5823 INFO (coreLoadExecutor-6-thread-2) [ ] o.a.s.c.SolrResourceLoader Adding 'file:/home/Hadoop/Solr/contrib/clustering/lib/attributes-binder1.3.1.jar' to classloader 5823 INFO (coreLoadExecutor-6-thread-2) [ ] o.a.s.c.SolrResourceLoader Adding 'file:/home/Hadoop/Solr/contrib/clustering/lib/simple-xml-2.7.1.jar' to classloader …………………………………………………………………………………………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………………………………………………………………………………. 12901 INFO (coreLoadExecutor-6-thread-1) [ x:Solr_sample] o.a.s.u.UpdateLog Took 24.0ms to seed version buckets with highest version 1546058939881226240 12902 INFO (coreLoadExecutor-6-thread-1) [ x:Solr_sample] o.a.s.c.CoreContainer registering core: Solr_sample 12904 INFO (coreLoadExecutor-6-thread-2) [ x:my_core] o.a.s.u.UpdateLog Took 16.0ms to seed version buckets with highest version 1546058939894857728 12904 INFO (coreLoadExecutor-6-thread-2) [ x:my_core] o.a.s.c.CoreContainer registering core: my_core
在其他埠上啟動 Solr
使用 **start** 命令的 **–p 選項**,我們可以在其他埠上啟動 Solr,如下面的程式碼塊所示。
[Hadoop@localhost bin]$ ./Solr start -p 8984 Waiting up to 30 seconds to see Solr running on port 8984 [-] Started Solr server on port 8984 (pid = 10137). Happy searching!
停止 Solr
您可以使用 **stop** 命令停止 Solr。
$ ./Solr stop
此命令停止 Solr,並顯示如下所示的訊息。
Sending stop command to Solr running on port 8983 ... waiting 5 seconds to allow Jetty process 6035 to stop gracefully.
重啟 Solr
Solr 的 **restart** 命令會停止 Solr 5 秒鐘,然後再次啟動它。您可以使用以下命令重啟 Solr -
./Solr restart
此命令重啟 Solr,並顯示以下訊息 -
Sending stop command to Solr running on port 8983 ... waiting 5 seconds to allow Jetty process 6671 to stop gracefully. Waiting up to 30 seconds to see Solr running on port 8983 [|] [/] Started Solr server on port 8983 (pid = 6906). Happy searching!
Solr ─ help 命令
Solr 的 **help** 命令可用於檢查 Solr 提示及其選項的使用方法。
[Hadoop@localhost bin]$ ./Solr -help Usage: Solr COMMAND OPTIONS where COMMAND is one of: start, stop, restart, status, healthcheck, create, create_core, create_collection, delete, version, zk Standalone server example (start Solr running in the background on port 8984): ./Solr start -p 8984 SolrCloud example (start Solr running in SolrCloud mode using localhost:2181 to connect to Zookeeper, with 1g max heap size and remote Java debug options enabled): ./Solr start -c -m 1g -z localhost:2181 -a "-Xdebug - Xrunjdwp:transport = dt_socket,server = y,suspend = n,address = 1044" Pass -help after any COMMAND to see command-specific usage information, such as: ./Solr start -help or ./Solr stop -help
Solr ─ status 命令
Solr 的 **status** 命令可用於搜尋和查詢計算機上正在執行的 Solr 例項。它可以為您提供有關 Solr 例項的資訊,例如其版本、記憶體使用情況等。
您可以使用以下 status 命令檢查 Solr 例項的狀態 -
[Hadoop@localhost bin]$ ./Solr status
執行上述命令後,Solr 的狀態將顯示如下 -
Found 1 Solr nodes:
Solr process 6906 running on port 8983 {
"Solr_home":"/home/Hadoop/Solr/server/Solr",
"version":"6.2.0 764d0f19151dbff6f5fcd9fc4b2682cf934590c5 -
mike - 2016-08-20 05:41:37",
"startTime":"2016-09-20T06:00:02.877Z",
"uptime":"0 days, 0 hours, 5 minutes, 14 seconds",
"memory":"30.6 MB (%6.2) of 490.7 MB"
}
Solr 管理員
啟動 Apache Solr 後,您可以使用以下 URL 訪問 **Solr Web 介面** 的主頁。
Localhost:8983/Solr/
Solr Admin 的介面如下所示 -
廣告