sunspot_solr 2.2.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (515) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +1 -1
  4. data/Rakefile +9 -0
  5. data/bin/sunspot-solr +2 -10
  6. data/lib/sunspot/solr/installer.rb +66 -8
  7. data/lib/sunspot/solr/java.rb +17 -4
  8. data/lib/sunspot/solr/server.rb +25 -37
  9. data/solr/.gitignore +2 -0
  10. data/solr/README.txt +181 -42
  11. data/solr/bin/init.d/solr +78 -0
  12. data/solr/bin/install_solr_service.sh +270 -0
  13. data/solr/bin/oom_solr.sh +30 -0
  14. data/solr/bin/post +228 -0
  15. data/solr/bin/solr +1350 -0
  16. data/solr/bin/solr.cmd +1230 -0
  17. data/solr/bin/solr.in.cmd +99 -0
  18. data/solr/bin/solr.in.sh +119 -0
  19. data/solr/server/README.txt +110 -0
  20. data/solr/server/contexts/solr-jetty-context.xml +8 -0
  21. data/solr/server/etc/jetty-http.xml +47 -0
  22. data/solr/{etc/jetty.xml → server/etc/jetty-https-ssl.xml} +175 -167
  23. data/solr/server/etc/jetty-https.xml +53 -0
  24. data/solr/server/etc/jetty-ssl.xml +46 -0
  25. data/solr/server/etc/jetty.xml +189 -0
  26. data/solr/{etc → server/etc}/webdefault.xml +527 -527
  27. data/solr/server/lib/ext/jcl-over-slf4j-1.7.7.jar +0 -0
  28. data/solr/server/lib/ext/jul-to-slf4j-1.7.7.jar +0 -0
  29. data/solr/server/lib/ext/log4j-1.2.17.jar +0 -0
  30. data/solr/server/lib/ext/slf4j-api-1.7.7.jar +0 -0
  31. data/solr/server/lib/ext/slf4j-log4j12-1.7.7.jar +0 -0
  32. data/solr/server/lib/javax.servlet-api-3.1.0.jar +0 -0
  33. data/solr/server/lib/jetty-continuation-9.2.11.v20150529.jar +0 -0
  34. data/solr/server/lib/jetty-deploy-9.2.11.v20150529.jar +0 -0
  35. data/solr/server/lib/jetty-http-9.2.11.v20150529.jar +0 -0
  36. data/solr/server/lib/jetty-io-9.2.11.v20150529.jar +0 -0
  37. data/solr/server/lib/jetty-jmx-9.2.11.v20150529.jar +0 -0
  38. data/solr/server/lib/jetty-rewrite-9.2.11.v20150529.jar +0 -0
  39. data/solr/server/lib/jetty-security-9.2.11.v20150529.jar +0 -0
  40. data/solr/server/lib/jetty-server-9.2.11.v20150529.jar +0 -0
  41. data/solr/server/lib/jetty-servlet-9.2.11.v20150529.jar +0 -0
  42. data/solr/server/lib/jetty-servlets-9.2.11.v20150529.jar +0 -0
  43. data/solr/server/lib/jetty-util-9.2.11.v20150529.jar +0 -0
  44. data/solr/server/lib/jetty-webapp-9.2.11.v20150529.jar +0 -0
  45. data/solr/server/lib/jetty-xml-9.2.11.v20150529.jar +0 -0
  46. data/solr/server/modules/http.mod +9 -0
  47. data/solr/server/modules/https.mod +9 -0
  48. data/solr/server/modules/server.mod +11 -0
  49. data/solr/server/modules/ssl.mod +9 -0
  50. data/solr/server/resources/jetty-logging.properties +1 -0
  51. data/solr/server/resources/log4j.properties +24 -0
  52. data/solr/server/solr-webapp/webapp/WEB-INF/lib/antlr-runtime-3.5.jar +0 -0
  53. data/solr/server/solr-webapp/webapp/WEB-INF/lib/asm-4.1.jar +0 -0
  54. data/solr/server/solr-webapp/webapp/WEB-INF/lib/asm-commons-4.1.jar +0 -0
  55. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-cli-1.2.jar +0 -0
  56. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-codec-1.10.jar +0 -0
  57. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-collections-3.2.1.jar +0 -0
  58. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-configuration-1.6.jar +0 -0
  59. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-exec-1.3.jar +0 -0
  60. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-fileupload-1.2.1.jar +0 -0
  61. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-io-2.4.jar +0 -0
  62. data/solr/server/solr-webapp/webapp/WEB-INF/lib/commons-lang-2.6.jar +0 -0
  63. data/solr/server/solr-webapp/webapp/WEB-INF/lib/concurrentlinkedhashmap-lru-1.2.jar +0 -0
  64. data/solr/server/solr-webapp/webapp/WEB-INF/lib/dom4j-1.6.1.jar +0 -0
  65. data/solr/server/solr-webapp/webapp/WEB-INF/lib/guava-14.0.1.jar +0 -0
  66. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-annotations-2.6.0.jar +0 -0
  67. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-auth-2.6.0.jar +0 -0
  68. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-common-2.6.0.jar +0 -0
  69. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hadoop-hdfs-2.6.0.jar +0 -0
  70. data/solr/server/solr-webapp/webapp/WEB-INF/lib/hppc-0.5.2.jar +0 -0
  71. data/solr/server/solr-webapp/webapp/WEB-INF/lib/htrace-core-3.0.4.jar +0 -0
  72. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpclient-4.4.1.jar +0 -0
  73. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpcore-4.4.1.jar +0 -0
  74. data/solr/server/solr-webapp/webapp/WEB-INF/lib/httpmime-4.4.1.jar +0 -0
  75. data/solr/server/solr-webapp/webapp/WEB-INF/lib/jackson-core-2.5.4.jar +0 -0
  76. data/solr/server/solr-webapp/webapp/WEB-INF/lib/jackson-dataformat-smile-2.5.4.jar +0 -0
  77. data/solr/server/solr-webapp/webapp/WEB-INF/lib/joda-time-2.2.jar +0 -0
  78. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-analyzers-common-5.3.1.jar +0 -0
  79. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-analyzers-kuromoji-5.3.1.jar +0 -0
  80. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-analyzers-phonetic-5.3.1.jar +0 -0
  81. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-backward-codecs-5.3.1.jar +0 -0
  82. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-codecs-5.3.1.jar +0 -0
  83. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-core-5.3.1.jar +0 -0
  84. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-expressions-5.3.1.jar +0 -0
  85. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-grouping-5.3.1.jar +0 -0
  86. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-highlighter-5.3.1.jar +0 -0
  87. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-join-5.3.1.jar +0 -0
  88. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-memory-5.3.1.jar +0 -0
  89. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-misc-5.3.1.jar +0 -0
  90. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queries-5.3.1.jar +0 -0
  91. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-queryparser-5.3.1.jar +0 -0
  92. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-sandbox-5.3.1.jar +0 -0
  93. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-spatial-5.3.1.jar +0 -0
  94. data/solr/server/solr-webapp/webapp/WEB-INF/lib/lucene-suggest-5.3.1.jar +0 -0
  95. data/solr/server/solr-webapp/webapp/WEB-INF/lib/noggit-0.6.jar +0 -0
  96. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet-2.3.0.jar +0 -0
  97. data/solr/server/solr-webapp/webapp/WEB-INF/lib/org.restlet.ext.servlet-2.3.0.jar +0 -0
  98. data/solr/server/solr-webapp/webapp/WEB-INF/lib/protobuf-java-2.5.0.jar +0 -0
  99. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-core-5.3.1.jar +0 -0
  100. data/solr/server/solr-webapp/webapp/WEB-INF/lib/solr-solrj-5.3.1.jar +0 -0
  101. data/solr/server/solr-webapp/webapp/WEB-INF/lib/spatial4j-0.4.1.jar +0 -0
  102. data/solr/server/solr-webapp/webapp/WEB-INF/lib/stax2-api-3.1.4.jar +0 -0
  103. data/solr/server/solr-webapp/webapp/WEB-INF/lib/t-digest-3.1.jar +0 -0
  104. data/solr/server/solr-webapp/webapp/WEB-INF/lib/woodstox-core-asl-4.4.1.jar +0 -0
  105. data/solr/server/solr-webapp/webapp/WEB-INF/lib/zookeeper-3.4.6.jar +0 -0
  106. data/solr/server/solr-webapp/webapp/WEB-INF/web.xml +169 -0
  107. data/solr/server/solr-webapp/webapp/WEB-INF/weblogic.xml +28 -0
  108. data/solr/server/solr-webapp/webapp/admin.html +164 -0
  109. data/solr/server/solr-webapp/webapp/css/angular/analysis.css +304 -0
  110. data/solr/server/solr-webapp/webapp/css/angular/chosen.css +465 -0
  111. data/solr/server/solr-webapp/webapp/css/angular/cloud.css +398 -0
  112. data/solr/server/solr-webapp/webapp/css/angular/common.css +724 -0
  113. data/solr/server/solr-webapp/webapp/css/angular/cores.css +233 -0
  114. data/solr/server/solr-webapp/webapp/css/angular/dataimport.css +370 -0
  115. data/solr/server/solr-webapp/webapp/css/angular/documents.css +179 -0
  116. data/solr/server/solr-webapp/webapp/css/angular/files.css +53 -0
  117. data/solr/server/solr-webapp/webapp/css/angular/index.css +206 -0
  118. data/solr/server/solr-webapp/webapp/css/angular/logging.css +376 -0
  119. data/solr/server/solr-webapp/webapp/css/angular/menu.css +321 -0
  120. data/solr/server/solr-webapp/webapp/css/angular/plugins.css +212 -0
  121. data/solr/server/solr-webapp/webapp/css/angular/query.css +162 -0
  122. data/solr/server/solr-webapp/webapp/css/angular/replication.css +500 -0
  123. data/solr/server/solr-webapp/webapp/css/angular/schema-browser.css +567 -0
  124. data/solr/server/solr-webapp/webapp/css/angular/segments.css +173 -0
  125. data/solr/server/solr-webapp/webapp/css/angular/threads.css +161 -0
  126. data/solr/server/solr-webapp/webapp/css/chosen.css +421 -0
  127. data/solr/server/solr-webapp/webapp/css/styles/analysis.css +311 -0
  128. data/solr/server/solr-webapp/webapp/css/styles/cloud.css +410 -0
  129. data/solr/server/solr-webapp/webapp/css/styles/common.css +701 -0
  130. data/solr/server/solr-webapp/webapp/css/styles/cores.css +244 -0
  131. data/solr/server/solr-webapp/webapp/css/styles/dashboard.css +155 -0
  132. data/solr/server/solr-webapp/webapp/css/styles/dataimport.css +403 -0
  133. data/solr/server/solr-webapp/webapp/css/styles/documents.css +197 -0
  134. data/solr/server/solr-webapp/webapp/css/styles/files.css +54 -0
  135. data/solr/server/solr-webapp/webapp/css/styles/index.css +207 -0
  136. data/solr/server/solr-webapp/webapp/css/styles/java-properties.css +52 -0
  137. data/solr/server/solr-webapp/webapp/css/styles/logging.css +391 -0
  138. data/solr/server/solr-webapp/webapp/css/styles/menu.css +329 -0
  139. data/solr/server/solr-webapp/webapp/css/styles/plugins.css +195 -0
  140. data/solr/server/solr-webapp/webapp/css/styles/query.css +173 -0
  141. data/solr/server/solr-webapp/webapp/css/styles/replication.css +515 -0
  142. data/solr/server/solr-webapp/webapp/css/styles/schema-browser.css +578 -0
  143. data/solr/server/solr-webapp/webapp/css/styles/segments.css +145 -0
  144. data/solr/server/solr-webapp/webapp/css/styles/threads.css +172 -0
  145. data/solr/server/solr-webapp/webapp/favicon.ico +0 -0
  146. data/solr/server/solr-webapp/webapp/img/ZeroClipboard.swf +0 -0
  147. data/solr/server/solr-webapp/webapp/img/chosen-sprite-2x.png +0 -0
  148. data/solr/server/solr-webapp/webapp/img/chosen-sprite.png +0 -0
  149. data/solr/server/solr-webapp/webapp/img/div.gif +0 -0
  150. data/solr/server/solr-webapp/webapp/img/favicon.ico +0 -0
  151. data/solr/server/solr-webapp/webapp/img/filetypes/7z.png +0 -0
  152. data/solr/server/solr-webapp/webapp/img/filetypes/README +27 -0
  153. data/solr/server/solr-webapp/webapp/img/filetypes/ai.png +0 -0
  154. data/solr/server/solr-webapp/webapp/img/filetypes/aiff.png +0 -0
  155. data/solr/server/solr-webapp/webapp/img/filetypes/asc.png +0 -0
  156. data/solr/server/solr-webapp/webapp/img/filetypes/audio.png +0 -0
  157. data/solr/server/solr-webapp/webapp/img/filetypes/bin.png +0 -0
  158. data/solr/server/solr-webapp/webapp/img/filetypes/bz2.png +0 -0
  159. data/solr/server/solr-webapp/webapp/img/filetypes/c.png +0 -0
  160. data/solr/server/solr-webapp/webapp/img/filetypes/cfc.png +0 -0
  161. data/solr/server/solr-webapp/webapp/img/filetypes/cfm.png +0 -0
  162. data/solr/server/solr-webapp/webapp/img/filetypes/chm.png +0 -0
  163. data/solr/server/solr-webapp/webapp/img/filetypes/class.png +0 -0
  164. data/solr/server/solr-webapp/webapp/img/filetypes/conf.png +0 -0
  165. data/solr/server/solr-webapp/webapp/img/filetypes/cpp.png +0 -0
  166. data/solr/server/solr-webapp/webapp/img/filetypes/cs.png +0 -0
  167. data/solr/server/solr-webapp/webapp/img/filetypes/css.png +0 -0
  168. data/solr/server/solr-webapp/webapp/img/filetypes/csv.png +0 -0
  169. data/solr/server/solr-webapp/webapp/img/filetypes/deb.png +0 -0
  170. data/solr/server/solr-webapp/webapp/img/filetypes/divx.png +0 -0
  171. data/solr/server/solr-webapp/webapp/img/filetypes/doc.png +0 -0
  172. data/solr/server/solr-webapp/webapp/img/filetypes/dot.png +0 -0
  173. data/solr/server/solr-webapp/webapp/img/filetypes/eml.png +0 -0
  174. data/solr/server/solr-webapp/webapp/img/filetypes/enc.png +0 -0
  175. data/solr/server/solr-webapp/webapp/img/filetypes/file.png +0 -0
  176. data/solr/server/solr-webapp/webapp/img/filetypes/gif.png +0 -0
  177. data/solr/server/solr-webapp/webapp/img/filetypes/gz.png +0 -0
  178. data/solr/server/solr-webapp/webapp/img/filetypes/hlp.png +0 -0
  179. data/solr/server/solr-webapp/webapp/img/filetypes/htm.png +0 -0
  180. data/solr/server/solr-webapp/webapp/img/filetypes/html.png +0 -0
  181. data/solr/server/solr-webapp/webapp/img/filetypes/image.png +0 -0
  182. data/solr/server/solr-webapp/webapp/img/filetypes/iso.png +0 -0
  183. data/solr/server/solr-webapp/webapp/img/filetypes/jar.png +0 -0
  184. data/solr/server/solr-webapp/webapp/img/filetypes/java.png +0 -0
  185. data/solr/server/solr-webapp/webapp/img/filetypes/jpeg.png +0 -0
  186. data/solr/server/solr-webapp/webapp/img/filetypes/jpg.png +0 -0
  187. data/solr/server/solr-webapp/webapp/img/filetypes/js.png +0 -0
  188. data/solr/server/solr-webapp/webapp/img/filetypes/lua.png +0 -0
  189. data/solr/server/solr-webapp/webapp/img/filetypes/m.png +0 -0
  190. data/solr/server/solr-webapp/webapp/img/filetypes/mm.png +0 -0
  191. data/solr/server/solr-webapp/webapp/img/filetypes/mov.png +0 -0
  192. data/solr/server/solr-webapp/webapp/img/filetypes/mp3.png +0 -0
  193. data/solr/server/solr-webapp/webapp/img/filetypes/mpg.png +0 -0
  194. data/solr/server/solr-webapp/webapp/img/filetypes/odc.png +0 -0
  195. data/solr/server/solr-webapp/webapp/img/filetypes/odf.png +0 -0
  196. data/solr/server/solr-webapp/webapp/img/filetypes/odg.png +0 -0
  197. data/solr/server/solr-webapp/webapp/img/filetypes/odi.png +0 -0
  198. data/solr/server/solr-webapp/webapp/img/filetypes/odp.png +0 -0
  199. data/solr/server/solr-webapp/webapp/img/filetypes/ods.png +0 -0
  200. data/solr/server/solr-webapp/webapp/img/filetypes/odt.png +0 -0
  201. data/solr/server/solr-webapp/webapp/img/filetypes/ogg.png +0 -0
  202. data/solr/server/solr-webapp/webapp/img/filetypes/pdf.png +0 -0
  203. data/solr/server/solr-webapp/webapp/img/filetypes/pgp.png +0 -0
  204. data/solr/server/solr-webapp/webapp/img/filetypes/php.png +0 -0
  205. data/solr/server/solr-webapp/webapp/img/filetypes/pl.png +0 -0
  206. data/solr/server/solr-webapp/webapp/img/filetypes/png.png +0 -0
  207. data/solr/server/solr-webapp/webapp/img/filetypes/ppt.png +0 -0
  208. data/solr/server/solr-webapp/webapp/img/filetypes/ps.png +0 -0
  209. data/solr/server/solr-webapp/webapp/img/filetypes/py.png +0 -0
  210. data/solr/server/solr-webapp/webapp/img/filetypes/ram.png +0 -0
  211. data/solr/server/solr-webapp/webapp/img/filetypes/rar.png +0 -0
  212. data/solr/server/solr-webapp/webapp/img/filetypes/rb.png +0 -0
  213. data/solr/server/solr-webapp/webapp/img/filetypes/rm.png +0 -0
  214. data/solr/server/solr-webapp/webapp/img/filetypes/rpm.png +0 -0
  215. data/solr/server/solr-webapp/webapp/img/filetypes/rtf.png +0 -0
  216. data/solr/server/solr-webapp/webapp/img/filetypes/sig.png +0 -0
  217. data/solr/server/solr-webapp/webapp/img/filetypes/sql.png +0 -0
  218. data/solr/server/solr-webapp/webapp/img/filetypes/swf.png +0 -0
  219. data/solr/server/solr-webapp/webapp/img/filetypes/sxc.png +0 -0
  220. data/solr/server/solr-webapp/webapp/img/filetypes/sxd.png +0 -0
  221. data/solr/server/solr-webapp/webapp/img/filetypes/sxi.png +0 -0
  222. data/solr/server/solr-webapp/webapp/img/filetypes/sxw.png +0 -0
  223. data/solr/server/solr-webapp/webapp/img/filetypes/tar.png +0 -0
  224. data/solr/server/solr-webapp/webapp/img/filetypes/tex.png +0 -0
  225. data/solr/server/solr-webapp/webapp/img/filetypes/tgz.png +0 -0
  226. data/solr/server/solr-webapp/webapp/img/filetypes/txt.png +0 -0
  227. data/solr/server/solr-webapp/webapp/img/filetypes/vcf.png +0 -0
  228. data/solr/server/solr-webapp/webapp/img/filetypes/video.png +0 -0
  229. data/solr/server/solr-webapp/webapp/img/filetypes/vsd.png +0 -0
  230. data/solr/server/solr-webapp/webapp/img/filetypes/wav.png +0 -0
  231. data/solr/server/solr-webapp/webapp/img/filetypes/wma.png +0 -0
  232. data/solr/server/solr-webapp/webapp/img/filetypes/wmv.png +0 -0
  233. data/solr/server/solr-webapp/webapp/img/filetypes/xls.png +0 -0
  234. data/solr/server/solr-webapp/webapp/img/filetypes/xml.png +0 -0
  235. data/solr/server/solr-webapp/webapp/img/filetypes/xpi.png +0 -0
  236. data/solr/server/solr-webapp/webapp/img/filetypes/xvid.png +0 -0
  237. data/solr/server/solr-webapp/webapp/img/filetypes/zip.png +0 -0
  238. data/solr/server/solr-webapp/webapp/img/ico/arrow-000-small.png +0 -0
  239. data/solr/server/solr-webapp/webapp/img/ico/arrow-circle.png +0 -0
  240. data/solr/server/solr-webapp/webapp/img/ico/arrow-switch.png +0 -0
  241. data/solr/server/solr-webapp/webapp/img/ico/asterisk.png +0 -0
  242. data/solr/server/solr-webapp/webapp/img/ico/battery.png +0 -0
  243. data/solr/server/solr-webapp/webapp/img/ico/block-small.png +0 -0
  244. data/solr/server/solr-webapp/webapp/img/ico/block.png +0 -0
  245. data/solr/server/solr-webapp/webapp/img/ico/book-open-text.png +0 -0
  246. data/solr/server/solr-webapp/webapp/img/ico/box.png +0 -0
  247. data/solr/server/solr-webapp/webapp/img/ico/bug.png +0 -0
  248. data/solr/server/solr-webapp/webapp/img/ico/chart.png +0 -0
  249. data/solr/server/solr-webapp/webapp/img/ico/chevron-small-expand.png +0 -0
  250. data/solr/server/solr-webapp/webapp/img/ico/chevron-small.png +0 -0
  251. data/solr/server/solr-webapp/webapp/img/ico/clipboard-list.png +0 -0
  252. data/solr/server/solr-webapp/webapp/img/ico/clipboard-paste-document-text.png +0 -0
  253. data/solr/server/solr-webapp/webapp/img/ico/clipboard-paste.png +0 -0
  254. data/solr/server/solr-webapp/webapp/img/ico/clock-select-remain.png +0 -0
  255. data/solr/server/solr-webapp/webapp/img/ico/clock-select.png +0 -0
  256. data/solr/server/solr-webapp/webapp/img/ico/construction.png +0 -0
  257. data/solr/server/solr-webapp/webapp/img/ico/cross-0.png +0 -0
  258. data/solr/server/solr-webapp/webapp/img/ico/cross-1.png +0 -0
  259. data/solr/server/solr-webapp/webapp/img/ico/cross-button.png +0 -0
  260. data/solr/server/solr-webapp/webapp/img/ico/cross.png +0 -0
  261. data/solr/server/solr-webapp/webapp/img/ico/dashboard.png +0 -0
  262. data/solr/server/solr-webapp/webapp/img/ico/database--plus.png +0 -0
  263. data/solr/server/solr-webapp/webapp/img/ico/database.png +0 -0
  264. data/solr/server/solr-webapp/webapp/img/ico/databases.png +0 -0
  265. data/solr/server/solr-webapp/webapp/img/ico/disk-black.png +0 -0
  266. data/solr/server/solr-webapp/webapp/img/ico/document-convert.png +0 -0
  267. data/solr/server/solr-webapp/webapp/img/ico/document-import.png +0 -0
  268. data/solr/server/solr-webapp/webapp/img/ico/document-list.png +0 -0
  269. data/solr/server/solr-webapp/webapp/img/ico/document-text.png +0 -0
  270. data/solr/server/solr-webapp/webapp/img/ico/documents-stack.png +0 -0
  271. data/solr/server/solr-webapp/webapp/img/ico/download-cloud.png +0 -0
  272. data/solr/server/solr-webapp/webapp/img/ico/drive-upload.png +0 -0
  273. data/solr/server/solr-webapp/webapp/img/ico/exclamation-button.png +0 -0
  274. data/solr/server/solr-webapp/webapp/img/ico/eye.png +0 -0
  275. data/solr/server/solr-webapp/webapp/img/ico/folder-export.png +0 -0
  276. data/solr/server/solr-webapp/webapp/img/ico/folder-tree.png +0 -0
  277. data/solr/server/solr-webapp/webapp/img/ico/folder.png +0 -0
  278. data/solr/server/solr-webapp/webapp/img/ico/funnel-small.png +0 -0
  279. data/solr/server/solr-webapp/webapp/img/ico/funnel.png +0 -0
  280. data/solr/server/solr-webapp/webapp/img/ico/gear.png +0 -0
  281. data/solr/server/solr-webapp/webapp/img/ico/globe-network.png +0 -0
  282. data/solr/server/solr-webapp/webapp/img/ico/globe.png +0 -0
  283. data/solr/server/solr-webapp/webapp/img/ico/hammer-screwdriver.png +0 -0
  284. data/solr/server/solr-webapp/webapp/img/ico/hammer.png +0 -0
  285. data/solr/server/solr-webapp/webapp/img/ico/hand.png +0 -0
  286. data/solr/server/solr-webapp/webapp/img/ico/highlighter-text.png +0 -0
  287. data/solr/server/solr-webapp/webapp/img/ico/home.png +0 -0
  288. data/solr/server/solr-webapp/webapp/img/ico/hourglass--exclamation.png +0 -0
  289. data/solr/server/solr-webapp/webapp/img/ico/hourglass.png +0 -0
  290. data/solr/server/solr-webapp/webapp/img/ico/inbox-document-text.png +0 -0
  291. data/solr/server/solr-webapp/webapp/img/ico/information-button.png +0 -0
  292. data/solr/server/solr-webapp/webapp/img/ico/information-small.png +0 -0
  293. data/solr/server/solr-webapp/webapp/img/ico/information-white.png +0 -0
  294. data/solr/server/solr-webapp/webapp/img/ico/information.png +0 -0
  295. data/solr/server/solr-webapp/webapp/img/ico/jar.png +0 -0
  296. data/solr/server/solr-webapp/webapp/img/ico/magnifier.png +0 -0
  297. data/solr/server/solr-webapp/webapp/img/ico/mail.png +0 -0
  298. data/solr/server/solr-webapp/webapp/img/ico/memory.png +0 -0
  299. data/solr/server/solr-webapp/webapp/img/ico/minus-button.png +0 -0
  300. data/solr/server/solr-webapp/webapp/img/ico/molecule.png +0 -0
  301. data/solr/server/solr-webapp/webapp/img/ico/network-cloud.png +0 -0
  302. data/solr/server/solr-webapp/webapp/img/ico/network-status-away.png +0 -0
  303. data/solr/server/solr-webapp/webapp/img/ico/network-status-busy.png +0 -0
  304. data/solr/server/solr-webapp/webapp/img/ico/network-status-offline.png +0 -0
  305. data/solr/server/solr-webapp/webapp/img/ico/network-status.png +0 -0
  306. data/solr/server/solr-webapp/webapp/img/ico/network.png +0 -0
  307. data/solr/server/solr-webapp/webapp/img/ico/node-design.png +0 -0
  308. data/solr/server/solr-webapp/webapp/img/ico/node-master.png +0 -0
  309. data/solr/server/solr-webapp/webapp/img/ico/node-select.png +0 -0
  310. data/solr/server/solr-webapp/webapp/img/ico/node-slave.png +0 -0
  311. data/solr/server/solr-webapp/webapp/img/ico/node.png +0 -0
  312. data/solr/server/solr-webapp/webapp/img/ico/pencil-small.png +0 -0
  313. data/solr/server/solr-webapp/webapp/img/ico/pencil.png +0 -0
  314. data/solr/server/solr-webapp/webapp/img/ico/plus-button.png +0 -0
  315. data/solr/server/solr-webapp/webapp/img/ico/processor.png +0 -0
  316. data/solr/server/solr-webapp/webapp/img/ico/prohibition.png +0 -0
  317. data/solr/server/solr-webapp/webapp/img/ico/property.png +0 -0
  318. data/solr/server/solr-webapp/webapp/img/ico/question-small-white.png +0 -0
  319. data/solr/server/solr-webapp/webapp/img/ico/question-white.png +0 -0
  320. data/solr/server/solr-webapp/webapp/img/ico/question.png +0 -0
  321. data/solr/server/solr-webapp/webapp/img/ico/receipt-invoice.png +0 -0
  322. data/solr/server/solr-webapp/webapp/img/ico/receipt.png +0 -0
  323. data/solr/server/solr-webapp/webapp/img/ico/script-code.png +0 -0
  324. data/solr/server/solr-webapp/webapp/img/ico/server-cast.png +0 -0
  325. data/solr/server/solr-webapp/webapp/img/ico/server.png +0 -0
  326. data/solr/server/solr-webapp/webapp/img/ico/sitemap.png +0 -0
  327. data/solr/server/solr-webapp/webapp/img/ico/slash.png +0 -0
  328. data/solr/server/solr-webapp/webapp/img/ico/status-away.png +0 -0
  329. data/solr/server/solr-webapp/webapp/img/ico/status-busy.png +0 -0
  330. data/solr/server/solr-webapp/webapp/img/ico/status-offline.png +0 -0
  331. data/solr/server/solr-webapp/webapp/img/ico/status.png +0 -0
  332. data/solr/server/solr-webapp/webapp/img/ico/system-monitor--exclamation.png +0 -0
  333. data/solr/server/solr-webapp/webapp/img/ico/system-monitor.png +0 -0
  334. data/solr/server/solr-webapp/webapp/img/ico/table.png +0 -0
  335. data/solr/server/solr-webapp/webapp/img/ico/terminal.png +0 -0
  336. data/solr/server/solr-webapp/webapp/img/ico/tick-circle.png +0 -0
  337. data/solr/server/solr-webapp/webapp/img/ico/tick-red.png +0 -0
  338. data/solr/server/solr-webapp/webapp/img/ico/tick.png +0 -0
  339. data/solr/server/solr-webapp/webapp/img/ico/toggle-small-expand.png +0 -0
  340. data/solr/server/solr-webapp/webapp/img/ico/toggle-small.png +0 -0
  341. data/solr/server/solr-webapp/webapp/img/ico/toolbox.png +0 -0
  342. data/solr/server/solr-webapp/webapp/img/ico/ui-accordion.png +0 -0
  343. data/solr/server/solr-webapp/webapp/img/ico/ui-address-bar.png +0 -0
  344. data/solr/server/solr-webapp/webapp/img/ico/ui-check-box-uncheck.png +0 -0
  345. data/solr/server/solr-webapp/webapp/img/ico/ui-check-box.png +0 -0
  346. data/solr/server/solr-webapp/webapp/img/ico/ui-radio-button-uncheck.png +0 -0
  347. data/solr/server/solr-webapp/webapp/img/ico/ui-radio-button.png +0 -0
  348. data/solr/server/solr-webapp/webapp/img/ico/ui-text-field-select.png +0 -0
  349. data/solr/server/solr-webapp/webapp/img/ico/users.png +0 -0
  350. data/solr/server/solr-webapp/webapp/img/ico/wooden-box.png +0 -0
  351. data/solr/server/solr-webapp/webapp/img/ico/zone.png +0 -0
  352. data/solr/server/solr-webapp/webapp/img/loader-light.gif +0 -0
  353. data/solr/server/solr-webapp/webapp/img/loader.gif +0 -0
  354. data/solr/server/solr-webapp/webapp/img/lucene-ico.png +0 -0
  355. data/solr/server/solr-webapp/webapp/img/solr-ico.png +0 -0
  356. data/solr/server/solr-webapp/webapp/img/solr.svg +39 -0
  357. data/solr/server/solr-webapp/webapp/img/tree.png +0 -0
  358. data/solr/server/solr-webapp/webapp/index.html +208 -0
  359. data/solr/server/solr-webapp/webapp/js/angular/app.js +713 -0
  360. data/solr/server/solr-webapp/webapp/js/angular/controllers/analysis.js +199 -0
  361. data/solr/server/solr-webapp/webapp/js/angular/controllers/cloud.js +528 -0
  362. data/solr/server/solr-webapp/webapp/js/angular/controllers/core-overview.js +225 -0
  363. data/solr/server/solr-webapp/webapp/js/angular/controllers/cores.js +465 -0
  364. data/solr/server/solr-webapp/webapp/js/angular/controllers/dataimport.js +284 -0
  365. data/solr/server/solr-webapp/webapp/js/angular/controllers/documents.js +139 -0
  366. data/solr/server/solr-webapp/webapp/js/angular/controllers/files.js +92 -0
  367. data/solr/server/solr-webapp/webapp/js/angular/controllers/index.js +95 -0
  368. data/solr/server/solr-webapp/webapp/js/angular/controllers/java-properties.js +45 -0
  369. data/solr/server/solr-webapp/webapp/js/angular/controllers/logging.js +146 -0
  370. data/solr/server/solr-webapp/webapp/js/angular/controllers/plugins.js +166 -0
  371. data/solr/server/solr-webapp/webapp/js/angular/controllers/query.js +99 -0
  372. data/solr/server/solr-webapp/webapp/js/angular/controllers/replication.js +227 -0
  373. data/solr/server/solr-webapp/webapp/js/angular/controllers/schema-browser.js +432 -0
  374. data/solr/server/solr-webapp/webapp/js/angular/controllers/segments.js +94 -0
  375. data/solr/server/solr-webapp/webapp/js/angular/controllers/threads.js +51 -0
  376. data/solr/server/solr-webapp/webapp/js/angular/services.js +214 -0
  377. data/solr/server/solr-webapp/webapp/js/lib/ZeroClipboard.js +342 -0
  378. data/solr/server/solr-webapp/webapp/js/lib/chosen.js +982 -0
  379. data/solr/server/solr-webapp/webapp/js/lib/console.js +29 -0
  380. data/solr/server/solr-webapp/webapp/js/lib/d3.js +9373 -0
  381. data/solr/server/solr-webapp/webapp/js/lib/highlight.js +31 -0
  382. data/solr/server/solr-webapp/webapp/js/lib/jquery-1.7.2.min.js +30 -0
  383. data/solr/server/solr-webapp/webapp/js/lib/jquery.ajaxfileupload.js +184 -0
  384. data/solr/server/solr-webapp/webapp/js/lib/jquery.blockUI.js +523 -0
  385. data/solr/server/solr-webapp/webapp/js/lib/jquery.cookie.js +71 -0
  386. data/solr/server/solr-webapp/webapp/js/lib/jquery.form.js +806 -0
  387. data/solr/server/solr-webapp/webapp/js/lib/jquery.jstree.js +3534 -0
  388. data/solr/server/solr-webapp/webapp/js/lib/jquery.sammy.js +1863 -0
  389. data/solr/server/solr-webapp/webapp/js/lib/jquery.timeago.js +189 -0
  390. data/solr/server/solr-webapp/webapp/js/lib/linker.js +48 -0
  391. data/solr/server/solr-webapp/webapp/js/lib/naturalSort.js +82 -0
  392. data/solr/server/solr-webapp/webapp/js/lib/order.js +216 -0
  393. data/solr/server/solr-webapp/webapp/js/main.js +60 -0
  394. data/solr/server/solr-webapp/webapp/js/require.js +11349 -0
  395. data/solr/server/solr-webapp/webapp/js/scripts/analysis.js +545 -0
  396. data/solr/server/solr-webapp/webapp/js/scripts/app.js +680 -0
  397. data/solr/server/solr-webapp/webapp/js/scripts/cloud.js +877 -0
  398. data/solr/server/solr-webapp/webapp/js/scripts/cores.js +719 -0
  399. data/solr/server/solr-webapp/webapp/js/scripts/dashboard.js +562 -0
  400. data/solr/server/solr-webapp/webapp/js/scripts/dataimport.js +812 -0
  401. data/solr/server/solr-webapp/webapp/js/scripts/documents.js +370 -0
  402. data/solr/server/solr-webapp/webapp/js/scripts/files.js +265 -0
  403. data/solr/server/solr-webapp/webapp/js/scripts/index.js +340 -0
  404. data/solr/server/solr-webapp/webapp/js/scripts/java-properties.js +106 -0
  405. data/solr/server/solr-webapp/webapp/js/scripts/logging.js +578 -0
  406. data/solr/server/solr-webapp/webapp/js/scripts/ping.js +72 -0
  407. data/solr/server/solr-webapp/webapp/js/scripts/plugins.js +462 -0
  408. data/solr/server/solr-webapp/webapp/js/scripts/query.js +229 -0
  409. data/solr/server/solr-webapp/webapp/js/scripts/replication.js +527 -0
  410. data/solr/server/solr-webapp/webapp/js/scripts/schema-browser.js +1229 -0
  411. data/solr/server/solr-webapp/webapp/js/scripts/segments.js +206 -0
  412. data/solr/server/solr-webapp/webapp/js/scripts/threads.js +158 -0
  413. data/solr/server/solr-webapp/webapp/libs/angular-chosen.js +139 -0
  414. data/solr/server/solr-webapp/webapp/libs/angular-cookies.js +229 -0
  415. data/solr/server/solr-webapp/webapp/libs/angular-cookies.min.js +31 -0
  416. data/solr/server/solr-webapp/webapp/libs/angular-resource.min.js +36 -0
  417. data/solr/server/solr-webapp/webapp/libs/angular-route.js +1018 -0
  418. data/solr/server/solr-webapp/webapp/libs/angular-route.min.js +38 -0
  419. data/solr/server/solr-webapp/webapp/libs/angular-sanitize.js +703 -0
  420. data/solr/server/solr-webapp/webapp/libs/angular-sanitize.min.js +39 -0
  421. data/solr/server/solr-webapp/webapp/libs/angular.js +26093 -0
  422. data/solr/server/solr-webapp/webapp/libs/angular.min.js +273 -0
  423. data/solr/server/solr-webapp/webapp/libs/chosen.jquery.js +1194 -0
  424. data/solr/server/solr-webapp/webapp/libs/chosen.jquery.min.js +30 -0
  425. data/solr/server/solr-webapp/webapp/libs/d3.js +9373 -0
  426. data/solr/server/solr-webapp/webapp/libs/highlight.js +31 -0
  427. data/solr/server/solr-webapp/webapp/libs/jquery-2.1.3.min.js +29 -0
  428. data/solr/server/solr-webapp/webapp/libs/jquery.jstree.js +3534 -0
  429. data/solr/server/solr-webapp/webapp/libs/ngtimeago.js +102 -0
  430. data/solr/server/solr-webapp/webapp/partials/analysis.html +128 -0
  431. data/solr/server/solr-webapp/webapp/partials/cloud.html +104 -0
  432. data/solr/server/solr-webapp/webapp/partials/core_overview.html +227 -0
  433. data/solr/server/solr-webapp/webapp/partials/cores.html +231 -0
  434. data/solr/server/solr-webapp/webapp/partials/dataimport.html +209 -0
  435. data/solr/server/solr-webapp/webapp/partials/documents.html +118 -0
  436. data/solr/server/solr-webapp/webapp/partials/files.html +47 -0
  437. data/solr/server/solr-webapp/webapp/partials/index.html +261 -0
  438. data/solr/server/solr-webapp/webapp/partials/java-properties.html +27 -0
  439. data/solr/server/solr-webapp/webapp/partials/logging-levels.html +56 -0
  440. data/solr/server/solr-webapp/webapp/partials/logging.html +56 -0
  441. data/solr/server/solr-webapp/webapp/partials/plugins.html +72 -0
  442. data/solr/server/solr-webapp/webapp/partials/query.html +356 -0
  443. data/solr/server/solr-webapp/webapp/partials/replication.html +239 -0
  444. data/solr/server/solr-webapp/webapp/partials/schema-browser.html +206 -0
  445. data/solr/server/solr-webapp/webapp/partials/segments.html +99 -0
  446. data/solr/server/solr-webapp/webapp/partials/threads.html +65 -0
  447. data/solr/server/solr-webapp/webapp/tpl/analysis.html +83 -0
  448. data/solr/server/solr-webapp/webapp/tpl/cloud.html +87 -0
  449. data/solr/server/solr-webapp/webapp/tpl/cores.html +226 -0
  450. data/solr/server/solr-webapp/webapp/tpl/dashboard.html +201 -0
  451. data/solr/server/solr-webapp/webapp/tpl/dataimport.html +183 -0
  452. data/solr/server/solr-webapp/webapp/tpl/documents.html +107 -0
  453. data/solr/server/solr-webapp/webapp/tpl/files.html +44 -0
  454. data/solr/server/solr-webapp/webapp/tpl/index.html +250 -0
  455. data/solr/server/solr-webapp/webapp/tpl/logging.html +23 -0
  456. data/solr/server/solr-webapp/webapp/tpl/plugins.html +39 -0
  457. data/solr/server/solr-webapp/webapp/tpl/query.html +361 -0
  458. data/solr/server/solr-webapp/webapp/tpl/replication.html +216 -0
  459. data/solr/server/solr-webapp/webapp/tpl/schema-browser.html +192 -0
  460. data/solr/server/solr-webapp/webapp/tpl/segments.html +49 -0
  461. data/solr/server/solr-webapp/webapp/tpl/threads.html +56 -0
  462. data/solr/server/solr/README.txt +77 -0
  463. data/solr/server/solr/solr.xml +51 -0
  464. data/solr/server/solr/zoo.cfg +17 -0
  465. data/solr/server/start.jar +0 -0
  466. data/solr/solr/README.txt +77 -0
  467. data/solr/solr/configsets/sunspot/conf/_rest_managed.json +1 -0
  468. data/solr/solr/{conf → configsets/sunspot/conf}/admin-extra.html +0 -0
  469. data/solr/solr/configsets/sunspot/conf/currency.xml +67 -0
  470. data/solr/solr/{conf → configsets/sunspot/conf}/elevate.xml +0 -0
  471. data/solr/solr/{conf/stopwords.txt → configsets/sunspot/conf/lang/stopwords_en.txt} +1 -5
  472. data/solr/solr/{conf → configsets/sunspot/conf}/mapping-ISOLatin1Accent.txt +0 -0
  473. data/solr/solr/{conf → configsets/sunspot/conf}/protwords.txt +0 -0
  474. data/solr/solr/{conf → configsets/sunspot/conf}/schema.xml +38 -35
  475. data/solr/solr/{conf → configsets/sunspot/conf}/scripts.conf +0 -0
  476. data/solr/solr/{conf → configsets/sunspot/conf}/solrconfig.xml +271 -320
  477. data/solr/solr/{conf → configsets/sunspot/conf}/spellings.txt +0 -0
  478. data/solr/solr/{conf → configsets/sunspot/conf}/synonyms.txt +3 -5
  479. data/solr/solr/default/core.properties +3 -0
  480. data/solr/solr/development/core.properties +3 -0
  481. data/solr/solr/solr.xml +49 -6
  482. data/solr/solr/test/core.properties +3 -0
  483. data/solr/solr/zoo.cfg +17 -0
  484. data/spec/installer_spec.rb +82 -0
  485. data/spec/java_spec.rb +58 -0
  486. data/spec/server_spec.rb +36 -79
  487. data/spec/spec_helper.rb +4 -16
  488. data/sunspot_solr.gemspec +3 -7
  489. metadata +496 -67
  490. data/lib/sunspot/solr/installer/config_installer.rb +0 -53
  491. data/lib/sunspot/solr/installer/task_helper.rb +0 -13
  492. data/solr/contexts/solr.xml +0 -7
  493. data/solr/lib/jetty-continuation-8.1.8.v20121106.jar +0 -0
  494. data/solr/lib/jetty-deploy-8.1.8.v20121106.jar +0 -0
  495. data/solr/lib/jetty-http-8.1.8.v20121106.jar +0 -0
  496. data/solr/lib/jetty-io-8.1.8.v20121106.jar +0 -0
  497. data/solr/lib/jetty-jmx-8.1.8.v20121106.jar +0 -0
  498. data/solr/lib/jetty-security-8.1.8.v20121106.jar +0 -0
  499. data/solr/lib/jetty-server-8.1.8.v20121106.jar +0 -0
  500. data/solr/lib/jetty-servlet-8.1.8.v20121106.jar +0 -0
  501. data/solr/lib/jetty-util-8.1.8.v20121106.jar +0 -0
  502. data/solr/lib/jetty-webapp-8.1.8.v20121106.jar +0 -0
  503. data/solr/lib/jetty-xml-8.1.8.v20121106.jar +0 -0
  504. data/solr/lib/jsp-2.1/ant-1.6.5.jar +0 -0
  505. data/solr/lib/jsp-2.1/core-3.1.1.jar +0 -0
  506. data/solr/lib/jsp-2.1/jsp-2.1.jar +0 -0
  507. data/solr/lib/jsp-2.1/jsp-api-2.1.jar +0 -0
  508. data/solr/lib/servlet-api-3.0.jar +0 -0
  509. data/solr/solr/conf/xslt/example.xsl +0 -132
  510. data/solr/solr/conf/xslt/example_atom.xsl +0 -67
  511. data/solr/solr/conf/xslt/example_rss.xsl +0 -66
  512. data/solr/solr/conf/xslt/luke.xsl +0 -337
  513. data/solr/solr/default/README.txt +0 -54
  514. data/solr/start.jar +0 -0
  515. data/solr/webapps/solr.war +0 -0
@@ -0,0 +1,1350 @@
1
+ #!/usr/bin/env bash
2
+ # Licensed to the Apache Software Foundation (ASF) under one or more
3
+ # contributor license agreements. See the NOTICE file distributed with
4
+ # this work for additional information regarding copyright ownership.
5
+ # The ASF licenses this file to You under the Apache License, Version 2.0
6
+ # (the "License"); you may not use this file except in compliance with
7
+ # the License. You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+
18
+ # CONTROLLING STARTUP:
19
+ #
20
+ # Use solr -help to see available command-line options. In addition
21
+ # to passing command-line options, this script looks for an include
22
+ # file named solr.in.sh to set environment variables. Specifically,
23
+ # the following locations are searched in this order:
24
+ #
25
+ # ./
26
+ # $HOME/.solr.in.sh
27
+ # /usr/share/solr
28
+ # /usr/local/share/solr
29
+ # /var/solr/
30
+ # /opt/solr
31
+ #
32
+ # Another option is to specify the full path to the include file in the
33
+ # environment. For example:
34
+ #
35
+ # $ SOLR_INCLUDE=/path/to/solr.in.sh solr start
36
+ #
37
+ # Note: This is particularly handy for running multiple instances on a
38
+ # single installation, or for quick tests.
39
+ #
40
+ # Finally, developers and enthusiasts who frequently run from an SVN
41
+ # checkout, and do not want to locally modify bin/solr.in.sh, can put
42
+ # a customized include file at ~/.solr.in.sh.
43
+ #
44
+ # If you would rather configure startup entirely from the environment, you
45
+ # can disable the include by exporting an empty SOLR_INCLUDE, or by
46
+ # ensuring that no include files exist in the aforementioned search list.
47
+
48
+ SOLR_SCRIPT="$0"
49
+ verbose=false
50
+ THIS_OS=`uname -s`
51
+
52
+ if hash jar 2>/dev/null ; then # hash returns true if jar is on the path
53
+ UNPACK_WAR_CMD=("$(command -v jar)" xf)
54
+ elif hash unzip 2>/dev/null ; then # hash returns true if unzip is on the path
55
+ UNPACK_WAR_CMD=("$(command -v unzip)" -q)
56
+ else
57
+ echo -e "This script requires extracting a WAR file with either the jar or unzip utility, please install these utilities or contact your administrator for assistance."
58
+ exit 1
59
+ fi
60
+
61
+ stop_all=false
62
+
63
+ # for now, we don't support running this script from cygwin due to problems
64
+ # like not having lsof, ps auxww, curl, and awkward directory handling
65
+ if [ "${THIS_OS:0:6}" == "CYGWIN" ]; then
66
+ echo -e "This script does not support cygwin due to severe limitations and lack of adherence\nto BASH standards, such as lack of lsof, curl, and ps options.\n\nPlease use the native solr.cmd script on Windows!"
67
+ exit 1
68
+ fi
69
+
70
+ # Resolve symlinks to this script
71
+ while [ -h "$SOLR_SCRIPT" ] ; do
72
+ ls=`ls -ld "$SOLR_SCRIPT"`
73
+ # Drop everything prior to ->
74
+ link=`expr "$ls" : '.*-> \(.*\)$'`
75
+ if expr "$link" : '/.*' > /dev/null; then
76
+ SOLR_SCRIPT="$link"
77
+ else
78
+ SOLR_SCRIPT=`dirname "$SOLR_SCRIPT"`/"$link"
79
+ fi
80
+ done
81
+
82
+ SOLR_TIP=`dirname "$SOLR_SCRIPT"`/..
83
+ SOLR_TIP=`cd "$SOLR_TIP"; pwd`
84
+ DEFAULT_SERVER_DIR="$SOLR_TIP/server"
85
+
86
+ # If an include wasn't specified in the environment, then search for one...
87
+ if [ -z "$SOLR_INCLUDE" ]; then
88
+ # Locations (in order) to use when searching for an include file.
89
+ for include in "`dirname "$0"`/solr.in.sh" \
90
+ "$HOME/.solr.in.sh" \
91
+ /usr/share/solr/solr.in.sh \
92
+ /usr/local/share/solr/solr.in.sh \
93
+ /var/solr/solr.in.sh \
94
+ /opt/solr/solr.in.sh; do
95
+ if [ -r "$include" ]; then
96
+ . "$include"
97
+ break
98
+ fi
99
+ done
100
+ elif [ -r "$SOLR_INCLUDE" ]; then
101
+ . "$SOLR_INCLUDE"
102
+ fi
103
+
104
+ if [ -z "$SOLR_PID_DIR" ]; then
105
+ SOLR_PID_DIR="$SOLR_TIP/bin"
106
+ fi
107
+
108
+ if [ -n "$SOLR_JAVA_HOME" ]; then
109
+ JAVA="$SOLR_JAVA_HOME/bin/java"
110
+ elif [ -n "$JAVA_HOME" ]; then
111
+ for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
112
+ if [ -x "$java" ]; then
113
+ JAVA="$java"
114
+ break
115
+ fi
116
+ done
117
+ if [ -z "$JAVA" ]; then
118
+ echo >&2 "The currently defined JAVA_HOME ($JAVA_HOME) refers"
119
+ echo >&2 "to a location where Java could not be found. Aborting."
120
+ echo >&2 "Either fix the JAVA_HOME variable or remove it from the"
121
+ echo >&2 "environment so that the system PATH will be searched."
122
+ exit 1
123
+ fi
124
+ else
125
+ JAVA=java
126
+ fi
127
+
128
+ # test that Java exists and is executable on this server
129
+ "$JAVA" -version >/dev/null 2>&1 || {
130
+ echo >&2 "Java not found, or an error was encountered when running java."
131
+ echo >&2 "A working Java 7 or later is required to run Solr!"
132
+ echo >&2 "Please install Java or fix JAVA_HOME before running this script."
133
+ echo >&2 "Command that we tried: '${JAVA} -version'"
134
+ echo >&2 "Active Path:"
135
+ echo >&2 "${PATH}"
136
+ exit 1
137
+ }
138
+
139
+ # Select HTTP OR HTTPS related configurations
140
+ SOLR_URL_SCHEME=http
141
+ SOLR_JETTY_CONFIG=()
142
+ SOLR_SSL_OPTS=""
143
+ if [ -n "$SOLR_SSL_KEY_STORE" ]; then
144
+ SOLR_JETTY_CONFIG+=("--module=https")
145
+ SOLR_URL_SCHEME=https
146
+ SOLR_SSL_OPTS=" -Dsolr.jetty.keystore=$SOLR_SSL_KEY_STORE \
147
+ -Dsolr.jetty.keystore.password=$SOLR_SSL_KEY_STORE_PASSWORD \
148
+ -Dsolr.jetty.truststore=$SOLR_SSL_TRUST_STORE \
149
+ -Dsolr.jetty.truststore.password=$SOLR_SSL_TRUST_STORE_PASSWORD \
150
+ -Dsolr.jetty.ssl.needClientAuth=$SOLR_SSL_NEED_CLIENT_AUTH \
151
+ -Dsolr.jetty.ssl.wantClientAuth=$SOLR_SSL_WANT_CLIENT_AUTH"
152
+ if [ -n "$SOLR_SSL_CLIENT_KEY_STORE" ]; then
153
+ SOLR_SSL_OPTS+=" -Djavax.net.ssl.keyStore=$SOLR_SSL_CLIENT_KEY_STORE \
154
+ -Djavax.net.ssl.keyStorePassword=$SOLR_SSL_CLIENT_KEY_STORE_PASSWORD \
155
+ -Djavax.net.ssl.trustStore=$SOLR_SSL_CLIENT_TRUST_STORE \
156
+ -Djavax.net.ssl.trustStorePassword=$SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD"
157
+ else
158
+ SOLR_SSL_OPTS+=" -Djavax.net.ssl.keyStore=$SOLR_SSL_KEY_STORE \
159
+ -Djavax.net.ssl.keyStorePassword=$SOLR_SSL_KEY_STORE_PASSWORD \
160
+ -Djavax.net.ssl.trustStore=$SOLR_SSL_TRUST_STORE \
161
+ -Djavax.net.ssl.trustStorePassword=$SOLR_SSL_TRUST_STORE_PASSWORD"
162
+ fi
163
+ else
164
+ SOLR_JETTY_CONFIG+=("--module=http")
165
+ fi
166
+
167
+ # Authentication options
168
+ if [ "$SOLR_AUTHENTICATION_CLIENT_CONFIGURER" != "" ]; then
169
+ AUTHC_CLIENT_CONFIGURER_ARG="-Dsolr.authentication.httpclient.configurer=$SOLR_AUTHENTICATION_CLIENT_CONFIGURER"
170
+ fi
171
+ AUTHC_OPTS="$AUTHC_CLIENT_CONFIGURER_ARG $SOLR_AUTHENTICATION_OPTS"
172
+
173
+ # Set the SOLR_TOOL_HOST variable for use when connecting to a running Solr instance
174
+ if [ "$SOLR_HOST" != "" ]; then
175
+ SOLR_TOOL_HOST="$SOLR_HOST"
176
+ else
177
+ SOLR_TOOL_HOST="localhost"
178
+ fi
179
+
180
+ function print_usage() {
181
+ CMD="$1"
182
+ ERROR_MSG="$2"
183
+
184
+ if [ "$ERROR_MSG" != "" ]; then
185
+ echo -e "\nERROR: $ERROR_MSG\n"
186
+ fi
187
+
188
+ if [ -z "$CMD" ]; then
189
+ echo ""
190
+ echo "Usage: solr COMMAND OPTIONS"
191
+ echo " where COMMAND is one of: start, stop, restart, status, healthcheck, create, create_core, create_collection, delete"
192
+ echo ""
193
+ echo " Standalone server example (start Solr running in the background on port 8984):"
194
+ echo ""
195
+ echo " ./solr start -p 8984"
196
+ echo ""
197
+ echo " 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):"
198
+ echo ""
199
+ echo " ./solr start -c -m 1g -z localhost:2181 -a \"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044\""
200
+ echo ""
201
+ echo "Pass -help after any COMMAND to see command-specific usage information,"
202
+ echo " such as: ./solr start -help or ./solr stop -help"
203
+ echo ""
204
+ elif [[ "$CMD" == "start" || "$CMD" == "restart" ]]; then
205
+ echo ""
206
+ echo "Usage: solr $CMD [-f] [-c] [-h hostname] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [-s solr.solr.home] [-a \"additional-options\"] [-V]"
207
+ echo ""
208
+ echo " -f Start Solr in foreground; default starts Solr in the background"
209
+ echo " and sends stdout / stderr to solr-PORT-console.log"
210
+ echo ""
211
+ echo " -c or -cloud Start Solr in SolrCloud mode; if -z not supplied, an embedded ZooKeeper"
212
+ echo " instance is started on Solr port+1000, such as 9983 if Solr is bound to 8983"
213
+ echo ""
214
+ echo " -h <host> Specify the hostname for this Solr instance"
215
+ echo ""
216
+ echo " -p <port> Specify the port to start the Solr HTTP listener on; default is 8983"
217
+ echo " The specified port (SOLR_PORT) will also be used to determine the stop port"
218
+ echo " STOP_PORT=(\$SOLR_PORT-1000) and JMX RMI listen port RMI_PORT=(1\$SOLR_PORT). "
219
+ echo " For instance, if you set -p 8985, then the STOP_PORT=7985 and RMI_PORT=18985"
220
+ echo ""
221
+ echo " -d <dir> Specify the Solr server directory; defaults to server"
222
+ echo ""
223
+ echo " -z <zkHost> ZooKeeper connection string; only used when running in SolrCloud mode using -c"
224
+ echo " To launch an embedded ZooKeeper instance, don't pass this parameter."
225
+ echo ""
226
+ echo " -m <memory> Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g"
227
+ echo " results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m"
228
+ echo ""
229
+ echo " -s <dir> Sets the solr.solr.home system property; Solr will create core directories under"
230
+ echo " this directory. This allows you to run multiple Solr instances on the same host"
231
+ echo " while reusing the same server directory set using the -d parameter. If set, the"
232
+ echo " specified directory should contain a solr.xml file, unless solr.xml exists in ZooKeeper."
233
+ echo " This parameter is ignored when running examples (-e), as the solr.solr.home depends"
234
+ echo " on which example is run. The default value is server/solr."
235
+ echo ""
236
+ echo " -e <example> Name of the example to run; available examples:"
237
+ echo " cloud: SolrCloud example"
238
+ echo " techproducts: Comprehensive example illustrating many of Solr's core capabilities"
239
+ echo " dih: Data Import Handler"
240
+ echo " schemaless: Schema-less example"
241
+ echo ""
242
+ echo " -a Additional parameters to pass to the JVM when starting Solr, such as to setup"
243
+ echo " Java debug options. For example, to enable a Java debugger to attach to the Solr JVM"
244
+ echo " you could pass: -a \"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=18983\""
245
+ echo " In most cases, you should wrap the additional parameters in double quotes."
246
+ echo ""
247
+ echo " -noprompt Don't prompt for input; accept all defaults when running examples that accept user input"
248
+ echo ""
249
+ echo " -V Verbose messages from this script"
250
+ echo ""
251
+ elif [ "$CMD" == "stop" ]; then
252
+ echo ""
253
+ echo "Usage: solr stop [-k key] [-p port] [-V]"
254
+ echo ""
255
+ echo " -k <key> Stop key; default is solrrocks"
256
+ echo ""
257
+ echo " -p <port> Specify the port the Solr HTTP listener is bound to"
258
+ echo ""
259
+ echo " -all Find and stop all running Solr servers on this host"
260
+ echo ""
261
+ echo " NOTE: To see if any Solr servers are running, do: solr status"
262
+ echo ""
263
+ elif [ "$CMD" == "healthcheck" ]; then
264
+ echo ""
265
+ echo "Usage: solr healthcheck [-c collection] [-z zkHost]"
266
+ echo ""
267
+ echo " -c <collection> Collection to run healthcheck against."
268
+ echo ""
269
+ echo " -z <zkHost> ZooKeeper connection string; default is localhost:9983"
270
+ echo ""
271
+ elif [ "$CMD" == "status" ]; then
272
+ echo ""
273
+ echo "Usage: solr status"
274
+ echo ""
275
+ echo " NOTE: This command will show the status of all running Solr servers"
276
+ echo ""
277
+ elif [ "$CMD" == "create" ]; then
278
+ echo ""
279
+ echo "Usage: solr create [-c name] [-d confdir] [-n configName] [-shards #] [-replicationFactor #] [-p port]"
280
+ echo ""
281
+ echo " Create a core or collection depending on whether Solr is running in standalone (core) or SolrCloud"
282
+ echo " mode (collection). In other words, this action detects which mode Solr is running in, and then takes"
283
+ echo " the appropriate action (either create_core or create_collection). For detailed usage instructions, do:"
284
+ echo ""
285
+ echo " bin/solr create_core -help"
286
+ echo ""
287
+ echo " or"
288
+ echo ""
289
+ echo " bin/solr create_collection -help"
290
+ echo ""
291
+ elif [ "$CMD" == "delete" ]; then
292
+ echo ""
293
+ echo "Usage: solr delete [-c name] [-deleteConfig true|false] [-p port]"
294
+ echo ""
295
+ echo " Deletes a core or collection depending on whether Solr is running in standalone (core) or SolrCloud"
296
+ echo " mode (collection). If you're deleting a collection in SolrCloud mode, the default behavior is to also"
297
+ echo " delete the configuration directory from ZooKeeper so long as it is not being used by another collection."
298
+ echo " You can override this behavior by passing -deleteConfig false when running this command."
299
+ echo ""
300
+ echo " -c <name> Name of the core / collection to delete"
301
+ echo ""
302
+ echo " -deleteConfig <boolean> Delete the configuration directory from ZooKeeper; default is true"
303
+ echo ""
304
+ echo " -p <port> Port of a local Solr instance where you want to delete the core/collection"
305
+ echo " If not specified, the script will search the local system for a running"
306
+ echo " Solr instance and will use the port of the first server it finds."
307
+ echo ""
308
+ elif [ "$CMD" == "create_core" ]; then
309
+ echo ""
310
+ echo "Usage: solr create_core [-c core] [-d confdir] [-p port]"
311
+ echo ""
312
+ echo " -c <core> Name of core to create"
313
+ echo ""
314
+ echo " -d <confdir> Configuration directory to copy when creating the new core, built-in options are:"
315
+ echo ""
316
+ echo " basic_configs: Minimal Solr configuration"
317
+ echo " data_driven_schema_configs: Managed schema with field-guessing support enabled"
318
+ echo " sample_techproducts_configs: Example configuration with many optional features enabled to"
319
+ echo " demonstrate the full power of Solr"
320
+ echo ""
321
+ echo " If not specified, default is: data_driven_schema_configs"
322
+ echo ""
323
+ echo " Alternatively, you can pass the path to your own configuration directory instead of using"
324
+ echo " one of the built-in configurations, such as: bin/solr create_core -c mycore -d /tmp/myconfig"
325
+ echo ""
326
+ echo " -p <port> Port of a local Solr instance where you want to create the new core"
327
+ echo " If not specified, the script will search the local system for a running"
328
+ echo " Solr instance and will use the port of the first server it finds."
329
+ echo ""
330
+ elif [ "$CMD" == "create_collection" ]; then
331
+ echo ""
332
+ echo "Usage: solr create_collection [-c collection] [-d confdir] [-n configName] [-shards #] [-replicationFactor #] [-p port]"
333
+ echo ""
334
+ echo " -c <collection> Name of collection to create"
335
+ echo ""
336
+ echo " -d <confdir> Configuration directory to copy when creating the new collection, built-in options are:"
337
+ echo ""
338
+ echo " basic_configs: Minimal Solr configuration"
339
+ echo " data_driven_schema_configs: Managed schema with field-guessing support enabled"
340
+ echo " sample_techproducts_configs: Example configuration with many optional features enabled to"
341
+ echo " demonstrate the full power of Solr"
342
+ echo ""
343
+ echo " If not specified, default is: data_driven_schema_configs"
344
+ echo ""
345
+ echo " Alternatively, you can pass the path to your own configuration directory instead of using"
346
+ echo " one of the built-in configurations, such as: bin/solr create_collection -c mycoll -d /tmp/myconfig"
347
+ echo ""
348
+ echo " By default the script will upload the specified confdir directory into ZooKeeper using the same"
349
+ echo " name as the collection (-c) option. Alternatively, if you want to reuse an existing directory"
350
+ echo " or create a confdir in ZooKeeper that can be shared by multiple collections, use the -n option"
351
+ echo ""
352
+ echo " -n <configName> Name the configuration directory in ZooKeeper; by default, the configuration"
353
+ echo " will be uploaded to ZooKeeper using the collection name (-c), but if you want"
354
+ echo " to use an existing directory or override the name of the configuration in"
355
+ echo " ZooKeeper, then use the -c option."
356
+ echo ""
357
+ echo " -shards <#> Number of shards to split the collection into; default is 1"
358
+ echo ""
359
+ echo " -replicationFactor <#> Number of copies of each document in the collection, default is 1 (no replication)"
360
+ echo ""
361
+ echo " -p <port> Port of a local Solr instance where you want to create the new collection"
362
+ echo " If not specified, the script will search the local system for a running"
363
+ echo " Solr instance and will use the port of the first server it finds."
364
+ echo ""
365
+ fi
366
+ } # end print_usage
367
+
368
+ # used to show the script is still alive when waiting on work to complete
369
+ function spinner() {
370
+ local pid=$1
371
+ local delay=0.5
372
+ local spinstr='|/-\'
373
+ while [ "$(ps aux | awk '{print $2}' | grep -w $pid)" ]; do
374
+ local temp=${spinstr#?}
375
+ printf " [%c] " "$spinstr"
376
+ local spinstr=$temp${spinstr%"$temp"}
377
+ sleep $delay
378
+ printf "\b\b\b\b\b\b"
379
+ done
380
+ printf " \b\b\b\b"
381
+ }
382
+
383
+ # given a port, find the pid for a Solr process
384
+ function solr_pid_by_port() {
385
+ THE_PORT="$1"
386
+ if [ -e "$SOLR_PID_DIR/solr-$THE_PORT.pid" ]; then
387
+ PID=`cat "$SOLR_PID_DIR/solr-$THE_PORT.pid"`
388
+ CHECK_PID=`ps auxww | awk '{print $2}' | grep -w $PID | sort -r | tr -d ' '`
389
+ if [ "$CHECK_PID" != "" ]; then
390
+ local solrPID=$PID
391
+ fi
392
+ fi
393
+ echo "$solrPID"
394
+ }
395
+
396
+ # extract the value of the -Djetty.port parameter from a running Solr process
397
+ function jetty_port() {
398
+ SOLR_PID="$1"
399
+ SOLR_PROC=`ps auxww | grep -w $SOLR_PID | grep start\.jar | grep jetty.port`
400
+ IFS=' ' read -a proc_args <<< "$SOLR_PROC"
401
+ for arg in "${proc_args[@]}"
402
+ do
403
+ IFS='=' read -a pair <<< "$arg"
404
+ if [ "${pair[0]}" == "-Djetty.port" ]; then
405
+ local jetty_port="${pair[1]}"
406
+ break
407
+ fi
408
+ done
409
+ echo "$jetty_port"
410
+ } # end jetty_port func
411
+
412
+ # run a Solr command-line tool using the SolrCLI class;
413
+ # useful for doing cross-platform work from the command-line using Java
414
+ function run_tool() {
415
+
416
+ "$JAVA" $SOLR_SSL_OPTS $AUTHC_OPTS -Dsolr.install.dir="$SOLR_TIP" \
417
+ -Dlog4j.configuration="file:$DEFAULT_SERVER_DIR/scripts/cloud-scripts/log4j.properties" \
418
+ -classpath "$DEFAULT_SERVER_DIR/solr-webapp/webapp/WEB-INF/lib/*:$DEFAULT_SERVER_DIR/lib/ext/*" \
419
+ org.apache.solr.util.SolrCLI "$@"
420
+
421
+ return $?
422
+ } # end run_tool function
423
+
424
+ # get information about any Solr nodes running on this host
425
+ function get_info() {
426
+ # first, see if Solr is running
427
+ numSolrs=`find "$SOLR_PID_DIR" -name "solr-*.pid" -type f | wc -l | tr -d ' '`
428
+ if [ "$numSolrs" != "0" ]; then
429
+ echo -e "\nFound $numSolrs Solr nodes: "
430
+ find "$SOLR_PID_DIR" -name "solr-*.pid" -type f | while read PIDF
431
+ do
432
+ ID=`cat "$PIDF"`
433
+ port=`jetty_port "$ID"`
434
+ if [ "$port" != "" ]; then
435
+ echo -e "\nSolr process $ID running on port $port"
436
+ run_tool status -solr "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:$port/solr"
437
+ echo ""
438
+ else
439
+ echo -e "\nSolr process $ID from $PIDF not found."
440
+ fi
441
+ done
442
+ else
443
+ # no pid files but check using ps just to be sure
444
+ numSolrs=`ps auxww | grep start\.jar | grep solr.solr.home | grep -v grep | wc -l | sed -e 's/^[ \t]*//'`
445
+ if [ "$numSolrs" != "0" ]; then
446
+ echo -e "\nFound $numSolrs Solr nodes: "
447
+ for ID in `ps auxww | grep start\.jar | grep solr.solr.home | grep -v grep | awk '{print $2}' | sort -r`
448
+ do
449
+ port=`jetty_port "$ID"`
450
+ if [ "$port" != "" ]; then
451
+ echo ""
452
+ echo "Solr process $ID running on port $port"
453
+ run_tool status -solr "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:$port/solr"
454
+ echo ""
455
+ fi
456
+ done
457
+ else
458
+ echo -e "\nNo Solr nodes are running.\n"
459
+ fi
460
+ fi
461
+
462
+ } # end get_info
463
+
464
+ # tries to gracefully stop Solr using the Jetty
465
+ # stop command and if that fails, then uses kill -9
466
+ function stop_solr() {
467
+
468
+ DIR="$1"
469
+ SOLR_PORT="$2"
470
+ STOP_PORT=`expr $SOLR_PORT - 1000`
471
+ STOP_KEY="$3"
472
+ SOLR_PID="$4"
473
+
474
+ if [ "$SOLR_PID" != "" ]; then
475
+ echo -e "Sending stop command to Solr running on port $SOLR_PORT ... waiting 5 seconds to allow Jetty process $SOLR_PID to stop gracefully."
476
+ "$JAVA" $SOLR_SSL_OPTS $AUTHC_OPTS -jar "$DIR/start.jar" "STOP.PORT=$STOP_PORT" "STOP.KEY=$STOP_KEY" --stop || true
477
+ (sleep 5) &
478
+ spinner $!
479
+ rm -f "$SOLR_PID_DIR/solr-$SOLR_PORT.pid"
480
+ else
481
+ echo -e "No Solr nodes found to stop."
482
+ exit 0
483
+ fi
484
+
485
+ CHECK_PID=`ps auxww | awk '{print $2}' | grep -w $SOLR_PID | sort -r | tr -d ' '`
486
+ if [ "$CHECK_PID" != "" ]; then
487
+ echo -e "Solr process $SOLR_PID is still running; forcefully killing it now."
488
+ kill -9 $SOLR_PID
489
+ echo "Killed process $SOLR_PID"
490
+ rm -f "$SOLR_PID_DIR/solr-$SOLR_PORT.pid"
491
+ sleep 1
492
+ fi
493
+
494
+ CHECK_PID=`ps auxww | awk '{print $2}' | grep -w $SOLR_PID | sort -r | tr -d ' '`
495
+ if [ "$CHECK_PID" != "" ]; then
496
+ echo "ERROR: Failed to kill previous Solr Java process $SOLR_PID ... script fails."
497
+ exit 1
498
+ fi
499
+ } # end stop_solr
500
+
501
+ if [ $# -eq 1 ]; then
502
+ case $1 in
503
+ -help|-usage)
504
+ print_usage ""
505
+ exit
506
+ ;;
507
+ -info|-i|status)
508
+ get_info
509
+ exit
510
+ ;;
511
+ esac
512
+ fi
513
+
514
+ if [ $# -gt 0 ]; then
515
+ # if first arg starts with a dash (and it's not -help or -info),
516
+ # then assume they are starting Solr, such as: solr -f
517
+ if [[ $1 == -* ]]; then
518
+ SCRIPT_CMD="start"
519
+ else
520
+ SCRIPT_CMD="$1"
521
+ shift
522
+ fi
523
+ else
524
+ # no args - just show usage and exit
525
+ print_usage ""
526
+ exit
527
+ fi
528
+
529
+ if [ "$SCRIPT_CMD" == "status" ]; then
530
+ # hacky - the script hits this if the user passes additional args with the status command,
531
+ # which is not supported but also not worth complaining about either
532
+ get_info
533
+ exit
534
+ fi
535
+
536
+ # run a healthcheck and exit if requested
537
+ if [ "$SCRIPT_CMD" == "healthcheck" ]; then
538
+
539
+ if [ $# -gt 0 ]; then
540
+ while true; do
541
+ case "$1" in
542
+ -c|-collection)
543
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
544
+ print_usage "$SCRIPT_CMD" "Collection name is required when using the $1 option!"
545
+ exit 1
546
+ fi
547
+ HEALTHCHECK_COLLECTION="$2"
548
+ shift 2
549
+ ;;
550
+ -z|-zkhost)
551
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
552
+ print_usage "$SCRIPT_CMD" "ZooKeepeer connection string is required when using the $1 option!"
553
+ exit 1
554
+ fi
555
+ ZK_HOST="$2"
556
+ shift 2
557
+ ;;
558
+ -help|-usage)
559
+ print_usage "$SCRIPT_CMD"
560
+ exit 0
561
+ ;;
562
+ --)
563
+ shift
564
+ break
565
+ ;;
566
+ *)
567
+ if [ "$1" != "" ]; then
568
+ print_usage "$SCRIPT_CMD" "Unrecognized or misplaced argument: $1!"
569
+ exit 1
570
+ else
571
+ break # out-of-args, stop looping
572
+ fi
573
+ ;;
574
+ esac
575
+ done
576
+ fi
577
+
578
+ if [ -z "$ZK_HOST" ]; then
579
+ ZK_HOST=localhost:9983
580
+ fi
581
+
582
+ if [ -z "$HEALTHCHECK_COLLECTION" ]; then
583
+ echo "collection parameter is required!"
584
+ print_usage "healthcheck"
585
+ exit 1
586
+ fi
587
+
588
+ run_tool healthcheck -zkHost "$ZK_HOST" -collection "$HEALTHCHECK_COLLECTION"
589
+
590
+ exit $?
591
+ fi
592
+
593
+ # create a core or collection
594
+ if [[ "$SCRIPT_CMD" == "create" || "$SCRIPT_CMD" == "create_core" || "$SCRIPT_CMD" == "create_collection" ]]; then
595
+
596
+ CREATE_NUM_SHARDS=1
597
+ CREATE_REPFACT=1
598
+
599
+ if [ $# -gt 0 ]; then
600
+ while true; do
601
+ case "$1" in
602
+ -c|-core|-collection)
603
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
604
+ print_usage "$SCRIPT_CMD" "name is required when using the $1 option!"
605
+ exit 1
606
+ fi
607
+ CREATE_NAME="$2"
608
+ shift 2
609
+ ;;
610
+ -n|-confname)
611
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
612
+ print_usage "$SCRIPT_CMD" "Configuration name is required when using the $1 option!"
613
+ exit 1
614
+ fi
615
+ CREATE_CONFNAME="$2"
616
+ shift 2
617
+ ;;
618
+ -d|-confdir)
619
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
620
+ print_usage "$SCRIPT_CMD" "Configuration directory is required when using the $1 option!"
621
+ exit 1
622
+ fi
623
+ CREATE_CONFDIR="$2"
624
+ shift 2
625
+ ;;
626
+ -s|-shards)
627
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
628
+ print_usage "$SCRIPT_CMD" "Shard count is required when using the $1 option!"
629
+ exit 1
630
+ fi
631
+ CREATE_NUM_SHARDS="$2"
632
+ shift 2
633
+ ;;
634
+ -rf|-replicationFactor)
635
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
636
+ print_usage "$SCRIPT_CMD" "Replication factor is required when using the $1 option!"
637
+ exit 1
638
+ fi
639
+ CREATE_REPFACT="$2"
640
+ shift 2
641
+ ;;
642
+ -p|-port)
643
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
644
+ print_usage "$SCRIPT_CMD" "Solr port is required when using the $1 option!"
645
+ exit 1
646
+ fi
647
+ CREATE_PORT="$2"
648
+ shift 2
649
+ ;;
650
+ -help|-usage)
651
+ print_usage "$SCRIPT_CMD"
652
+ exit 0
653
+ ;;
654
+ --)
655
+ shift
656
+ break
657
+ ;;
658
+ *)
659
+ if [ "$1" != "" ]; then
660
+ print_usage "$SCRIPT_CMD" "Unrecognized or misplaced argument: $1!"
661
+ exit 1
662
+ else
663
+ break # out-of-args, stop looping
664
+ fi
665
+ ;;
666
+ esac
667
+ done
668
+ fi
669
+
670
+ if [ -z "$CREATE_CONFDIR" ]; then
671
+ CREATE_CONFDIR='data_driven_schema_configs'
672
+ fi
673
+
674
+ # validate the confdir arg
675
+ if [[ ! -d "$SOLR_TIP/server/solr/configsets/$CREATE_CONFDIR" && ! -d "$CREATE_CONFDIR" ]]; then
676
+ echo -e "\nSpecified configuration directory $CREATE_CONFDIR not found!\n"
677
+ exit 1
678
+ fi
679
+
680
+ if [ -z "$CREATE_NAME" ]; then
681
+ echo "Name (-c) argument is required!"
682
+ print_usage "$SCRIPT_CMD"
683
+ exit 1
684
+ fi
685
+
686
+ # If not defined, use the collection name for the name of the configuration in ZooKeeper
687
+ if [ -z "$CREATE_CONFNAME" ]; then
688
+ CREATE_CONFNAME="$CREATE_NAME"
689
+ fi
690
+
691
+ if [ -z "$CREATE_PORT" ]; then
692
+ for ID in `ps auxww | grep java | grep start\.jar | awk '{print $2}' | sort -r`
693
+ do
694
+ port=`jetty_port "$ID"`
695
+ if [ "$port" != "" ]; then
696
+ CREATE_PORT=$port
697
+ break
698
+ fi
699
+ done
700
+ fi
701
+
702
+ if [ -z "$CREATE_PORT" ]; then
703
+ echo "Failed to determine the port of a local Solr instance, cannot create $CREATE_NAME!"
704
+ exit 1
705
+ fi
706
+
707
+ if [ "$SCRIPT_CMD" == "create_core" ]; then
708
+ run_tool create_core -name "$CREATE_NAME" -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:$CREATE_PORT/solr" \
709
+ -confdir "$CREATE_CONFDIR" -configsetsDir "$SOLR_TIP/server/solr/configsets"
710
+ exit $?
711
+ else
712
+ run_tool "$SCRIPT_CMD" -name "$CREATE_NAME" -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:$CREATE_PORT/solr" \
713
+ -shards "$CREATE_NUM_SHARDS" -replicationFactor "$CREATE_REPFACT" \
714
+ -confname "$CREATE_CONFNAME" -confdir "$CREATE_CONFDIR" \
715
+ -configsetsDir "$SOLR_TIP/server/solr/configsets"
716
+ exit $?
717
+ fi
718
+ fi
719
+
720
+ # delete a core or collection
721
+ if [[ "$SCRIPT_CMD" == "delete" ]]; then
722
+
723
+ if [ $# -gt 0 ]; then
724
+ while true; do
725
+ case "$1" in
726
+ -c|-core|-collection)
727
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
728
+ print_usage "$SCRIPT_CMD" "name is required when using the $1 option!"
729
+ exit 1
730
+ fi
731
+ DELETE_NAME="$2"
732
+ shift 2
733
+ ;;
734
+ -p|-port)
735
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
736
+ print_usage "$SCRIPT_CMD" "Solr port is required when using the $1 option!"
737
+ exit 1
738
+ fi
739
+ DELETE_PORT="$2"
740
+ shift 2
741
+ ;;
742
+ -deleteConfig)
743
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
744
+ print_usage "$SCRIPT_CMD" "true|false is required when using the $1 option!"
745
+ exit 1
746
+ fi
747
+ DELETE_CONFIG="$2"
748
+ shift 2
749
+ ;;
750
+ -help|-usage)
751
+ print_usage "$SCRIPT_CMD"
752
+ exit 0
753
+ ;;
754
+ --)
755
+ shift
756
+ break
757
+ ;;
758
+ *)
759
+ if [ "$1" != "" ]; then
760
+ print_usage "$SCRIPT_CMD" "Unrecognized or misplaced argument: $1!"
761
+ exit 1
762
+ else
763
+ break # out-of-args, stop looping
764
+ fi
765
+ ;;
766
+ esac
767
+ done
768
+ fi
769
+
770
+ if [ -z "$DELETE_NAME" ]; then
771
+ echo "Name (-c) argument is required!"
772
+ print_usage "$SCRIPT_CMD"
773
+ exit 1
774
+ fi
775
+
776
+ # If not defined, use the collection name for the name of the configuration in ZooKeeper
777
+ if [ -z "$DELETE_CONFIG" ]; then
778
+ DELETE_CONFIG=true
779
+ fi
780
+
781
+ if [ -z "$DELETE_PORT" ]; then
782
+ for ID in `ps auxww | grep java | grep start\.jar | awk '{print $2}' | sort -r`
783
+ do
784
+ port=`jetty_port "$ID"`
785
+ if [ "$port" != "" ]; then
786
+ DELETE_PORT=$port
787
+ break
788
+ fi
789
+ done
790
+ fi
791
+
792
+ if [ -z "$DELETE_PORT" ]; then
793
+ echo "Failed to determine the port of a local Solr instance, cannot delete $DELETE_NAME!"
794
+ exit 1
795
+ fi
796
+
797
+ run_tool delete -name "$DELETE_NAME" -deleteConfig "$DELETE_CONFIG" \
798
+ -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:$DELETE_PORT/solr"
799
+ exit $?
800
+ fi
801
+
802
+ # verify the command given is supported
803
+ if [ "$SCRIPT_CMD" != "stop" ] && [ "$SCRIPT_CMD" != "start" ] && [ "$SCRIPT_CMD" != "restart" ] && [ "$SCRIPT_CMD" != "status" ]; then
804
+ print_usage "" "$SCRIPT_CMD is not a valid command!"
805
+ exit 1
806
+ fi
807
+
808
+ # Run in foreground (default is to run in the background)
809
+ FG="false"
810
+ noprompt=false
811
+ SOLR_OPTS=($SOLR_OPTS)
812
+ PASS_TO_RUN_EXAMPLE=
813
+
814
+ if [ $# -gt 0 ]; then
815
+ while true; do
816
+ case "$1" in
817
+ -c|-cloud)
818
+ SOLR_MODE="solrcloud"
819
+ PASS_TO_RUN_EXAMPLE+=" -c"
820
+ shift
821
+ ;;
822
+ -d|-dir)
823
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
824
+ print_usage "$SCRIPT_CMD" "Server directory is required when using the $1 option!"
825
+ exit 1
826
+ fi
827
+
828
+ if [[ "$2" == "." || "$2" == "./" || "$2" == ".." || "$2" == "../" ]]; then
829
+ SOLR_SERVER_DIR="$(pwd)/$2"
830
+ else
831
+ # see if the arg value is relative to the tip vs full path
832
+ if [[ "$2" != /* ]] && [[ -d "$SOLR_TIP/$2" ]]; then
833
+ SOLR_SERVER_DIR="$SOLR_TIP/$2"
834
+ else
835
+ SOLR_SERVER_DIR="$2"
836
+ fi
837
+ fi
838
+ # resolve it to an absolute path
839
+ SOLR_SERVER_DIR="$(cd "$SOLR_SERVER_DIR"; pwd)"
840
+ shift 2
841
+ ;;
842
+ -s|-solr.home)
843
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
844
+ print_usage "$SCRIPT_CMD" "Solr home directory is required when using the $1 option!"
845
+ exit 1
846
+ fi
847
+
848
+ SOLR_HOME="$2"
849
+ shift 2
850
+ ;;
851
+ -e|-example)
852
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
853
+ print_usage "$SCRIPT_CMD" "Example name is required when using the $1 option!"
854
+ exit 1
855
+ fi
856
+ EXAMPLE="$2"
857
+ shift 2
858
+ ;;
859
+ -f|-foreground)
860
+ FG="true"
861
+ shift
862
+ ;;
863
+ -h|-host)
864
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
865
+ print_usage "$SCRIPT_CMD" "Hostname is required when using the $1 option!"
866
+ exit 1
867
+ fi
868
+ SOLR_HOST="$2"
869
+ PASS_TO_RUN_EXAMPLE+=" -h $SOLR_HOST"
870
+ shift 2
871
+ ;;
872
+ -m|-memory)
873
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
874
+ print_usage "$SCRIPT_CMD" "Memory setting is required when using the $1 option!"
875
+ exit 1
876
+ fi
877
+ SOLR_HEAP="$2"
878
+ PASS_TO_RUN_EXAMPLE+=" -m $SOLR_HEAP"
879
+ shift 2
880
+ ;;
881
+ -p|-port)
882
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
883
+ print_usage "$SCRIPT_CMD" "Port number is required when using the $1 option!"
884
+ exit 1
885
+ fi
886
+ SOLR_PORT="$2"
887
+ PASS_TO_RUN_EXAMPLE+=" -p $SOLR_PORT"
888
+ shift 2
889
+ ;;
890
+ -z|-zkhost)
891
+ if [[ -z "$2" || "${2:0:1}" == "-" ]]; then
892
+ print_usage "$SCRIPT_CMD" "ZooKeeper connection string is required when using the $1 option!"
893
+ exit 1
894
+ fi
895
+ ZK_HOST="$2"
896
+ SOLR_MODE="solrcloud"
897
+ PASS_TO_RUN_EXAMPLE+=" -z $ZK_HOST"
898
+ shift 2
899
+ ;;
900
+ -a|-addlopts)
901
+ ADDITIONAL_CMD_OPTS="$2"
902
+ PASS_TO_RUN_EXAMPLE+=" -a \"$ADDITIONAL_CMD_OPTS\""
903
+ shift 2
904
+ ;;
905
+ -k|-key)
906
+ STOP_KEY="$2"
907
+ shift 2
908
+ ;;
909
+ -help|-usage)
910
+ print_usage "$SCRIPT_CMD"
911
+ exit 0
912
+ ;;
913
+ -noprompt)
914
+ noprompt=true
915
+ PASS_TO_RUN_EXAMPLE+=" -noprompt"
916
+ shift
917
+ ;;
918
+ -V|-verbose)
919
+ verbose=true
920
+ PASS_TO_RUN_EXAMPLE+=" --verbose"
921
+ shift
922
+ ;;
923
+ -all)
924
+ stop_all=true
925
+ shift
926
+ ;;
927
+ --)
928
+ shift
929
+ break
930
+ ;;
931
+ *)
932
+ if [ "${1:0:2}" == "-D" ]; then
933
+ # pass thru any opts that begin with -D (java system props)
934
+ SOLR_OPTS+=("$1")
935
+ PASS_TO_RUN_EXAMPLE+=" $1"
936
+ shift
937
+ else
938
+ if [ "$1" != "" ]; then
939
+ print_usage "$SCRIPT_CMD" "$1 is not supported by this script"
940
+ exit 1
941
+ else
942
+ break # out-of-args, stop looping
943
+ fi
944
+ fi
945
+ ;;
946
+ esac
947
+ done
948
+ fi
949
+
950
+ if [ -z "$SOLR_SERVER_DIR" ]; then
951
+ SOLR_SERVER_DIR="$DEFAULT_SERVER_DIR"
952
+ fi
953
+
954
+ if [ ! -e "$SOLR_SERVER_DIR" ]; then
955
+ echo -e "\nSolr server directory $SOLR_SERVER_DIR not found!\n"
956
+ exit 1
957
+ fi
958
+
959
+ if [[ "$FG" == 'true' && "$EXAMPLE" != "" ]]; then
960
+ FG='false'
961
+ echo -e "\nWARNING: Foreground mode (-f) not supported when running examples.\n"
962
+ fi
963
+
964
+ #
965
+ # If the user specified an example to run, invoke the run_example tool (Java app) and exit
966
+ # otherwise let this script proceed to process the user request
967
+ #
968
+ if [ -n "$EXAMPLE" ] && [ "$SCRIPT_CMD" == "start" ]; then
969
+ run_tool run_example -e $EXAMPLE -d "$SOLR_SERVER_DIR" -urlScheme $SOLR_URL_SCHEME $PASS_TO_RUN_EXAMPLE
970
+ exit $?
971
+ fi
972
+
973
+ ############# start/stop logic below here ################
974
+
975
+ if $verbose ; then
976
+ echo "Using Solr root directory: $SOLR_TIP"
977
+ echo "Using Java: $JAVA"
978
+ "$JAVA" -version
979
+ fi
980
+
981
+ if [ "$SOLR_HOST" != "" ]; then
982
+ SOLR_HOST_ARG=("-Dhost=$SOLR_HOST")
983
+ else
984
+ SOLR_HOST_ARG=()
985
+ fi
986
+
987
+ if [ -z "$STOP_KEY" ]; then
988
+ STOP_KEY='solrrocks'
989
+ fi
990
+
991
+ # stop all if no port specified
992
+ if [[ "$SCRIPT_CMD" == "stop" && -z "$SOLR_PORT" ]]; then
993
+ if $stop_all; then
994
+ none_stopped=true
995
+ find "$SOLR_PID_DIR" -name "solr-*.pid" -type f | while read PIDF
996
+ do
997
+ NEXT_PID=`cat "$PIDF"`
998
+ port=`jetty_port "$NEXT_PID"`
999
+ if [ "$port" != "" ]; then
1000
+ stop_solr "$SOLR_SERVER_DIR" "$port" "$STOP_KEY" "$NEXT_PID"
1001
+ none_stopped=false
1002
+ fi
1003
+ rm -f "$PIDF"
1004
+ done
1005
+ # TODO: none_stopped doesn't get reflected across the subshell
1006
+ # This can be uncommented once we find a clean way out of it
1007
+ # if $none_stopped; then
1008
+ # echo -e "\nNo Solr nodes found to stop.\n"
1009
+ # fi
1010
+ else
1011
+ # not stopping all and don't have a port, but if we can find the pid file for the default port 8983, then use that
1012
+ none_stopped=true
1013
+ numSolrs=`find "$SOLR_PID_DIR" -name "solr-*.pid" -type f | wc -l | tr -d ' '`
1014
+ if [ $numSolrs -eq 1 ]; then
1015
+ # only do this if there is only 1 node running, otherwise they must provide the -p or -all
1016
+ PID="$(cat "$(find "$SOLR_PID_DIR" -name "solr-*.pid" -type f)")"
1017
+ CHECK_PID=`ps auxww | awk '{print $2}' | grep -w $PID | sort -r | tr -d ' '`
1018
+ if [ "$CHECK_PID" != "" ]; then
1019
+ port=`jetty_port "$CHECK_PID"`
1020
+ if [ "$port" != "" ]; then
1021
+ stop_solr "$SOLR_SERVER_DIR" "$port" "$STOP_KEY" "$CHECK_PID"
1022
+ none_stopped=false
1023
+ fi
1024
+ fi
1025
+ fi
1026
+
1027
+ if $none_stopped; then
1028
+ if [ $numSolrs -gt 0 ]; then
1029
+ echo -e "\nFound $numSolrs Solr nodes running! Must either specify a port using -p or -all to stop all Solr nodes on this host.\n"
1030
+ else
1031
+ echo -e "\nNo Solr nodes found to stop.\n"
1032
+ fi
1033
+ exit 1
1034
+ fi
1035
+ fi
1036
+ exit
1037
+ fi
1038
+
1039
+ if [ -z "$SOLR_PORT" ]; then
1040
+ SOLR_PORT=8983
1041
+ fi
1042
+
1043
+ if [ -z "$STOP_PORT" ]; then
1044
+ STOP_PORT=`expr $SOLR_PORT - 1000`
1045
+ fi
1046
+
1047
+ if [[ "$SCRIPT_CMD" == "start" ]]; then
1048
+ # see if Solr is already running
1049
+ SOLR_PID=`solr_pid_by_port "$SOLR_PORT"`
1050
+
1051
+ if [ -z "$SOLR_PID" ]; then
1052
+ # not found using the pid file ... but use ps to ensure not found
1053
+ SOLR_PID=`ps auxww | grep start\.jar | grep -w $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
1054
+ fi
1055
+
1056
+ if [ "$SOLR_PID" != "" ]; then
1057
+ echo -e "\nPort $SOLR_PORT is already being used by another process (pid: $SOLR_PID)\nPlease choose a different port using the -p option.\n"
1058
+ exit 1
1059
+ fi
1060
+ else
1061
+ # either stop or restart
1062
+ # see if Solr is already running
1063
+ SOLR_PID=`solr_pid_by_port "$SOLR_PORT"`
1064
+ if [ -z "$SOLR_PID" ]; then
1065
+ # not found using the pid file ... but use ps to ensure not found
1066
+ SOLR_PID=`ps auxww | grep start\.jar | grep -w $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
1067
+ fi
1068
+ if [ "$SOLR_PID" != "" ]; then
1069
+ stop_solr "$SOLR_SERVER_DIR" "$SOLR_PORT" "$STOP_KEY" "$SOLR_PID"
1070
+ else
1071
+ if [ "$SCRIPT_CMD" == "stop" ]; then
1072
+ echo -e "No process found for Solr node running on port $SOLR_PORT"
1073
+ exit 1
1074
+ fi
1075
+ fi
1076
+ fi
1077
+
1078
+ if [ -z "$SOLR_HOME" ]; then
1079
+ SOLR_HOME="$SOLR_SERVER_DIR/solr"
1080
+ else
1081
+ if [[ $SOLR_HOME != /* ]] && [[ -d "$SOLR_SERVER_DIR/$SOLR_HOME" ]]; then
1082
+ SOLR_HOME="$SOLR_SERVER_DIR/$SOLR_HOME"
1083
+ SOLR_PID_DIR="$SOLR_HOME"
1084
+ elif [[ $SOLR_HOME != /* ]] && [[ -d "`pwd`/$SOLR_HOME" ]]; then
1085
+ SOLR_HOME="$(pwd)/$SOLR_HOME"
1086
+ fi
1087
+ fi
1088
+
1089
+ # This is quite hacky, but examples rely on a different log4j.properties
1090
+ # so that we can write logs for examples to $SOLR_HOME/../logs
1091
+ if [ -z "$SOLR_LOGS_DIR" ]; then
1092
+ SOLR_LOGS_DIR="$SOLR_SERVER_DIR/logs"
1093
+ fi
1094
+ EXAMPLE_DIR="$SOLR_TIP/example"
1095
+ if [ "${SOLR_HOME:0:${#EXAMPLE_DIR}}" = "$EXAMPLE_DIR" ]; then
1096
+ LOG4J_PROPS="$EXAMPLE_DIR/resources/log4j.properties"
1097
+ SOLR_LOGS_DIR="$SOLR_HOME/../logs"
1098
+ fi
1099
+
1100
+ LOG4J_CONFIG=()
1101
+ if [ -n "$LOG4J_PROPS" ]; then
1102
+ LOG4J_CONFIG+=("-Dlog4j.configuration=file:$LOG4J_PROPS")
1103
+ fi
1104
+
1105
+ if [ "$SCRIPT_CMD" == "stop" ]; then
1106
+ # already stopped, script is done.
1107
+ exit 0
1108
+ fi
1109
+
1110
+ # NOTE: If the script gets to here, then it is starting up a Solr node.
1111
+
1112
+ if [ ! -e "$SOLR_HOME" ]; then
1113
+ echo -e "\nSolr home directory $SOLR_HOME not found!\n"
1114
+ exit 1
1115
+ fi
1116
+
1117
+ # backup the log files before starting
1118
+ if [ -f "$SOLR_LOGS_DIR/solr.log" ]; then
1119
+ if $verbose ; then
1120
+ echo "Backing up $SOLR_LOGS_DIR/solr.log"
1121
+ fi
1122
+ mv "$SOLR_LOGS_DIR/solr.log" "$SOLR_LOGS_DIR/solr_log_$(date +"%Y%m%d_%H%M")"
1123
+ fi
1124
+
1125
+ if [ -f "$SOLR_LOGS_DIR/solr_gc.log" ]; then
1126
+ if $verbose ; then
1127
+ echo "Backing up $SOLR_LOGS_DIR/solr_gc.log"
1128
+ fi
1129
+ mv "$SOLR_LOGS_DIR/solr_gc.log" "$SOLR_LOGS_DIR/solr_gc_log_$(date +"%Y%m%d_%H%M")"
1130
+ fi
1131
+
1132
+ java_ver_out=`echo "$("$JAVA" -version 2>&1)"`
1133
+ JAVA_VERSION=`echo $java_ver_out | grep "java version" | awk '{ print substr($3, 2, length($3)-2); }'`
1134
+ JAVA_VENDOR="Oracle"
1135
+ if [ "`echo $java_ver_out | grep -i "IBM J9"`" != "" ]; then
1136
+ JAVA_VENDOR="IBM J9"
1137
+ fi
1138
+
1139
+ # if verbose gc logging enabled, setup the location of the log file
1140
+ if [ "$GC_LOG_OPTS" != "" ]; then
1141
+ gc_log_flag="-Xloggc"
1142
+ if [ "$JAVA_VENDOR" == "IBM J9" ]; then
1143
+ gc_log_flag="-Xverbosegclog"
1144
+ fi
1145
+ GC_LOG_OPTS=($GC_LOG_OPTS "$gc_log_flag:$SOLR_LOGS_DIR/solr_gc.log")
1146
+ else
1147
+ GC_LOG_OPTS=()
1148
+ fi
1149
+
1150
+ # If ZK_HOST is defined, the assume SolrCloud mode
1151
+ if [[ -n "$ZK_HOST" ]]; then
1152
+ SOLR_MODE="solrcloud"
1153
+ fi
1154
+
1155
+ if [ "$SOLR_MODE" == 'solrcloud' ]; then
1156
+ if [ -z "$ZK_CLIENT_TIMEOUT" ]; then
1157
+ ZK_CLIENT_TIMEOUT="15000"
1158
+ fi
1159
+
1160
+ CLOUD_MODE_OPTS=("-DzkClientTimeout=$ZK_CLIENT_TIMEOUT")
1161
+
1162
+ if [ "$ZK_HOST" != "" ]; then
1163
+ CLOUD_MODE_OPTS+=("-DzkHost=$ZK_HOST")
1164
+ else
1165
+ if $verbose ; then
1166
+ echo "Configuring SolrCloud to launch an embedded ZooKeeper using -DzkRun"
1167
+ fi
1168
+
1169
+ CLOUD_MODE_OPTS+=('-DzkRun')
1170
+ fi
1171
+
1172
+ # and if collection1 needs to be bootstrapped
1173
+ if [ -e "$SOLR_HOME/collection1/core.properties" ]; then
1174
+ CLOUD_MODE_OPTS+=('-Dbootstrap_confdir=./solr/collection1/conf' '-Dcollection.configName=myconf' '-DnumShards=1')
1175
+ fi
1176
+
1177
+ else
1178
+ if [ ! -e "$SOLR_HOME/solr.xml" ]; then
1179
+ echo -e "\nSolr home directory $SOLR_HOME must contain a solr.xml file!\n"
1180
+ exit 1
1181
+ fi
1182
+ fi
1183
+
1184
+ # These are useful for attaching remote profilers like VisualVM/JConsole
1185
+ if [ "$ENABLE_REMOTE_JMX_OPTS" == "true" ]; then
1186
+
1187
+ if [ -z "$RMI_PORT" ]; then
1188
+ RMI_PORT="1$SOLR_PORT"
1189
+ fi
1190
+
1191
+ REMOTE_JMX_OPTS=('-Dcom.sun.management.jmxremote' \
1192
+ '-Dcom.sun.management.jmxremote.local.only=false' \
1193
+ '-Dcom.sun.management.jmxremote.ssl=false' \
1194
+ '-Dcom.sun.management.jmxremote.authenticate=false' \
1195
+ "-Dcom.sun.management.jmxremote.port=$RMI_PORT" \
1196
+ "-Dcom.sun.management.jmxremote.rmi.port=$RMI_PORT")
1197
+
1198
+ # if the host is set, then set that as the rmi server hostname
1199
+ if [ "$SOLR_HOST" != "" ]; then
1200
+ REMOTE_JMX_OPTS+=("-Djava.rmi.server.hostname=$SOLR_HOST")
1201
+ fi
1202
+ else
1203
+ REMOTE_JMX_OPTS=()
1204
+ fi
1205
+
1206
+ JAVA_MEM_OPTS=()
1207
+ if [ -z "$SOLR_HEAP" ] && [ -n "$SOLR_JAVA_MEM" ]; then
1208
+ JAVA_MEM_OPTS=($SOLR_JAVA_MEM)
1209
+ else
1210
+ SOLR_HEAP="${SOLR_HEAP:-512m}"
1211
+ JAVA_MEM_OPTS=("-Xms$SOLR_HEAP" "-Xmx$SOLR_HEAP")
1212
+ fi
1213
+
1214
+ if [ -z "$SOLR_TIMEZONE" ]; then
1215
+ SOLR_TIMEZONE='UTC'
1216
+ fi
1217
+
1218
+ # Launches Solr in foreground/background depending on parameters
1219
+ function launch_solr() {
1220
+
1221
+ run_in_foreground="$1"
1222
+ stop_port="$STOP_PORT"
1223
+
1224
+ SOLR_ADDL_ARGS="$2"
1225
+
1226
+ GC_TUNE=($GC_TUNE)
1227
+ # deal with Java version specific GC and other flags
1228
+ if [ "${JAVA_VERSION:0:3}" == "1.7" ]; then
1229
+ # Specific Java version hacking
1230
+ GC_TUNE+=('-XX:CMSFullGCsBeforeCompaction=1' '-XX:CMSTriggerPermRatio=80')
1231
+ if [ "$JAVA_VENDOR" != "IBM J9" ]; then
1232
+ JAVA_MINOR_VERSION=${JAVA_VERSION:(-2)}
1233
+ if [[ $JAVA_MINOR_VERSION -ge 40 && $JAVA_MINOR_VERSION -le 51 ]]; then
1234
+ GC_TUNE+=('-XX:-UseSuperWord')
1235
+ echo -e "\nWARNING: Java version $JAVA_VERSION has known bugs with Lucene and requires the -XX:-UseSuperWord flag. Please consider upgrading your JVM.\n"
1236
+ fi
1237
+ fi
1238
+ fi
1239
+
1240
+ # If SSL-related system props are set, add them to SOLR_OPTS
1241
+ if [ -n "$SOLR_SSL_OPTS" ]; then
1242
+ # If using SSL and solr.jetty.https.port not set explicitly, use the jetty.port
1243
+ SSL_PORT_PROP="-Dsolr.jetty.https.port=$SOLR_PORT"
1244
+ SOLR_OPTS+=($SOLR_SSL_OPTS "$SSL_PORT_PROP")
1245
+ fi
1246
+
1247
+ # If authentication system props are set, add them to SOLR_OPTS
1248
+ if [ -n "$AUTHC_OPTS" ]; then
1249
+ SOLR_OPTS+=($AUTHC_OPTS)
1250
+ fi
1251
+
1252
+ if $verbose ; then
1253
+ echo -e "\nStarting Solr using the following settings:"
1254
+ echo -e " JAVA = $JAVA"
1255
+ echo -e " SOLR_SERVER_DIR = $SOLR_SERVER_DIR"
1256
+ echo -e " SOLR_HOME = $SOLR_HOME"
1257
+ echo -e " SOLR_HOST = $SOLR_HOST"
1258
+ echo -e " SOLR_PORT = $SOLR_PORT"
1259
+ echo -e " STOP_PORT = $STOP_PORT"
1260
+ echo -e " JAVA_MEM_OPTS = ${JAVA_MEM_OPTS[@]}"
1261
+ echo -e " GC_TUNE = ${GC_TUNE[@]}"
1262
+ echo -e " GC_LOG_OPTS = ${GC_LOG_OPTS[@]}"
1263
+ echo -e " SOLR_TIMEZONE = $SOLR_TIMEZONE"
1264
+
1265
+ if [ "$SOLR_MODE" == "solrcloud" ]; then
1266
+ echo -e " CLOUD_MODE_OPTS = ${CLOUD_MODE_OPTS[@]}"
1267
+ fi
1268
+
1269
+ if [ "$SOLR_OPTS" != "" ]; then
1270
+ echo -e " SOLR_OPTS = ${SOLR_OPTS[@]}"
1271
+ fi
1272
+
1273
+ if [ "$SOLR_ADDL_ARGS" != "" ]; then
1274
+ echo -e " SOLR_ADDL_ARGS = $SOLR_ADDL_ARGS"
1275
+ fi
1276
+
1277
+ if [ "$ENABLE_REMOTE_JMX_OPTS" == "true" ]; then
1278
+ echo -e " RMI_PORT = $RMI_PORT"
1279
+ echo -e " REMOTE_JMX_OPTS = ${REMOTE_JMX_OPTS[@]}"
1280
+ fi
1281
+ echo -e "\n"
1282
+ fi
1283
+
1284
+ # need to launch solr from the server dir
1285
+ cd "$SOLR_SERVER_DIR"
1286
+
1287
+ if [ ! -e "$SOLR_SERVER_DIR/start.jar" ]; then
1288
+ echo -e "\nERROR: start.jar file not found in $SOLR_SERVER_DIR!\nPlease check your -d parameter to set the correct Solr server directory.\n"
1289
+ exit 1
1290
+ fi
1291
+
1292
+ SOLR_START_OPTS=('-server' '-Xss256k' "${JAVA_MEM_OPTS[@]}" "${GC_TUNE[@]}" "${GC_LOG_OPTS[@]}" \
1293
+ "${REMOTE_JMX_OPTS[@]}" "${CLOUD_MODE_OPTS[@]}" \
1294
+ "-Djetty.port=$SOLR_PORT" "-DSTOP.PORT=$stop_port" "-DSTOP.KEY=$STOP_KEY" \
1295
+ "${SOLR_HOST_ARG[@]}" "-Duser.timezone=$SOLR_TIMEZONE" \
1296
+ "-Djetty.home=$SOLR_SERVER_DIR" "-Dsolr.solr.home=$SOLR_HOME" "-Dsolr.install.dir=$SOLR_TIP" \
1297
+ "${LOG4J_CONFIG[@]}" "${SOLR_OPTS[@]}")
1298
+
1299
+ if [ "$SOLR_MODE" == "solrcloud" ]; then
1300
+ IN_CLOUD_MODE=" in SolrCloud mode"
1301
+ fi
1302
+
1303
+ mkdir -p "$SOLR_LOGS_DIR"
1304
+
1305
+ if [ "$run_in_foreground" == "true" ]; then
1306
+ echo -e "\nStarting Solr$IN_CLOUD_MODE on port $SOLR_PORT from $SOLR_SERVER_DIR\n"
1307
+ "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS -jar start.jar "${SOLR_JETTY_CONFIG[@]}"
1308
+ else
1309
+ # run Solr in the background
1310
+ nohup "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS -jar start.jar \
1311
+ "-XX:OnOutOfMemoryError=$SOLR_TIP/bin/oom_solr.sh $SOLR_PORT $SOLR_LOGS_DIR" "${SOLR_JETTY_CONFIG[@]}" \
1312
+ 1>"$SOLR_LOGS_DIR/solr-$SOLR_PORT-console.log" 2>&1 & echo $! > "$SOLR_PID_DIR/solr-$SOLR_PORT.pid"
1313
+
1314
+ # no lsof on cygwin though
1315
+ if hash lsof 2>/dev/null ; then # hash returns true if lsof is on the path
1316
+ echo -n "Waiting up to 30 seconds to see Solr running on port $SOLR_PORT"
1317
+ # Launch in a subshell to show the spinner
1318
+ (loops=0
1319
+ while true
1320
+ do
1321
+ running=`lsof -PniTCP:$SOLR_PORT -sTCP:LISTEN`
1322
+ if [ -z "$running" ]; then
1323
+ if [ $loops -lt 6 ]; then
1324
+ sleep 5
1325
+ loops=$[$loops+1]
1326
+ else
1327
+ echo -e "Still not seeing Solr listening on $SOLR_PORT after 30 seconds!"
1328
+ tail -30 "$SOLR_LOGS_DIR/solr.log"
1329
+ exit # subshell!
1330
+ fi
1331
+ else
1332
+ SOLR_PID=`ps auxww | grep start\.jar | grep -w $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
1333
+ echo -e "\nStarted Solr server on port $SOLR_PORT (pid=$SOLR_PID). Happy searching!\n"
1334
+ exit # subshell!
1335
+ fi
1336
+ done) &
1337
+ spinner $!
1338
+ else
1339
+ echo -e "NOTE: Please install lsof as this script needs it to determine if Solr is listening on port $SOLR_PORT."
1340
+ sleep 10
1341
+ SOLR_PID=`ps auxww | grep start\.jar | grep -w $SOLR_PORT | grep -v grep | awk '{print $2}' | sort -r`
1342
+ echo -e "\nStarted Solr server on port $SOLR_PORT (pid=$SOLR_PID). Happy searching!\n"
1343
+ return;
1344
+ fi
1345
+ fi
1346
+ }
1347
+
1348
+ launch_solr "$FG" "$ADDITIONAL_CMD_OPTS"
1349
+
1350
+ exit $?