50. 使用许可证

iFun Engine的许可证分为评估版许可证和商用许可证。 商用许可证的价格政策等请参考 iFun Engine主页

50.1. 评估版许可证

安装iFun引擎后,可通过默认许可证试用1周。 若需要额外评估期时,可在iFun引擎主页的 申请试用页面 申请为期6个月的试用许可证,请务必对此进行确认。

50.2. 应用许可证文件

如您已经购买商用许可证,或已申请6个月的试用许可证,将通过邮件获得名为 account.ilf 的许可证文件。

50.2.1. 直接在Linux服务器进行作业时

若当前直接在Linux服务器进行作业,请创建名为 /etc/ifunfactory/ 的目录,将许可证文件复制到该目录下即可。

$ sudo mkdir /etc/ifunfactory
$ sudo cp /path/to/account.ilf /etc/ifunfactory/
$ sudo chmod a+rX /etc/ifunfactory /etc/ifunfactory/account.ilf

50.2.2. 对Linux服务器进行远程作业时

如您使用Windows PC,且想要在远程的Linux服务器上运行iFun引擎, 可将相应文件通过 WinSCPFileZillaPSCP/PSFTP 等支持SCP或SFTP的文件复制程序,将许可证文件复制到Linux服务器中,再像上面那样将相应文件复制到 /etc/ifunfactory/ 中。下面是使用WinSCP复制文件的示例。

50.2.2.1. 利用WinSCP复制license文件

  1. 下载并安装 WinSCP

  2. 通过WinSCP连接到linux服务器上。

File Protocol请选择SCP或SFTP,指定 Host NameUser name 后点击 Login ,即可连接到服务器。

_images/winscp1.png
  1. WinSCP右侧面板显示服务器端目录,在这里选择主目录。(若账户名为ubuntu,则默认值为 /home/ubuntu

WinSCP左侧面板显示当前使用的Windows PC目录,选择 account.ilf

后点击 Upload

_images/winscp2.png
  1. 下载并运行 Putty 。直接输入上面使用的 Host Name ,按回车键。

_images/putty.png
  1. 访问服务器后,会询问用户名和密码,输入前面使用的用户名和密码登录。然后执行以下命令。($ 表示shell prompt,不输入。)

$ sudo mkdir -p /etc/ifunfactory
$ sudo mv account.ilf /etc/ifunfactory/
$ sudo chmod a+rX /etc/ifunfactory /etc/ifunfactory/account.ilf

50.3. 许可证相关问题的解决

50.3.1. 服务器经过一定时间后自动关闭时

...
E0202 00:08:49.916679  5918 main.cc:97] You are using non-production license.
iFun Engine stops after running for 30 minutes.
To run fully functional iFun Engine, contact sales@ifunfactory.com

对于试用版本,在30分钟后服务器会自动关闭。 如您拥有正式许可证,请使用收到的 account.ilf 文件。

Tip

试用版可按照 /etc/ifunfactory/account.ilf 和以下内容所示开始使用。

# This is an evaluation license file for iFun Engine.
#
# If you have a contract with iFunFactory Inc., please use your copy of
# account.ilf instead of this.
#
# This license expires by Wed Feb 11 13:43:59 KST 2015.

1cc6917c261580cafc91267875b0fec62e8a5d0954d5b12dc7c9372378 ...

50.3.2. 显示”Failed to find a valid account.ilf”消息并死机时

当服务器出现如下死机情况时,是由于 /etc/ifunfactory/ 目录下没有许可证文件,或运行iFun引擎的Linux用户没有读取该文件的权限。

 $ ./proj_name-local
 I0204 13:21:42.998123  5741 main.cc:143] Crashreporter initialized; .dmp will be written to /home/ubuntu/work/proj_name/build/logs/../dumps
 E0204 13:21:43.182199  5741 capability.cc:433] Error response; ec=0; status=400
 E0204 13:21:43.182586  5741 capability.cc:438] Error: Incomplete request
 E0204 13:21:43.182627  5741 capability.cc:69] Failed to find valid account.ilf, which usually resides on /etc/ifunfactory/account.ilf.
 ./proj_name-local: line 51:  5741 Killed    $FUNAPI_BIN_DIR/funapi_runner ...

此时,请重新上传 account.ilf 文件,并确认运行iFun引擎的用户是否拥有读取该文件的权限。

50.3.3. 显示”account.ilf: not in valid datetime-range”消息死机时

 ubuntu@vm:~/example-build/debug $ ./example-local
 I0218 23:06:12.701092 22481 main.cc:145] Crashreporter initialized; .dmp will be written to /home/ubuntu/example-build/debug/logs/../dumps
 E0218 23:06:13.480649 22481 capability.cc:258] account.ilf: not in valid datetime-range
 E0218 23:06:13.481799 22481 capability.cc:70] Failed to acquire license
 ./example-local: line 51: 22481 Killed                  $FUNAPI_BIN_DIR/funapi_runner --main_program_name=$component_name --framework_manifest_path="$manifests" --main_enabled_components=$ComponentName --resource_root="/home/ubuntu/example-build/debug/resources" --max_log_size=10 --stop_logging_if_full_disk --log_root_dir="$FUNAPI_LOG_ROOT_DIR" --crashdump_root_dir="$FUNAPI_DUMP_ROOT_DIR" --alsologtostderr "$@"

个别 account.ilf 文件拥有有效使用期。当超出有效期时,会输出内容为 account.ilf: not in valid datetime-range 的日志。 对于使用试用许可证的情况,请发送邮件至 iFun Engine support ,告诉我们必要的使用期间。 对于正式许可证,iFunFactory会在到期前为您发送新的许可证文件。

50.3.4. 显示”Error: Your system time is not correct”消息死机时

 ubuntu@vm:~/example-build/debug $ ./example-local
 I0218 23:07:23.996897 22494 main.cc:145] Crashreporter initialized; .dmp will be written to /home/ubuntu/example-build/debug/logs/../dumps
 E0218 23:07:25.630452 22494 capability.cc:434] Error response; ec=0; status=400
 E0218 23:07:25.631985 22494 capability.cc:439] Error: Your system time is not correct
 E0218 23:07:25.632563 22494 capability.cc:70] Failed to get response from license server
 ./example-local: line 51: 22494 Killed                  $FUNAPI_BIN_DIR/funapi_runner --main_program_name=$component_name --framework_manifest_path="$manifests" --main_enabled_components=$ComponentName --resource_root="/home/ubuntu/example-build/debug/resources" --max_log_size=10 --stop_logging_if_full_disk --log_root_dir="$FUNAPI_LOG_ROOT_DIR" --crashdump_root_dir="$FUNAPI_DUMP_ROOT_DIR" --alsologtostderr "$@"

如以上日志所示,当显示 Error: Your system time is not correct 消息时, 就说明服务器时间不准确。 此时,无法和许可证服务器进行正常通信。

$ sudo ntpdate -u ntp.ubuntu.com

请通过上述命令或其他命令重新调整服务器时间。