由于已经安装了homebrew,直接使用下面语句即可安装
brew install solr
接下来是使用,如果直接创建索引的部署,输入命令和可能有报错信息 如下
solr create_collection -c wenda
//报错信息
ERROR: Solr at http://localhost:8983/solr is running in standalone server mode, please use the create_core command instead;
create_collection can only be used when running in SolrCloud mode.
读报错信息可知,solr默认运行的模式并不是solrcloud模式,改变solr运行模式创建即可:
solr start -e cloud
接下来出现选项按照提示的填写即可。
如果要安装指定版本的solr,可以使用命令brew edit solr来修改下载源和验证信息:
url "http://archive.apache.org/dist/lucene/solr/6.2.0/solr-6.2.0.tgz"
sha256 "ba7c93e1c8d28717d6d84788ebdc2e8e9211a32f48b5a30b2a904762a0b7cd39"
然后brew install solr即可
使用localhost:8983/solr启动可能报错,将localhost改成127.0.0.1即可