I did have some “Host is in invalid state” message from Ambari; In that situation you cannot restart or do anything.
The last time it occured was on ZOOKEEPER_CLIENT, so here is the way of putting the component back to its original state :
to have the ZOOKEEPER_CLIENT status :
curl -u admin:admin -i -H 'X-Requested-By: ambari' -X GET http://$AMBARI_HOST:8080/api/v1/clusters/$MYCLUSTER/hosts/$ZOOKEEPER_CLIENT_HOST/host_components/ZOOKEEPER_CLIENT
if it’s not in INSTALLED state :
curl -u admin:admin -i -H 'X-Requested-By: ambari' -X PUT -d '{"HostRoles": {"state": "INSTALLED"}}' http://$AMBARI_HOST:8080/api/v1/clusters/$MYCLUSTER/hosts/$ZOOKEEPER_CLIENT_HOST/host_components/ZOOKEEPER_CLIENT