【问题标题】:h2o script fails to run via cronh2o 脚本无法通过 cron 运行
【发布时间】:2021-06-23 07:41:07
【问题描述】:

在 linux 中通过 cron 使用 h2o 库运行 R 脚本时遇到困难。

脚本在交互模式下运行得非常好,但在cron 中调度时,脚本会失败。

导致错误的部分代码:

automl_h2o_models <- h2o.automl(
    x = predictors, 
    y = target,
    training_frame = train_conv_h2o,
    leaderboard_frame = valid_conv_h2o,
    max_runtime_secs = 3600,
    seed = 1234
)

max_runtime_secs 设置为1800 时没有问题,但超出此值的任何内容都会导致以下错误。

Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page,  : 
  Unexpected CURL error: getaddrinfo() thread failed to start

我在 Ubuntu 20.04,R 版本 3.6.3,h2o 版本 3.32.1.3

【问题讨论】:

    标签: r cron h2o automl


    【解决方案1】:

    该问题与 linux 中的描述符设置数量有关。 cron 环境与在交互模式下运行脚本时的系统环境不同。

    作为解决方案,我在cron 中使用了额外参数:

    0 18 21 6 * ulimit -nS 1048576 && Rscript <script_name>
    

    然后错误消失,脚本正确运行。

    【讨论】:

      猜你喜欢
      • 2019-07-23
      • 2011-08-10
      • 2020-08-16
      • 2017-08-11
      • 2016-10-01
      • 2014-06-20
      • 2011-03-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多