Skip to content

Instantly share code, notes, and snippets.

@andyshinn
Last active August 29, 2015 14:01
Show Gist options
  • Save andyshinn/f5269ab55e21e80cc499 to your computer and use it in GitHub Desktop.
Save andyshinn/f5269ab55e21e80cc499 to your computer and use it in GitHub Desktop.

Scale the Ruby application to one process:

$ deis ps:scale web=1
Scaling processes... but first, coffee!
done in 3s

=== fhbase Processes

--- web:
web.1 down (v3)

We can see that is is attempted to be started and fails on the first ExecStartPost:

$ fleetctl status fhbase_v3.web.1.service
● fhbase_v3.web.1.service - fhbase_v3.web.1
   Loaded: loaded (/run/fleet/units/fhbase_v3.web.1.service; linked-runtime)
   Active: failed (Result: exit-code) since Tue 2014-05-27 21:42:12 UTC; 7s ago
  Process: 23945 ExecStop=/usr/bin/docker rm -f fhbase_v3.web.1 (code=exited, status=0/SUCCESS)
  Process: 23936 ExecStartPost=/bin/sh -c arping -Idocker0 -c1 `docker inspect -f '{{ .NetworkSettings.IPAddress }}' fhbase_v3.web.1` (code=exited, status=2)
  Process: 23848 ExecStartPost=/bin/sh -c until docker inspect fhbase_v3.web.1 >/dev/null 2>&1; do sleep 1; done (code=exited, status=0/SUCCESS)
  Process: 23847 ExecStart=/bin/sh -c port=$(docker inspect -f '{{range $k, $v := .config.ExposedPorts }}{{$k}}{{end}}' 172.16.64.7:5000/fhbase:v3 | cut -d/ -f1) ; /usr/bin/docker run --name fhbase_v3.web.1 -P -e PORT=$port 172.16.64.7:5000/fhbase:v3 start web (code=exited, status=0/SUCCESS)
  Process: 23838 ExecStartPre=/bin/sh -c docker inspect fhbase_v3.web.1 >/dev/null 2>&1 && docker rm -f fhbase_v3.web.1 || true (code=exited, status=0/SUCCESS)
  Process: 23600 ExecStartPre=/usr/bin/docker pull 172.16.64.7:5000/fhbase:v3 (code=exited, status=0/SUCCESS)
 Main PID: 23847 (code=exited, status=0/SUCCESS)

May 27 21:42:12 ip-172-16-64-8 sh[23936]: -V : print version and exit
May 27 21:42:12 ip-172-16-64-8 sh[23936]: -c count : how many packets to send
May 27 21:42:12 ip-172-16-64-8 sh[23936]: -w timeout : how long to wait for a reply
May 27 21:42:12 ip-172-16-64-8 sh[23936]: -I device : which ethernet device to use
May 27 21:42:12 ip-172-16-64-8 sh[23936]: -s source : source ip address
May 27 21:42:12 ip-172-16-64-8 sh[23936]: destination : ask for what ip address
May 27 21:42:12 ip-172-16-64-8 systemd[1]: fhbase_v3.web.1.service: control process exited, code=exited status=2
May 27 21:42:12 ip-172-16-64-8 docker[23945]: fhbase_v3.web.1
May 27 21:42:12 ip-172-16-64-8 systemd[1]: Failed to start fhbase_v3.web.1.
May 27 21:42:12 ip-172-16-64-8 systemd[1]: Unit fhbase_v3.web.1.service entered failed state.

If we take apart the command we can see there is no IP address for the instance:

$ docker inspect -f '{{ .NetworkSettings.IPAddress }}' fhbase_v3.web.1

$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment