简体   繁体   中英

Run h2o.ai as a service (background)

How to run H2O.ai python in background?

I tried putting

import h2o
h2o.init()
input() # to stop closing the python program

in a python script and run with nohup python3 script.py & . But the script exits if I enter the return key. Is there a way to avoid this behavior and run h2o.ai in background?

Your Python session is ending, and thus your H2O cluster may be stopping.

You can start H2O 3 from Command Line , for example:

java -jar h2o.jar

^you will need to be in the directory of your H2O 3 folder (like here ).

Alternatively, you can add sleep to your script:

import time
time.sleep(10)

^this will leave the program running for 10 seconds. If you want to extend it, just add more seconds to the max time you want the program to run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM