Unit states

The unit status is the way to know what is happening with a unit. You can use thetsuru app-info -a <appname> to see the unit status:

  1. $ tsuru app-info -a tsuru-dashboard
  2. Application: tsuru-dashboard
  3. Repository: git@localhost:tsuru-dashboard.git
  4. Platform: python
  5. ...
  6. Units: 1
  7. +------------+---------+
  8. | Unit | State |
  9. +------------+---------+
  10. | 9cf863c2c1 | started |
  11. +------------+---------+

The unit state flow is:

  1. +----------+ start +---------+
  2. | building | +---------------------+| stopped |
  3. +----------+ | +---------+
  4. ^ | ^
  5. | | |
  6. deploy unit | stop
  7. | | |
  8. + v RegisterUnit +
  9. +---------+ app unit +----------+ SetUnitStatus +---------+
  10. | created | +---------> | starting | +-------------> | started |
  11. +---------+ +----------+ +---------+
  12. + ^ +
  13. | | |
  14. SetUnitStatus | |
  15. | | |
  16. v | |
  17. +-------+ SetUnitStatus | |
  18. | error | +-------------------+ |
  19. +-------+ <---------------------+
  • created: is the initial status of an unit.
  • building: is the status for units being provisioned by the provisioner, like during deployment.
  • error: is the status for units that failed to start, because of an application error.
  • starting: is set when the container is started in docker.
  • started: is for cases where the unit is up and running.
  • stopped: is for cases where the unit has been stopped.

原文: https://docs.tsuru.io/1.6/using/unit-states.html