{{tag>Brouillon}}
= Apache solr lucene
Voir :
* http://lucene.apache.org/solr/guide/7_5/solr-tutorial.html
* https://www.unixmen.com/install-apache-solr-ubuntu/
* http://deeplearning.lipingyang.org/2017/04/30/install-apache-solr-on-ubuntu-16-04/
* https://dzone.com/articles/how-to-install-apache-solr-on-ubuntu-1604
* Datafari
Solr utilise le langage Java et est exécuté par un conteneur de servlets1, comme Tomcat, jusqu'à la version 5.0 puis devient un standalone Java.
Solr Instance : Ir refers to Solr server running inside JVM
Solr Core : In Solr, the term "core" is used to refer to a single index and confoguration files (such as solrconfig.xml, schema files etc!...) and
transaction log associated with code.
You can have one or more cores (indexes) running inside single Solr instance.
Physically each core maps to a subdirectory in the Solr home directory
tar xvf solr-7.5.0.tgz
cd solr-7.5.0
# See solr-7.5.0/README.txt
bin/solr start -help
Deux modes :
* standalone (core)
* SolrCloud mode (collection)
=== Start
# standalone (core)
bin/solr start
# SolrCloud mode (collection)
bin/solr start -cloud
http://localhost:8983/solr
Cloudtab
http://localhost:8983/solr/#/~cloud
=== Create
Creation d'un core
bin/solr create -c techproducts
bin/post -c techproducts example/exampledocs/books.csv
Requette
http://localhost:8983/solr/techproducts/select?q=*:*
=== Diag
bin/solr status
Les logs sont ici : ./server/logs/
Check / supervision
Voir https://lucene.apache.org/solr/guide/7_5/ping.html
#curl http://localhost:8983/solr/techproducts/admin/ping
curl -i -H "Accept: application/json" 'http://localhost:8983/solr/techproducts/admin/ping
=== Stop & clean
Stop
bin/solr stop -all
Clean
rm -rf server/solr/techproducts/
== Autres
cd solr-7.5.0/server
mkdir plop
cd plop
mkdir conf
mkdir data
touch core.properties
touch conf/schema.xml
touch conf/solrconfig.xml
=== Install Solr tomcat (anciennes versions)
Voir https://github.com/sunspot/sunspot/wiki/Configure-Solr-on-Ubuntu,-the-quickest-way
apt-get install openjdk-6-jdk
apt-get install solr-tomcat
Vérif
ps -ef |grep java
curl http://localhost:8080/solr/admin/ping |egrep 'str name="status.*OK'
=== Notes - starts
Pour les versions anciennes
java -jar start.jar
Avec la version 7.5 en faisant un ''ps -ef |grep java''
java -server -Xms512m -Xmx512m -XX:NewRatio=3 -XX:SurvivorRatio=4 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 -XX:+CMSScavengeBeforeRemark -XX:PretenureSizeThreshold=64m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=50 -XX:CMSMaxAbortablePrecleanTime=6000 -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -XX:-OmitStackTraceInFastThrow -verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -Xloggc:/tmp/plop/solr-7.5.0/server/logs/solr_gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M -Dsolr.log.dir=/tmp/plop/solr-7.5.0/server/logs -Djetty.port=8983 -DSTOP.PORT=7983 -DSTOP.KEY=solrrocks -Duser.timezone=UTC -Djetty.home=/tmp/plop/solr-7.5.0/server -Dsolr.solr.home=/tmp/plop/solr-7.5.0/server/solr -Dsolr.data.home= -Dsolr.install.dir=/tmp/plop/solr-7.5.0 -Dsolr.default.confdir=/tmp/plop/solr-7.5.0/server/solr/configsets/_default/conf -Xss256k -Dsolr.jetty.https.port=8983 -Dsolr.log.muteconsole -XX:OnOutOfMemoryError=/tmp/plop/solr-7.5.0/bin/oom_solr.sh 8983 /tmp/plop/solr-7.5.0/server/logs -jar start.jar --module=http