我在带有CentOs 7的服务器上使用来自R的h2o包。
我正确安装了库。Java版本
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
正确设置为JAVA_HOME。当我运行h2o.init()
时,我收到了一条带有错误的长消息
rary: xgboost4j_gpu
11-22 10:42:12.375 127.0.0.1:54321 31865 main INFO: XGBoost supported backends: [WITH_GPU, WITH_OMP]
11-22 10:42:12.375 127.0.0.1:54321 31865 main INFO: ----- H2O started -----
11-22 10:42:12.376 127.0.0.1:54321 31865 main INFO: Build git branch: rel-wright
11-22 10:42:12.376 127.0.0.1:54321 31865 main INFO: Build git hash: 0457fda98594a72aca24d06e8c3622d45bd545d2
11-22 10:42:12.376 127.0.0.1:54321 31865 main INFO: Build git describe: jenkins-rel-latest-stable-1-g0457fda
11-22 10:42:12.376 127.0.0.1:54321 31865 main INFO: Build project version: 3.20.0.8
11-22 10:42:12.376 127.0.0.1:54321 31865 main INFO: Build age: 2 months
11-22 10:42:12.376 127.0.0.1:54321 31865 main INFO: Built by: 'jenkins'
11-22 10:42:12.376 127.0.0.1:54321 31865 main INFO: Built on: '2018-09-21 16:54:12'
11-22 10:42:12.376 127.0.0.1:54321 31865 main INFO: Watchdog Build git branch: (unknown)
11-22 10:42:12.376 127.0.0.1:54321 31865 main INFO: Watchdog Build git hash: (unknown)
11-22 10:42:12.377 127.0.0.1:54321 31865 main INFO: Watchdog Build git describe: (unknown)
11-22 10:42:12.377 127.0.0.1:54321 31865 main INFO: Watchdog Build project version: (unknown)
11-22 10:42:12.377 127.0.0.1:54321 31865 main INFO: Watchdog Built by: (unknown)
11-22 10:42:12.377 127.0.0.1:54321 31865 main INFO: Watchdog Built on: (unknown)
11-22 10:42:12.377 127.0.0.1:54321 31865 main INFO: XGBoost Build git branch: (unknown)
11-22 10:42:12.377 127.0.0.1:54321 31865 main INFO: XGBoost Build git hash: (unknown)
11-22 10:42:12.377 127.0.0.1:54321 31865 main INFO: XGBoost Build git describe: (unknown)
11-22 10:42:12.377 127.0.0.1:54321 31865 main INFO: XGBoost Build project version: (unknown)
11-22 10:42:12.378 127.0.0.1:54321 31865 main INFO: XGBoost Built by: (unknown)
11-22 10:42:12.378 127.0.0.1:54321 31865 main INFO: XGBoost Built on: (unknown)
11-22 10:42:12.378 127.0.0.1:54321 31865 main INFO: KrbStandalone Build git branch: (unknown)
11-22 10:42:12.378 127.0.0.1:54321 31865 main INFO: KrbStandalone Build git hash: (unknown)
11-22 10:42:12.378 127.0.0.1:54321 31865 main INFO: KrbStandalone Build git describe: (unknown)
11-22 10:42:12.378 127.0.0.1:54321 31865 main INFO: KrbStandalone Build project version: (unknown)
11-22 10:42:12.378 127.0.0.1:54321 31865 main INFO: KrbStandalone Built by: (unknown)
11-22 10:42:12.378 127.0.0.1:54321 31865 main INFO: KrbStandalone Built on: (unknown)
11-22 10:42:12.378 127.0.0.1:54321 31865 main INFO: Processed H2O arguments: [-name, H2O_started_from_R_datascience_msi886, -ip, localhost, -web_ip, localhost, -port, 54321, -ice_root, /tmp/RtmpooR6rF]
11-22 10:42:12.378 127.0.0.1:54321 31865 main INFO: Java availableProcessors: 4
11-22 10:42:12.379 127.0.0.1:54321 31865 main INFO: Java heap totalMemory: 121.0 MB
11-22 10:42:12.379 127.0.0.1:54321 31865 main INFO: Java heap maxMemory: 1.73 GB
11-22 10:42:12.379 127.0.0.1:54321 31865 main INFO: Java version: Java 1.8.0_181 (from Oracle Corporation)
11-22 10:42:12.379 127.0.0.1:54321 31865 main INFO: JVM launch parameters: [-Dsys.ai.h2o.debug.allowJavaVersions=11, -ea]
11-22 10:42:12.379 127.0.0.1:54321 31865 main INFO: OS version: Linux 3.10.0-862.14.4.el7.x86_64 (amd64)
11-22 10:42:12.379 127.0.0.1:54321 31865 main INFO: Machine physical memory: 7.80 GB
11-22 10:42:12.379 127.0.0.1:54321 31865 main INFO: X-h2o-cluster-id: 1542879731843
11-22 10:42:12.379 127.0.0.1:54321 31865 main INFO: User name: 'datascience'
11-22 10:42:12.379 127.0.0.1:54321 31865 main INFO: IPv6 stack selected: false
11-22 10:42:12.379 127.0.0.1:54321 31865 main INFO: Possible IP Address: ens160 (ens160), fe80:0:0:0:250:56ff:feb4:1f23%ens160
11-22 10:42:12.380 127.0.0.1:54321 31865 main INFO: Possible IP Address: ens160 (ens160), 10.0.1.110
11-22 10:42:12.380 127.0.0.1:54321 31865 main INFO: Possible IP Address: lo (lo), 0:0:0:0:0:0:0:1%lo
11-22 10:42:12.380 127.0.0.1:54321 31865 main INFO: Possible IP Address: lo (lo), 127.0.0.1
11-22 10:42:12.380 127.0.0.1:54321 31865 main FATAL: On localhost/127.0.0.1 some of the required ports 54321, 54322 are not available, change -port PORT and try again.
[1] "localhost"
[1] 54321
[1] FALSE
[1] 503
[1] ""
我看了日志,这就是显示的内容
11-22 10:42:12.380 127.0.0.1:54321 31865 main FATAL: On localhost/12 7.0.0.1 some of the required ports 54321, 54322 are not available, change -port PORT and try again.
但这很奇怪,因为在运行所有这些之前,我验证了指定的端口是否可用。我很绝望,希望你能帮忙。
感谢
更新
所以我设法跑了。我接受了
/home/datascience/.checkpoint/2018-11-20/lib/x86_64-redhat-linux-gnu/3.5.1/h2o/java
然后运行CCD_ 2,我发现实例在54323端口下运行。然后我回到R并运行
h2o.init(ip='machine_ip',port=54321,max_mem_size='2g',startH2O=FALSE)
它奏效了。但为什么??我关闭了所有东西,重新打开它,唯一能让事情正常工作的就是运行java -jar h2o.jar
,然后转到R会话并运行h2o.init()
h2o.init((将查找现有的h2o实例。因为你用"java-jarh2o.jar"h2o.init((手动启动了一个
如果你没有指定一个IP地址,并且h2o.init((没有找到一个已经在运行的h2o实例,那么如果startH2O为true,h2o.init((将尝试创建一个实例。说端口54321或端口54322不可用的消息正意味着这一点。其中一个肯定被拿走了,即使不是你想要的。使用"netstat-anp"来诊断linux上的端口使用情况。
好的,我和我公司的一位软件工程师一起找到了一个解决方案。
他简单地写了一个bash,它将调用"java-jar-h2o.jar",手动启动h2o集群,在R脚本中,我通过连接到现有的h2o实例
h2o.init(ip="machine_ip",port=number_port,startH2O=FALSE)