A gear exists in mongo, but not on the node. How can it be removed?
Environment
- OpenShift Enterprise 2.0
- OpenShift Enterprise 2.1
Issue
- A gear exists in the Mongo database, but it does not exist on the node. How can this gear safely be removed from the mongo database?
Resolution
Remove the gear from the mongo database by running the below command on the broker, replacing
$ oo-admin-ctl-app -c destroy -l <login> -a <app_name>
The login and application name can be found with the oo-app-info command on the broker. Several identifying characteristics of the application can be used to find all details of the application:
-a, --app 'foo1,/^bar2$/' Comma-delimited list of app names or regular expressions, without domains
-d, --domain 'foo1,/^bar2$/' Comma-delimited list of domain namespaces or regular expressions, without app names
-f, --fqdn foo1,bar2 Comma-delimited list of app FQDNs
-l, --login 'foo1,/^bar2$/' Comma-delimited list of logins or regular expressions
-u, --gear_uuid 'foo1,/^bar2$/' Comma-delimited list of Application or Gear uuids or regular expressions
If the node where the application used to exist has been removed from the environment or deactivated, the oo-admin-repair command can be used to wipe any remaining data in the database from the removed node:
$ oo-admin-repair --removed-nodes
Note that for the above command to work, the node must not be responding to mcollective pings. This can be verified by ensuring the node is not returned in the output of the below command:
$ oo-mco ping
Root Cause
A node missing from the node, but still existing in the mongo database can be caused by numerous actions:
- If the node was removed or uninstalled with applications still on the node
- If
oo-devel-node app-destroy -a <app_name>oroo-admin-gear destroygearwere run on the node to remove the gear without changes to the mongo database - If a broker and activemq host is shutdown mid gear deletion
There are likely other possible causes that have not been found.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
