在监督下使用监督者来运行过程

时间:2021-03-15 14:56:45

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

我试图在监督者的监督下运行一个过程(http://monitsord.org/)。

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

我有两个运行几乎相同环境的环境(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.

当前的问题是,我试图在Supervisor下运行的进程可以在一个服务器下完美运行,而不是在另一个服务器上。

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:

以下是主管提供的stderr:

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.

我双重检查子流程。py及其权限,它看起来与成功的服务器相同。

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

我希望我能提供更多的信息,但这就是我所拥有的。也许有人能告诉我从哪里开始?

2 个解决方案

#1


3  

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

我在尝试启动Storm时遇到了这个问题,因为java不在我的路径上。我不得不

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.

所以我猜你的问题是java而不是python(或python模块)。

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.

为了解决这个问题,我实际上加入了一些调试打印语句到风暴中。py脚本,这样我就可以看到它作为子进程执行的命令。当我尝试使用shell脚本运行相同的命令(由于java类路径被指定为参数)时,它找不到java。

'Hope this helps.

“希望这有助于。

#2


1  

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

如果您已经设置了java路径并且仍然得到这个错误,您可以尝试这样做。

  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

    storm_env开放。在storm conf文件夹中的ini文件。如果是第一次访问,查找配置备用JAVAHOME的行,它将是这样的

    #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

    用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

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

  3. Save changes and close the editor.

    保存更改并关闭编辑器。

  4. Open new terminal and try again

    打开新的终端,再试一次

#1


3  

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

我在尝试启动Storm时遇到了这个问题,因为java不在我的路径上。我不得不

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.

所以我猜你的问题是java而不是python(或python模块)。

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.

为了解决这个问题,我实际上加入了一些调试打印语句到风暴中。py脚本,这样我就可以看到它作为子进程执行的命令。当我尝试使用shell脚本运行相同的命令(由于java类路径被指定为参数)时,它找不到java。

'Hope this helps.

“希望这有助于。

#2


1  

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

如果您已经设置了java路径并且仍然得到这个错误,您可以尝试这样做。

  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

    storm_env开放。在storm conf文件夹中的ini文件。如果是第一次访问,查找配置备用JAVAHOME的行,它将是这样的

    #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

    用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

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

  3. Save changes and close the editor.

    保存更改并关闭编辑器。

  4. Open new terminal and try again

    打开新的终端,再试一次