OpenRefine changing the port and host when executable is run directly

荒凉一梦 提交于 2020-01-15 05:37:07

问题


The refine.ini allow setting the port and host without the need to re-building, but it says the following:

# NOTE: This file is not read if you run the Refine executable directly
# It is only read of you use the refine shell script or refine.bat

from my limited observation i noticed that when the executable is run directly the value for port and host are always the ones set as default in Refine.java. is there a way to change the port and host when running the executable directly without the need to re-build ?


回答1:


The way OpenRefine is started varies across platforms and so the mechanisms for changing the host, port, and other options, also vary.

Linux

On Linux you can set the host and port (and other options) with options when you run refine. -p controls the port and -i the host. For example:

./refine -p 3334 -i localhost

Will run OpenRefine on http://localhost:3334

Use ./refine -h to list all options that are supported

OS X

On OS X the options are set in the Info.plist file (in path_to_openrefine/OpenRefine.app/Contents)

You'll need to find the 'array' element that follows the line:

<key>JVMOptions</key>

Typically this looks something like:

<key>JVMOptions</key>
<array>
<string>-Xms256M</string>
<string>-Xmx1024M</string>
<string>-Drefine.version=2.6-beta.1</string>
<string>-Drefine.webapp=$APP_ROOT/Contents/Resource/webapp</string>
</array>

Add in values for -Drefine.host and -Drefine.port - so you have something like:

<key>JVMOptions</key>
<array>
<string>-Xms256M</string>
<string>-Xmx1024M</string>
<string>-Drefine.version=2.6-beta.1</string>
<string>-Drefine.webapp=$APP_ROOT/Contents/Resource/webapp</string>
<string>-Drefine.host=localhost</string>
<string>-Drefine.port=3334</string>
</array>

There is another way of editing the Info.plist file if you'd prefer to do this via a GUI. See https://github.com/OpenRefine/OpenRefine/wiki/FAQ:-Allocate-More-Memory section on Macs which works through a similar method for extending the memory allocation.

Windows

On Windows you can set options on the command line if you run via refine.bat, and as you note also via refine.ini

If you are running refine.exe on Windows I'm not aware you can use command line options, but you can set run time options in openrefine.l4j.ini (or refine.l4j.ini for older versions of refine).

Add to this file lines:

-Drefine.port=3334
-Drefine.host=localhost

and save, and when you run openrefine.exe (or google-refine.exe for older versions of refine) it will use these values for the port/host



来源:https://stackoverflow.com/questions/36601256/openrefine-changing-the-port-and-host-when-executable-is-run-directly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!