我正在尝试使用h2o REST API导入我在本地服务器上的CSV文件。
命令:
curl -v -X GET ' http://127.0.0.1:54321/3/ImportFiles?path=http://127.0.0.1:8083/datasets/tables/csv/RDsTWgcvAjHeWJFnbhCKTCE5rn6aLCjJ.csv'
导致以下日志:
尝试127.0.0.1 ...连接到127.0.0.1(127.0.0.1)端口54321(#0) 得到 / 3 / ImportFiles?path = http://127.0.0.1:8083/datasets/tables/csv/RDsTWgcvAjHeWJFnbhCKTCE5rn6aLCjJ.csv HTTP / 1.1主机:127.0.0.1:54321 User-Agent:curl / 7.47.0接受: /
HTTP / 1.1 200 OK X-h2o-build-project-version:3.16.0.2 X-h2o-rest-api-version-max:3 X-h2o-cluster-id:1512722051559 X-h2o-cluster-good:true X-h2o-context-path:/ Content-Type: application / json Content-Length:349 Server:Jetty(8.y.z-SNAPSHOT)
连接#0到主机127.0.0.1保持不变 {" __元" {" schema_version":3," SCHEMA_NAME":" ImportFilesV3"" schema_type":& #34; ImportFiles"}" _exclude_fields":"""路径":" http://127.0.0.1:8083/datasets/tables/csv/RDsTWgcvAjHeWJFnbhCKTCE5rn6aLCjJ.csv&#34 ;, "模式":空,"文件":[]," destination_frames":[],"失败":[" { {3}}&#34],"德尔斯":[]}
H2O登录TRACE级别仅显示:
12-08 15:41:59.951 10.8.128.101:54321 36013#4756-331 INFO:GET / 3 / ImportFiles,parms: {路径= http://127.0.0.1:8083/datasets/tables/csv/RDsTWgcvAjHeWJFnbhCKTCE5rn6aLCjJ.csv}
导入失败时有没有办法调试? h2o根本不问本地服务器。
来自其他服务器的命令运行良好:
curl -v -X GET" http://127.0.0.1:8083/datasets/tables/csv/RDsTWgcvAjHeWJFnbhCKTCE5rn6aLCjJ.csv" curl -v -X GET" http://127.0.0.1:54321/3/ImportFiles?path=http://s3.amazonaws.com/h2o-public-test-data/smalldata/flow_examples/arrhythmia.csv.gz"
答案 0 :(得分:1)
通常,尝试直接与H2O REST API进行交互并不容易。绝大多数人使用预制的API客户端,如Python或R.
但是如果你真的想这样做,我会通过与那些正在工作的东西进行比较来调试它。就像H2O的R客户端一样。
编写一个执行此操作的R程序:
h2o.init()
h2o.startLogging()
h2o.importFile("/path/to/data.csv")
startLogging()调用将生成包含所有REST API请求和响应的详细日志文件。看看那个并尝试模仿它。
您也可以参考自动生成的REST API文档(http://docs.h2o.ai/h2o/latest-stable/h2o-docs/rest-api-reference.html),但我要提醒您,如果您尝试根据文档编写一个有效的客户端,那将很难。
查看来自已经工作的客户的已记录的对话是迄今为止最好的选择。
答案 1 :(得分:0)
库(H 2 O)
h2o.init() h2o.startLogging() h2o.importFile(" http://localhost:8082/datasets/tables/csv/vPrzC5TOQr6JTvnAYrU5AKyz8SP4ao8p.csv&#34)
时间:2017-12-11 11:55:09.237
获取http://localhost:54321/3/Cloud?skip_ticks=true postBody:
curlError:FALSE curlErrorMessage:httpStatusCode:200 httpStatusMessage:OK millis:7
{" __元" {" schema_version":3," SCHEMA_NAME":" CloudV3"" schema_type&#34 ;:"冰"}" _exclude_fields":""" skip_ticks":真,"版本&#34 ;: " 3.16.0.2"" branch_name":" REL-轮车"" BUILD_NUMBER":" 2&#34 ;, " build_age":" 10天"," build_too_old":false," node_idx":0," cloud_name": " H2O_started_from_R_vasiliy_gey658"" cloud_size":1," cloud_uptime_millis":306486," cloud_healthy":真," bad_nodes" :0,"共识":真,"锁定":真," is_client":假,"节":[{&#34 ; __元" {" schema_version":3," SCHEMA_NAME":" NodeV3"" schema_type":"冰& #34;}" H 2 O":"本地主机/ 127.0.0.1:54321"" ip_port":" 127.0.0.1:54321" "健康":真," last_ping":1512982506643," PID":97891" num_cpus&#34:4," cpus_allowed& #34:4 "来确定nthreads&#34:4," sys_load":2.0917969," my_cpu_pct": - 1," sys_cpu_pct": - 1,&#34 ; mem_value_size":17408" pojo_mem":12224512," FREE_MEM":1896688640," max_mem的":1908930560," swap_mem&#34 ;: 0," num_keys":56," free_disk":0," max_disk":0," rpcs_active":0," fjthrds":[ - 1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,1,-1,1,0,0,0,0,0,0,0]" fjqueue":[ - 1,0,0,0,0,-1, - 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,-1,0,0,0,0,0,0,0 ,0]," tcps_active":0," open_fds": - 1," GFLOPS":4.598999977111816" mem_bw":6.423728128E9} ]" internal_security_enabled":假}
时间:2017-12-11 11:55:09.251
curlError:FALSE curlErrorMessage:httpStatusCode:200 httpStatusMessage:OK millis:6
{" __元" {" schema_version":3," SCHEMA_NAME":" ImportFilesV3"" schema_type&#34 ;:" ImportFiles"}" _exclude_fields":"""路径":" http://localhost:8082/datasets/tables/csv/vPrzC5TOQr6JTvnAYrU5AKyz8SP4ao8p.csv&# 34;,"模式":"""文件":[]," destination_frames":[],"失败& #34;:[" http://localhost:8082/datasets/tables/csv/vPrzC5TOQr6JTvnAYrU5AKyz8SP4ao8p.csv&#34],"德尔斯":[]}
答案 2 :(得分:0)