SOLR 6.2忽略堆设置(SOLR_JAVA_MEM参数)

时间:2016-09-28 15:25:29

标签: java ubuntu solr amazon-ec2 sunspot

我已按照herehere的说明增加了我的SOLR内存分配。我这样做是因为SOLR服务器在一些高频率和高容量索引活动期间定期关闭。

我对使用SOLR和Ubuntu有点新,所以请耐心等待,但我找到了几个存在SOLR_JAV_MEM参数的位置:

/opt/solr-6.2.0/bin/solr.in.sh
/opt/solr-6.2.0/bin/solr.in.cmd
/opt/solr-6.2.0/bin/solr.cmd
The same set of files in this directory: /home/deploy/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0/gems/sunspot_solr-2.2.5/solr/bin
And this directory: 
/home/deploy/solr-6.2.0/bin 
And finally, in this file: /etc/default/solr.in.sh

在任何地方我看到一个带有数字的SOLR_JAV_MEM或SOLR_HEAP参数,我用更大的值替换它,例如在/opt/solr-6.2.0/bin/solr.in.sh中:

# Increase Java Heap as needed to support your indexing / query needs
SOLR_HEAP="1500m"

# Expert: If you want finer control over memory options, specify them directly
# Comment out SOLR_HEAP if you are using this though, that takes precedence
#SOLR_JAVA_MEM="-Xms1512m -Xmx1512m"

如果我正确测量它,我仍然只能看到大约500MB的内存分配给SOLR,如下面的命令所示:

root@ip-xxx:~# service solr status

Found 1 Solr nodes:

Solr process 15259 running on port 8989
{
  "solr_home":"/var/solr/data",
  "version":"6.2.0 764d0f19151dbff6f5fcd9fc4b2682cf934590c5 - mike - 2016-08-20 05:41:37",
  "startTime":"2016-09-28T15:01:18.001Z",
  "uptime":"0 days, 0 hours, 12 minutes, 28 seconds",
  "memory":"100 MB (%20.4) of 490.7 MB"}

我做错了吗?或者我只是错误地测量内存?如果我能提供add'l信息,请告诉我。谢谢!

1 个答案:

答案 0 :(得分:4)

我会回答我自己的问题。事实证明,我必须编辑/etc/default/solr.in.sh文件。我将SOLR_HEAP =“512M”更改为SOLR_HEAP =“1500m”并运行sudo service solr status并看到内存显示为1.5G!