如何在 OS X 上设置 ES_HEAP_SIZE 环境变量

How to set the ES_HEAP_SIZE environment variable on OS X

使用来自 Homebrew 的 OS X 10.10.4、Elasticsearch 1.6.0,因此服务器在登录时作为启动代理运行: /usr/local/bin/elasticsearch --config=/usr/local/etc/elasticsearch/elasticsearch.yml

问:如何设置环境变量ES_HEAP_SIZE使用2GB内存?我应该写什么,在哪个文件中?

找到答案:

打开 LaunchAgent(或守护进程)plist。就我而言:

~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist

添加:

<key>EnvironmentVariables</key>
    <dict>
      <key>ES_HEAP_SIZE</key>
      <string>2g</string>
    </dict>