DataDir and DirectoryFactory in SolrConfig

2019-03-27 01:20|来源: 网路

Specifying a Location for Index Data with the dataDir Parameter

By default, Solr stores its index data in a directory called /data under the Solr home. If you would like to specify a different directory for storing index data, use the <dataDir> parameter in the solrconfig.xml file. You can specify another directory either with a full pathname or a pathname relative to the current working directory of the servlet container. For example:

<dataDir>/var/data/solr/</dataDir>

If you are using replication to replicate the Solr index (as described in Legacy Scaling and Distribution), then the <dataDir> directory should correspond to the index directory used in the replication configuration.

Specifying the DirectoryFactory For Your Index

The default solr.StandardDirectoryFactory is filesystem based, and tries to pick the best implementation for the current JVM and platform. You can force a particular implementation by specifyingsolr.MMapDirectoryFactory, solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.

<directoryFactory name="DirectoryFactory"
                  class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>

The solr.RAMDirectoryFactory is memory based, not persistent, and does not work with replication. Use this DirectoryFactory to store your index in RAM.

<directoryFactory class="org.apache.solr.core.RAMDirectoryFactory"/>

转自:http://my.oschina.net/u/138995/blog/194780

相关问答

更多
  • 权限问题。,copy份给你! 1.首先要运行一下 比如说我的mysql安装在/opt/mysql下面 #cd /opt/mysql #scripts/mysql_install_db --user=mysql (确认你有mysql用户) 如果不行,检查你的/opt/mysql(这是我的)下面有没有data目录,正确的做法是先启动一次如果OK,再移data目录到别的地方。 两个方法解决 1.如果你没有修改过my.cnf文件,请修改,然后把添加datadir [mysqld] port = 3306 socke ...
  • 我最终需要编辑我的php.ini与mysql套接字的新位置。 我正在使用php-fpm,并且一旦php.ini更新就必须重新启动。 I ended up needing to edit my php.ini with the new location of the mysql socket. I'm using php-fpm, and had to restart that once the php.ini was updated.
  • 似乎solrconfig.xml中的语句顺序可以有所不同。 在这种情况下,任何声明必须在其中一个(或可能是全部)声明之后: 。 最初,我的行紧接在打开标记之后。 这恰好是他们在我工作的例子中的位置。 所以也许Java只是不合适而且我的solrconfig.xml没有问题。 我希望这有助于 ...
  • 每次执行软件提交或硬提交时,您的缓存或多或少都会失效,因为任何类型的提交通常都会创建一个“newsearcher”。 你可能有一个softcommit或hardcommit设置为1分钟。 检查此链接并查看软提交和硬提交部分。 It turned out that this was not related to SolR at all but to internal routing. For those interested it turned out that ipv6 DNS was checked an ...
  • 您可以通过Solr模式API和Solr config API读取当前正在运行的模式和配置。 注意:此API的结果不是原始schema.xml或solrconfig.xml文件,但您可以从中重建原始文件。 同样,请注意Solr配置API仅在最新版本的Solr中可用。 在较旧的版本中(我测试版本4.8.1)没有solr配置的API,因此无法完全重建solrconfig.xml文件。 You can read the current running schema and config through the So ...
  • 虽然我没有使用datadir属性但是我已经通过将默认位置安装到外部HD来将数据存储位置更改为如下: 备份当前数据目录 删除数据目录中的所有内容 将其安装到外部HD( mount /var/lib/mysql/data /dev/XXX ) 我在Ubuntu Server上完成了它。 在更改InnoDB特定目录时,我注意到必须小心权限(在ubuntu的情况下为apparmord)。 当mysql无法执行某些文件系统操作时,我发现它的错误消息非常具有误导性。 有时研究它的error.log(在我的例子中是/va ...
  • 你是对的,这是目录 请看这里http://wiki.apache.org/solr/SolrInstall#Setup 您在某些时候需要编辑的2个文件是: 的solr / CONF / solrconfig.xml中 的solr / CONF / schema.xml中 您正在安装哪个操作系统? 如果它是窗户,那么我可以帮助你...因为我已经做了很多次;) CraftyFella You are correct that's the directory see here see here http://wi ...
  • dataDir是Solr将存储索引数据的目录(默认情况下,它位于Solr主目录中的./data下)。 您可以使用它来设置不同的路径。 它不是备份。 更多信息在这里 。 这不可能产生性能影响。 除非您将其指向文件系统中位于更快磁盘上的另一个挂载点。 我认为最好的做法是将dataDir放在Solr主目录之外,这样您就可以升级Solr,而无需担心数据的存储位置。 如果您的服务器上有多个磁盘,这很有用。 dataDir is the directory where Solr will store your inde ...
  • 它是存储数据库文件的目录。 它可以在安装服务器时运行,也可以在运行之前更改,对于大型服务器(例如运行在多台服务器上的群集MySQL服务器)有特殊意义。 It is the directory where your database files are stored. It can be changed when installing the server or before running it and is of special meaning for larger servers, e.g. clust ...
  • 如果您运行脚本: python compute_distances.py -h 您将在您提供的代码示例中看到argparse模块设置的详细使用说明。 这基本上打印了每次调用parser.add_argument(...)的帮助字符串,例如: parser.add_argument( "--datadir", required=True, help="Path to input directory containing the vectorized data" ) 因此,您的脚本 ...