Thomas Edison
Thomas Edison

Reputation: 61

Run a Process under Supervision using Supervisor

I'm trying to run a process under supervision by Supervisor (http://supervisord.org/).

I have two environments running almost the same environment (Ubuntu 12.04 LTS).

The current problem is the process I tried to run under Supervisor can run perfectly under one server, but not the other.

On the failed server, I tried to run the same process without Supervisor. Everything is ok. Any idea? Thanks.

Here is the stderr provided by Supervisor:

Traceback (most recent call last):
File "/usr/storm-0.8.1/bin/storm", line 402, in <module>
  main()
File "/usr/storm-0.8.1/bin/storm", line 399, in main
  (COMMANDS.get(COMMAND, "help"))(*ARGS)
File "/usr/storm-0.8.1/bin/storm", line 263, in supervisor
  jvmopts = parse_args(confvalue("supervisor.childopts", cppaths)) + [
File "/usr/storm-0.8.1/bin/storm", line 58, in confvalue
  p = sub.Popen(command, stdout=sub.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
  errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
  raise child_exception
OSError: [Errno 2] No such file or directory

I double-checked the subprocess.py and its permission and it looks the same as the successful server.

I wish I could provide more information, but this is all I have. Maybe someone can suggest me where to start?

Upvotes: 2

Views: 3670

Answers (2)

javatar
javatar

Reputation: 1340

If you have already set your java path and still getting this error, you can try this.

  1. Open storm_env.ini file in storm conf folder. Find line that configures alternate JAVAHOME if you are accessing for the first time it'll look like this

    #The java implementation to use. If JAVA_HOME is not found we expect java to be in path #JAVA_HOME:home
  2. Update it with your JAVAHOME

    ex (this how it looks in my file.):

    #The java implementation to use. If JAVA_HOME is not found we expect java to be in path

    JAVA_HOME:/usr/lib/jvm/java-8-oracle

  3. Save changes and close the editor.

  4. Open new terminal and try again

Upvotes: 1

Steve T
Steve T

Reputation: 150

I got this exact issue when attempting to start Storm because java wasn't on my PATH. I had to

export JAVA_HOME=...  # specify your own path here
export PATH=$PATH:$JAVA_HOME/bin   # allows for finding the java executable

so I'm guessing that it's java and not python (or a python module) that is your issue.

To figure out this much, I actually went in and added some debug print statements to the storm.py script so that I could see what command it was trying to execute as a subprocess. When I tried to run that same command (which was quite large, due to the java classpath being specified as an argument) via a shell script, it couldn't find Java.

'Hope this helps.

Upvotes: 3

Related Questions