【问题标题】:Unable to create core [new_core] Caused by: null in apache solr 8.2.0 on centos 7无法创建核心 [new_core] 原因:centos 7 上 apache solr 8.2.0 中的 null
【发布时间】:2019-10-05 23:51:16
【问题描述】:

我在 CentOS 7 上安装了 apache solr 以点击此链接 https://computingforgeeks.com/install-apache-solr-on-centos-fedora/

安装完成后,solr状态为

运行此命令后

sudo systemctl enable solr

显示下面的消息

solr.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig solr on

我运行了创建 testcollection 的命令。

sudo su - solr -c "/opt/solr/bin/solr create -c testcollection -n data_driven_schema_configs"

运行命令后,出现如下错误

ERROR: Error CREATEing SolrCore 'testcollection': Unable to create core [tpcollection3] Caused by: null

我能得到任何关于成功创建集合或核心的建议吗? 问题是

1. Why cannot enable solr on centos 7?
2. Why cannot create collection or core?

【问题讨论】:

    标签: solr centos7


    【解决方案1】:
    1. /sbin/chkconfig solr on 是回退到systemctl enable solr 的命令,它完成的任务与在启动时启用 Solr 相同。也就是说,有一个 service installation script 应该有助于将 Solr 安装为服务:/opt/solr/bin/install_solr_service.sh

    2. 确保您已在 Solr 目录上设置了正确的权限并重新启动 Solr,我认为您不需要 sudo su 部分:

      chown -R solr:solr /var/solr/
      ./solr restart
      ./solr create -c testcollection
      

    【讨论】:

    • 我在ubuntu 19.04成功安装了solr并从mysql导入数据。在 CentOS 7 中它不起作用。我按照你的回答跟进了。但它不起作用。
    • 您是否以 root 身份尝试过?重启时可能还需要设置服务器路径:/opt/solr/bin/solr restart -s /opt/solr/server/solr/.
    【解决方案2】:

    实际上我解决了另一种方式。

    您可以提取所需的目录。我做了一个目录 /solr

    mkdir /solr
    

    从最新的release of Apache Solr 下载最新版本的solr

    解压

    tar -xvf solr-8.2.0.tgz 
    

    添加用户

    useradd solr
    

    给予许可

    chown -R solr:solr solr-8.2.0
    

    转到您创建的用户

    su - solr
    

    转到提取的 solr bin 文件

     cd solr-8.2.0/bin
    

    启动 Solr,检查 solr 状态并创建 solr core 或集合

    ./solr start  
    ./solr status
    ./solr create -c testcollection -n data_driven_schema_configs 
    

    您将看到您创建的集合或核心成功消息。

    Created new core 'testcollection'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-01-12
      • 2013-12-13
      • 1970-01-01
      • 2017-12-26
      • 2017-03-11
      • 1970-01-01
      • 2016-11-12
      • 2014-01-26
      相关资源
      最近更新 更多