supervisor curl命令失败,退出56错误

时间:2014-08-19 22:27:35

标签: curl elasticsearch docker supervisord

我有这个curl cmd我在OSX本地运行成功完成:

 curl -XPOST http://192.168.59.103:9200/inventoryindex

 {"acknowledged":true}

但是当它从码头工人的主管那里跑出来时就失败了......嗯嗯嗯

 2014-08-16 14:24:38,838 INFO supervisord started with pid 1
 2014-08-16 14:24:39,842 INFO spawned: 'curl' with pid 9
 2014-08-16 14:24:39,843 INFO spawned: 'elasticsearch' with pid 10
 2014-08-16 14:24:39,844 INFO spawned: 'sshd' with pid 11
 2014-08-16 14:24:39,853 INFO exited: curl (exit status 56; not expected)

我尝试了几个不同的命令变体,结果相同:这是supervisor命令的最新版本:

 [program:curl]
 command=curl --header "Content-Type:application/json" -XPOST 'http://192.168.59.103:9200/inventoryindex'

有什么想法?谢谢!

[更新]因此,查看我认为的信息条目问题是,在弹性搜索有机会启动之前,主管会产生卷曲过程。我添加了优先级设置,使curl进程最后生成,并增加了重试次数,希望这会减少时间。

 [program:curl]
 command=curl -v --header "Content-Type:application/json" -XPOST 'http://192.168.59.103/:9200/inventoryindex' 
 startretries=5
 priority=1000

我也试过localhost:9200& 0.0.0.0:9200...zilch。看起来生成的订单现在是正确的,但curl仍未成功完成。

 2014-08-16 22:46:50,282 INFO supervisord started with pid 1
 2014-08-16 22:46:51,285 INFO spawned: 'elasticsearch' with pid 10
 2014-08-16 22:46:51,288 INFO spawned: 'rabbitmq-server' with pid 11
 2014-08-16 22:46:51,290 INFO spawned: 'sshd' with pid 12
 2014-08-16 22:46:51,294 INFO spawned: 'curl' with pid 17
 2014-08-16 22:46:51,341 INFO exited: curl (exit status 7; not expected)

弹性运行后重试次数增加再次尝试...现在应该可以用于卷曲但是...... zilch。

 2014-08-16 22:46:52,340 INFO success: elasticsearch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
 ...
 2014-08-16 22:46:53,346 INFO spawned: 'curl' with pid 143
 2014-08-16 22:46:53,372 INFO exited: curl (exit status 7; not expected)

[更新2]

  1. docker ps(OSX)

     CONTAINER ID        IMAGE                   COMMAND                CREATED               STATUS              PORTS                                                                                                                          NAMES
     13c872a3ffa7        team1/image1:rabbit   /usr/bin/supervisord   About a minute ago   Up About a minute   22/tcp, 4369/tcp, 5672/tcp, 0.0.0.0:9001->9001/tcp, 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp, 0.0.0.0:15672->15672/tcp   elegant_fermi
    
  2. docker ps(boot2docker)

    CONTAINER ID        IMAGE                   COMMAND                CREATED             STATUS              PORTS                                                                                                                          NAMES
    13c872a3ffa7        team1/image1:rabbit   /usr/bin/supervisord   5 minutes ago       Up 5 minutes        22/tcp, 4369/tcp, 5672/tcp, 0.0.0.0:9001->9001/tcp, 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp, 0.0.0.0:15672->15672/tcp   elegant_fermi       
    
  3. netstat -tunlp ...当我从boot2docker(ssh)中附加到13c872a3ffa7时,没有可用于输入netstat命令的命令提示符,所以我在ssh' d之后运行命令到boot2docker :

    netstat: can't scan /proc - are you root?
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
    tcp        0      0 :::2375                 :::*                    LISTEN      -
    tcp        0      0 :::22                   :::*                    LISTEN      -
    
  4. 我作为docker用户(我认为用户有root身份验证)

    克里斯......微小的变化,同样的结果......从curl变成了python客户端。这是代码的git链接。谢谢!

    [更新3] nsenter已安装

      来自boot2docker:

      一个。通过docker ps获取容器ID

      湾得到PID

        PID=`docker inspect --format '{{ .State.Pid }}' $CONTAINER_ID`
      

      ℃。运行nsenter

       nsenter -t $PID  -m -u -n -i -p -w
       nsenter: cannot open /proc/28160/ns/ipc: Permission denied
      

      重磅

      如果我sudo nsenter它切换到root,先前设置的变量被擦除,提示不知道docker命令:

        nsenter -t 28160 -m -u -n -i -p -w
        nsenter: cannot open /proc/28160/ns/ipc: No such file or directory
      

0 个答案:

没有答案