OpenRefine在直接运行可执行文件时更改端口和主机 [英] OpenRefine changing the port and host when executable is run directly

查看:244
本文介绍了OpenRefine在直接运行可执行文件时更改端口和主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

finefine.ini允许设置端口和主机,而无需重新构建,但是它显示以下内容:

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

从我的有限观察中,

我注意到直接运行可执行文件时,port和host的值始终是Refine.java中设置为默认值的值. 直接运行可执行文件时,无需重新构建,是否可以更改端口和主机?

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 ?

推荐答案

OpenRefine的启动方式因平台而异,因此更改主机,端口和其他选项的机制也不同.

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

Linux

在Linux上,您可以在运行优化时使用选项设置主机和端口(以及其他选项). -p控制端口,-i控制主机.例如:

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

将在 http://localhost:3334

使用./refine -h列出所有受支持的选项

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

OS X

在OS X上,这些选项是在Info.plist文件(在path_to_openrefine/OpenRefine.app/Contents中)中设置的

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

您需要找到此行之后的'array'元素:

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

<key>JVMOptions</key>

通常看起来像这样:

<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>

为-Drefine.host和-Drefine.port添加值-这样您就可以得到类似的内容:

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>

如果您希望通过以下方式进行编辑,则还有另一种编辑Info.plist文件的方法: GUI.参见 https://github.com/OpenRefine/OpenRefine/wiki/FAQ Mac上的:-All-cate-More-Memory 部分,通过类似的方法来扩展内存分配.

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

在Windows上,如果您通过finefine.bat运行,也可以通过refine.ini运行,则可以在命令行上设置选项

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

如果您在Windows上运行fine.exe,我不知道您可以使用命令行选项,但是可以在openrefine.l4j.ini中设置运行时选项(或对于较旧版本的finet设置fine.l4j.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).

添加到此文件行:

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

保存,然后在运行openrefine.exe(或旧版本的精简版运行google-refine.exe)时,它将使用这些值作为端口/主机

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

这篇关于OpenRefine在直接运行可执行文件时更改端口和主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆