sunspot_solr 2.2.0 → 2.2.1

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