2017-09-26 5 views
2

次のコードを実行してRのH2Oに接続し、出力を以下のように取得しています: h2o.init(nthreads = -1、max_mem_size = paste 、「g」は、=「」))rのH2Oへの接続が成功したかどうかをテストする方法R

R is connected to the H2O cluster: 
H2O cluster uptime:   3 minutes 57 seconds 
H2O cluster version:  3.14.0.3 
H2O cluster version age: 3 days 
H2O cluster name:   H2O_started_from_R_rami_krispin 
H2O cluster total nodes: 1 
H2O cluster total memory: 0.88 GB 
H2O cluster total cores: 4 
H2O cluster allowed cores: 4 
H2O cluster healthy:  TRUE 
H2O Connection ip:   localhost 
H2O Connection port:  54321 
H2O Connection proxy:  NA 
H2O Internal Security:  FALSE 
H2O API Extensions:   Algos, AutoML, Core V3, Core V4 
R Version:     R version 3.4.1 (2017-06-30) 

9月には、接続が成功したものは何でもブール変数(真/偽の応答でis.h2o.connect()のようなもの)にキャプチャするための方法およびへの接続の属性があります変数?たとえば:

x$port 
>54321 

または

x$memory 
>0.88 GB 

は、事前にありがとうございます! ラミ

+0

は、最初の質問にしたいものですか?h2o.clusterIsUp() – SymbolixAU

+0

それは速かった!はい!ありがとう! –

+0

であり、 'h2o.clusterInfo()'はコンソールに出力される情報を提供します。 Rオブジェクトにするには、キャプチャ&パースの方法が必要です。 – SymbolixAU

答えて

3

クラスタがアップあなたが

h2o.clusterIsUp() 
# TRUE 

を使用することができますし、次にあなたが内部h2o機能の一部を使用することができます

h2o.getConnection() 

IP Address: localhost 
Port  : 54321 
Session ID: _sid_b51e 
Key Count : 0 

を使用することができ、接続情報を参照するかどうかを確認するには接続に関するすべてのメタ情報を取得する

res <- h2o:::.h2o.fromJSON(
     jsonlite::fromJSON(
      h2o:::.h2o.doSafeGET(
      urlSuffix = h2o:::.h2o.__CLOUD 
      ), 
      implifyDataFrame = FALSE 
     ) 
     ) 

str(res) 
List of 19 
$ __meta     :List of 3 
    ..$ schema_version: int 3 
    ..$ schema_name : chr "CloudV3" 
    ..$ schema_type : chr "Iced" 
$ _exclude_fields   : chr "" 
$ skip_ticks    : logi TRUE 
$ version     : chr "3.10.4.6" 
$ branch_name    : chr "rel-ueno" 
$ build_number    : chr "6" 
$ build_age    : chr "4 months and 30 days" 
$ build_too_old   : logi TRUE 
$ node_idx     : int 0 
$ cloud_name    : chr "H2O_started_from_R_david_tos519" 
$ cloud_size    : int 1 
$ cloud_uptime_millis  : int 772951 
$ cloud_healthy   : logi TRUE 
$ bad_nodes    : int 0 
$ consensus    : logi TRUE 
$ locked     : logi TRUE 
$ is_client    : logi FALSE 
$ nodes     :List of 1 
    ..$ :List of 27 
    .. ..$ __meta  :List of 3 
    .. .. ..$ schema_version: int 3 
    .. .. ..$ schema_name : chr "NodeV3" 
    .. .. ..$ schema_type : chr "Iced" 
... etc 
+1

SymbolixAU、ありがとう! –

2

O K、h2o.clusterStatus()は接続属性を提供しています

      h2o healthy last_ping 
1 localhost/127.0.0.1:54321 TRUE 1.506398e+12 
    num_cpus sys_load mem_value_size free_mem 
1  4 0.2445616   5120 783876096 
    pojo_mem swap_mem free_disk  max_disk 
1 170846208  0 310012542976 510426873856 
    pid num_keys tcps_active open_fds rpcs_active 
1 7084  20   0  -1   0 
関連する問題