solr-5.3.0
目录
- 9.1. 安装
- 9.2. Core Admin
-
- 9.2.1. Schema
- 9.3. 索引
-
- 9.3.1. Indexing a directory of "rich" files
- 9.3.2. Indexing Solr XML
- 9.3.3. Indexing JSON
- 9.3.4. Deleting Data
- 9.4. 接口
-
- 9.4.1. 查询
- 9.5. FAQ
-
- 9.5.1. NOTE: Please install lsof as this script needs it to determine if Solr is listening on port 8983.
- 9.6. Solr 1.3.0
-
- 9.6.1. Embedded Jetty
- 9.6.2. Jetty
- 9.6.3. Tomcat
- 9.6.4. solr-php-client
- 9.6.5. multicore
- 9.6.6. 中文分词
-
- 9.6.6.1. ChineseTokenizerFactory
- 9.6.6.2. CJK
- 9.6.6.3. mmseg4j
- 9.6.6.4. 中文分词“庖丁解牛” Paoding Analysis
9.1. 安装
安装
yum install -y unzip java-1.8.0-openjdk wget http://www.us.apache.org/dist/lucene/solr/5.3.0/solr-5.3.0.tgz tar zxvf solr-5.3.0.tgz mv solr-5.3.0 /srv/ ln -s /srv/solr-5.3.0/ /srv/solr adduser -d /srv/solr -c "Apache Solr" solr chown solr:solr -R /srv/solr-5.3.0 cp /srv/solr-5.3.0/bin/init.d/solr /etc/init.d/ sed -i 's:/opt/solr:/srv/solr:' /etc/init.d/solr sed -i 's:/var/solr:/srv/solr/bin:' /etc/init.d/solr chkconfig --add solr chkconfig solr on
启动与停止
# service solr start Waiting up to 30 seconds to see Solr running on port 8983 [/] Started Solr server on port 8983 (pid=61909). Happy searching! # service solr stop Sending stop command to Solr running on port 8983 ... waiting 5 seconds to allow Jetty process 61909 to stop gracefully.
请使用service 或者 /etc/init.d/solr启动,不建议使用root用户如下启动,会造成日志文件无权限等问题。
# /srv/solr/bin/solr start Waiting up to 30 seconds to see Solr running on port 8983 [/] Started Solr server on port 8983 (pid=56697). Happy searching!
我们将solr启动后交给solr用户完成。
# ps aux | grep solr solr 62345 14.5 4.1 4103804 158960 ? Sl 04:15 0:02 java -server -Xss256k -Xms512m -Xmx512m -XX:NewRatio=3 -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 -XX:+CMSScavengeBeforeRemark -XX:PretenureSizeThreshold=64m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=50 -XX:CMSMaxAbortablePrecleanTime=6000 -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/srv/solr/server/logs/solr_gc.log -Djetty.port=8983 -DSTOP.PORT=7983 -DSTOP.KEY=solrrocks -Duser.timezone=UTC -Djetty.home=/srv/solr/server -Dsolr.solr.home=/srv/solr/server/solr -Dsolr.install.dir=/srv/solr -jar start.jar -XX:OnOutOfMemoryError=/srv/solr/bin/oom_solr.sh 8983 /srv/solr/server/logs --module=http root 62458 0.0 0.0 112640 964 pts/0 S+ 04:15 0:00 grep --color=auto solr
Solr Admin UI: http://192.168.4.1:8983/solr/#/
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。