1. 程式人生 > >CentOS下安裝Solr5.4 自帶服務安裝

CentOS下安裝Solr5.4 自帶服務安裝

前言

Solr現在是一個獨立的伺服器。

從Solr5.0開始,Solr不再發布為在任何Servlet容器中部署的“war”Web應用程式包(Web Application Archive)。Solr現在部署為一個獨立的java伺服器應用程式,包含在Unix和Windows平臺上可以使用的啟動和停止指令碼,以及將Solr作為服務安裝到類Unix平臺的/etc/init.d下的安裝指令碼。

本質上,Solr仍然以Servlet APIs實現,並在Jetty上執行,但只是作為一個實現。部署為“webapp”到其他的Servlet容器(或其他Jetty例項)上不被支援,可能在未來的Solr 5.x版本不會工作。而可能會帶來Solr的其他改變,事實上是利用自定義網路協議棧功能。

安裝JRE

  1. 需要Java Runtime Environment(JRE) 1.7或更高版本,先驗證。

    # java -version

  2. 安裝可參考《在CentOS下安裝JDK8》,包含JRE。 

安裝Solr5.4

  1. 去http://www.apache.org/dyn/closer.lua/lucene/solr/5.4.0下載Solr安裝檔案solr-5.4.0.tgz。

  2. 將solr-5.4.0.tgz檔案放到/tmp目錄下,執行如下指令碼:    

    # cd /tmp     # tar -zxvf solr-5.4.0.tgz // 解壓壓縮包
  3. 建立應用程式和資料目錄

    # mkdir -p /data/solr /usr/local/solr
  4. 建立執行solr的使用者並賦權

    # groupadd solr     # useradd -g solr solr     # chown -R solr.solr /data/solr /usr/local/solr
  5. 安裝solr服務

    # solr-5.4.0/bin/install_solr_service.sh solr-5.4.0.tgz -d /data/solr -i /usr/local/solr

Extracting solr-5.4.0.tgz to /usr/local/solr5 Installing symlink /usr/local/solr5/solr -> /usr/local/solr5/solr-5.4.0 ... Installing /etc/init.d/solr script ... Installing /etc/default/solr.in.sh ... Waiting up to 30 seconds to see Solr running on port 8983 [/]   Started Solr server on port 8983 (pid=17112). Happy searching!     Found 1 Solr nodes:  Solr process 17112 running on port 8983 {   "solr_home":"/usr/local/solr5/data/data",   "version":"5.4.0 1718046 - upayavira - 2015-12-04 23:16:46",   "startTime":"2016-01-06T04:04:15.906Z",   "uptime":"0 days, 0 hours, 0 minutes, 21 seconds",   "memory":"60.4 MB (%12.3) of 490.7 MB"} Service solr installed.

     6.檢查服務狀態   

# service solr status

    將會看到如下輸出:   

Solr process 29692 running on port 8983     {     "solr_home":"/data/solr/data/",     "version":"5.3.0 1696229 - noble - 2015-08-17 17:10:43",     "startTime":"2015-09-16T01:32:03.919Z",     "uptime":"0 days, 0 hours, 3 minutes, 6 seconds",     "memory":"89.8 MB (%18.3) of 490.7 MB"}
    7.重啟服務
    # service solr restart                                                                                         

solr命令用法

  1. 定位到solr應用程式目錄  

    # cd /usr/local/solr/solr
  2. 檢視solr命令選項

    # ./bin/solr
Usage: solr COMMAND OPTIONS          where COMMAND is one of: start, stop, restart, status, healthcheck, create, create_core, create_collection, delete 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
# ./bin/solr start -help
Usage: solr start [-f] [-c] [-h hostname] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [-s solr.solr.home] [-a "additional-options"] [-V] -f            Start Solr in foreground; default starts Solr in the background                     and sends stdout / stderr to solr-PORT-console.log -c or -cloud  Start Solr in SolrCloud mode; if -z not supplied, an embedded ZooKeeper                     instance is started on Solr port+1000, such as 9983 if Solr is bound to 8983 -h <host>     Specify the hostname for this Solr instance -p <port>     Specify the port to start the Solr HTTP listener on; default is 8983                     The specified port (SOLR_PORT) will also be used to determine the stop port                      STOP_PORT=($SOLR_PORT-1000) and JMX RMI listen port RMI_PORT=(1$SOLR_PORT).                       For instance, if you set -p 8985, then the STOP_PORT=7985 and RMI_PORT=18985 -d <dir>      Specify the Solr server directory; defaults to server -z <zkHost>   ZooKeeper connection string; only used when running in SolrCloud mode using -c                      To launch an embedded ZooKeeper instance, don't pass this parameter. -m <memory>   Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g                     results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m -s <dir>      Sets the solr.solr.home system property; Solr will create core directories under                     this directory. This allows you to run multiple Solr instances on the same host                      while reusing the same server directory set using the -d parameter. If set, the                      specified directory should contain a solr.xml file, unless solr.xml exists in ZooKeeper.                      This parameter is ignored when running examples (-e), as the solr.solr.home depends                      on which example is run. The default value is server/solr. -e <example>  Name of the example to run; available examples:         cloud:         SolrCloud example          techproducts:  Comprehensive example illustrating many of Solr's core capabilities          dih:           Data Import Handler          schemaless:    Schema-less example

相關推薦

CentOS安裝Solr5.4 服務安裝

前言 Solr現在是一個獨立的伺服器。 從Solr5.0開始,Solr不再發布為在任何Servlet容器中部署的“war”Web應用程式包(Web Application Archive)。Solr現在部署為一個獨立的java伺服器應用程式,包含在Un

centos安裝python3與的python2共存方法

目的:由於centos自帶的python是2,我們要安裝python3,並使2和3共存,通過python2來呼叫2,python3來呼叫3 自帶的python的軟連線的結構是,python指向python2,python2指向python2.6 且自帶的python沒有安裝pip即pip

使用CentOS 7.5解除安裝jdk安裝自己的JDK1.8

本文主要介紹的是如何是Linux環境下安裝JDK的,因為Linux環境下,很多時候也離不開Java的,下面筆者就和大家一起分享如何jdk1.8的過程吧。 一、安裝環境 本機系統:Win 10 虛擬機器軟體:VMware PRO 14 虛擬機器Linux系統:CentOS 7.5 J

Windows用Python 3.4+的venv模組建立虛擬環境

Python 3.4+自帶了venv模組,用於建立虛擬環境,每個虛擬環境都可以安裝一套獨立的第三方模組。 本文在Windows 10上操作。  原文:http://www.cnblogs.com/animalize/p/5868763.html 1、建立一個虛擬環境: D:\>mkdir test_

Linux系統服務羅列

會話 nscd 協議 etl 證明 ber 快的 rest 聯系 /ect/services 文件列出了系統詳細的服務 紅色字體為常用服務 acpid ACPI(全稱 Advanced Configuration and Power Interface)服務是電源管理接口。

Centos高可用主從同步DNS服務部署

高可用 dns 一、背景介紹 在日常工作中,為解決內網域名解析問題,時長會配置DNS服務來提供解析。這時DNS服務就起到了為所有內部服務提供連通的基礎,變得非常重要了。所以在服務啟動後還是應該考慮服務的高可用和數據的完整性。 網友有很多LVS+Keepalived+Bind的負載均衡高可用

CentOS5.5中卸載jdk 安裝自己的jdk

5.5 eve 當前 nvi 如果 -1 code jdk1.7 profile 因為需要使用JDK1.6的版本,但是RedHat6.4自帶的JDK是1.7版本,因此需要卸載JDK1.7,安裝JDK1.6的版本,我使用的JDK1.6版本為:jdk-6u45-Linux-x6

centos搭建多項目svn服務

服務器環境 出現 配置文件 png 演示 sta 圖形界面 -a 3.4 svn是多人協作開發中的利器,是一個開放源代碼的版本控制系統。 相比與git,他的操作更加簡單,windows下有優秀的圖形界面,並且支持的文件類型比較多。 本文講述如何在linux下搭建一個sv

python3.4的pip怎樣修改默認源

怎樣 pip 修改 看官方文檔https://pip.pypa.io/en/latest/user_guide.html#configurationwindows 下是 %HOME%\pip\pip.ini, 沒有就自己創建一個。我的配置[global] respect-virtualenv =

postgresql在linux的的開機啟動服務與環境變量的配置

gpo 屬性 腳本 命令 strong 修改 post 方式 ebo 設置PostgreSQL開機自啟動 PostgreSQL的開機自啟動腳本位於PostgreSQL源碼目錄的contrib/start-scripts路徑下 linux文件即為linux系統上的啟動腳本

windows7 添加tomcat(解壓縮版或者免安裝版)啟動服務

details 安裝服務 安裝 href tps log article ref net https://blog.csdn.net/piggachen/article/details/69943223 :(service.bat方式安裝服務或者windows任務方式添加)

centos搭建Jenkins持續集成環境(安裝jenkins)

守護進程 指定 改變 tor 參數 系統 tro rpm 端口 1、安裝JDK yum install -y java 2、安裝jenkins 添加Jenkins庫到yum庫,Jenkins將從這裏下載安裝。 1 wget -O /etc/yum.repos.d/je

使用CentOS7解除安裝jdk安裝自己的JDK1.8

使用CentOS7解除安裝自帶jdk安裝自己的JDK1.8   不管在什麼地方,什麼時候,學習是快速提升自己的能力的一種體現!!!!!!!!!!! 關於JDK1.8 與之前的版本相比有哪些變化和新特性我也不在這詳細的說明了,畢竟一度娘啥都有了,既然不多說那就直接開始吧!!

Installshield12 安裝 Window Service功能

昨天晚上需要修改一個安裝程式 找了很久,都沒有找到Installshield12 自帶的安裝 Window Service功能 怒了,不幹了,睡了 早上起床,繼續找,找到後做如下記錄,下次不會忘了! 1、點選Organization下Components 2、可以看到元件列

安裝非伺服器的JDK操作步驟

[[email protected] software]# java -version 顯示: openjdk version "1.8.0_102" OpenJDK Runtime Environment (build 1.8.0_102-b14) OpenJ

Linux軟體:Anaconda安裝python和Python

Linux(Ubuntu14.04)下安裝Anaconda是為了安裝python所需要的各種庫以及他們的環境配置。 Spyder是使用python的IDE 安裝python和pip 一般linux系統都自帶python,所以不需要安裝。如果沒有的,安裝起來也非常方便。安

flink安裝以及執行wordcount示例(單機版,無hadoop環境)

1、下載安裝包到/opt目錄 2、解壓安裝包 tar zxf flink-1.6.1-bin-hadoop26-scala_2.11.tgz  3、啟動flink cd /opt/flink-1

黑猴子的家:解除安裝Linux系統MySql資料庫

1、關閉mysql服務 [[email protected] ~]# systemctl status mysql [[email protected] ~]# systemctl stop mysql 尖叫提示:解除安裝用root使用者

如何解除安裝office2007中的微軟拼音輸入法?

新裝了WIndows7系統,又裝了OFFICE2007,卻發現微軟拼音輸法2007怎麼也除不掉。上網查,方法很多,不過估計都是不完全的解除安裝(有的甚至是強行刪除,估計會留有後遺症),乾脆有人叫它流氓軟體了呵呵。 查到一個,一試果然管用,靈,真靈。 很簡單,開始--執行,在執行欄輸入或複

Linux-7.2 Solr4.10.4 單機模式的安裝與部署圖文詳解

《 Linux下Solr4.10.4搜尋引擎的安裝與部署 》 瞭解Solr: Solr是來自Apache Lucene專案的流行的,快速的,開源的NoSQL搜尋平臺。它的主要功能包括強大