最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Mac本地创建solr的collection出错:Failed to determine the port of a local Solr instance, cannot create

Mac crifan 2975浏览 0评论

折腾:

【记录】Mac本地运行Python脚本把MongoDB数据导入SOLR

期间,参考同事的解释,去创建solr的collection,结果出错:

<code>➜  x git:(master) ✗ solr create -c storybook_collection
Failed to determine the port of a local Solr instance, cannot create storybook_collection!
</code>

去切换到路径下,也会出错:

<code>➜  x git:(master) ✗ cd /usr/local/Cellar/solr/7.2.1/
➜  7.2.1 git:(master) ✗ bin/solr create -c storybook_collection
Failed to determine the port of a local Solr instance, cannot create storybook_collection!
</code>

solr Failed to determine the port of a local Solr instance, cannot create 

apache solr getting started

好像再次运行就可以了?

此处不行

Failed to determine the port of a local Solr instance, cannot create collection1! – chaishen10000的专栏 – CSDN博客

需要加上对应的port

但是此处是多少?

shell – running solr instance inside docker – Stack Overflow

shell – Solr with Django-Haystack: ‘Cannot create tester’ – Stack Overflow

说是要允许起来才能创建?

那先去运行起来试试

<code>➜  7.2.1 git:(master) ✗ cd ~
➜  ~ solr start
Waiting up to 180 seconds to see Solr running on port 8983 [/]
Started Solr server on port 8983 (pid=40391). Happy searching!

➜  ~ solr status

Found 1 Solr nodes:

Solr process 40391 running on port 8983
{
  "solr_home":"/usr/local/Cellar/solr/7.2.1/server/solr",
  "version":"7.2.1 b2b6438b37073bee1fca40374e85bf91aa457c0b - ubuntu - 2018-01-10 00:54:21",
  "startTime":"2018-10-25T06:59:36.818Z",
  "uptime":"0 days, 0 hours, 0 minutes, 13 seconds",
  "memory":"56.8 MB (%11.6) of 490.7 MB"}
</code>

然后再去创建

<code>➜  ~ solr create -c storybook_collection
WARNING: Using _default configset. Data driven schema functionality is enabled by default, which is
         NOT RECOMMENDED for production use.

         To turn it off:
            curl http://localhost:8983/solr/storybook_collection/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}'

Created new core 'storybook_collection'
➜  ~ solr status

Found 1 Solr nodes:

Solr process 40391 running on port 8983
{
  "solr_home":"/usr/local/Cellar/solr/7.2.1/server/solr",
  "version":"7.2.1 b2b6438b37073bee1fca40374e85bf91aa457c0b - ubuntu - 2018-01-10 00:54:21",
  "startTime":"2018-10-25T06:59:36.818Z",
  "uptime":"0 days, 0 hours, 0 minutes, 43 seconds",
  "memory":"82.4 MB (%16.8) of 490.7 MB"}
</code>

【总结】

此处需要先去启动solr:

<code>solr start
</code>

然后才能正常创建solr的collection:

<code>solr create -c storybook_collection
</code>

否则会报错:

Failed to determine the port of a local Solr instance, cannot create

转载请注明:在路上 » 【已解决】Mac本地创建solr的collection出错:Failed to determine the port of a local Solr instance, cannot create

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.174 seconds, using 22.09MB memory