Chapter 5. Cartridge Management
Note
Important
5.1. Managing Cartridges on Broker Hosts
Important
oo-admin-ctl-cartridge
command, is only applicable to OpenShift Enterprise 2.1 and later.
To better understand cartridge management on broker hosts, including required tasks such as importing and activating cartridges, it is important to note the distinction between software versions and cartridge versions in cartridge manifests.
ruby-1.8
, and Ruby 1.9 with the cartridge name ruby-1.9
.
ruby-1.8
cartridge name would therefore have two cartridge versions (0.0.17 and 0.0.18), and the ruby-1.9
cartridge would also have two cartridge versions (0.0.17 and 0.0.18).
After manifests have been imported on the broker, you can designate cartridges as either active or inactive. The active cartridge represents the cartridge, based on an imported manifest, that is made available to developers for creating new applications or adding to existing applications. Any inactive cartridges cannot be deployed as new cartridges by developers. Cartridges can be activated automatically when importing the latest manifests from nodes or activated and deactivated manually at any time.
5.1.1. Importing, Activating, and Deactivating Cartridges
oo-admin-ctl-cartridge
command. Running the oo-admin-ctl-cartridge
command with the -c import-profile
option imports the latest manifests for all cartridges installed on a randomly selected node for each gear profile. Importing the latest manifests includes manifests for both newly installed cartridges as well as newly updated cartridges that may have older manifests that were previously imported.
# oo-admin-ctl-cartridge -c import-profile --activate
# oo-admin-ctl-cartridge -c import --url URL_to_Cartridge_Manifest --activate
After manifests have been imported, you can activate and deactivate cartridges manually using their cartridge name. Running the oo-admin-ctl-cartridge
command with the -c list
option lists all currently imported cartridges and the timestamp of each import. Active cartridges are identified with an asterisk.
Example 5.1. Listing Imported Cartridges
# oo-admin-ctl-cartridge -c list
* cron-1.4 plugin Cron 1.4 2014/06/16 22:09:55 UTC
* jenkins-client-1 plugin Jenkins Client 2014/06/16 22:09:55 UTC
mongodb-2.4 service MongoDB 2.4 2014/06/16 22:09:55 UTC
* mysql-5.1 service MySQL 5.1 2014/06/16 22:09:55 UTC
* mysql-5.5 service MySQL 5.5 2014/06/16 22:09:55 UTC
ruby-1.8 web Ruby 1.8 2014/06/16 22:09:55 UTC
* ruby-1.9 web Ruby 1.9 2014/06/16 22:09:55 UTC
* haproxy-1.4 web_proxy Web Load Balancer 2014/06/16 22:09:55 UTC
# oo-admin-ctl-cartridge -c activate --name Cart_Name1,Cart_Name2,Cart_Name3
# oo-admin-ctl-cartridge -c deactivate --name Cart_Name1,Cart_Name2,Cart_Name3
Whenever a new manifest is imported, a record is created in the MongoDB datastore noting the cartridge name, the timestamp of the import, and a unique cartridge ID. Cartridge IDs are alphanumeric strings used to identify a cartridge based on an imported manifest and timestamp of the import. Therefore, a single cartridge name can be associated with multiple cartridge IDs.
oo-admin-ctl-cartridge
.
5.1.2. Migrating and Upgrading Existing Applications to Active Cartridges
Existing applications using inactive cartridges continue to use the inactive versions when adding new gears, for example, during scaling operations. Run the following command on the broker host to allow these applications to instead use the currently active cartridges, if active versions are available, when adding new gears:
# oo-admin-ctl-cartridge -c migrate
Note
2
, wait a few minutes for all applications to finish using the cartridges, then run the command again until it completes successfully.
You can use the oo-admin-upgrade
command on the broker host to upgrade existing application gears that are currently using inactive cartridges to instead use active cartridges. The most common scenario that requires this cartridge upgrade process is when applying certain asynchronous errata updates. See the following section of the OpenShift Enterprise Deployment Guide for instructions on running the oo-admin-upgrade
command when applying these types of errata updates:
oo-admin-upgrade
command can also be used to upgrade existing application gears that are using inactive versions of custom, community, and downloadable cartridges. See Section 5.3, “Upgrading Custom and Community Cartridges” for more information.
5.1.3. Removing Unused Inactive Cartridges
oo-admin-ctl-cartridge
command with the -c clean
option on the broker. This command returns a list of the unused inactive cartridges that were removed, but also lists any inactive cartridges that were not removed because they were still in use by an application. Inactive cartridges that were not removed are shown on lines starting with a #
symbol; the number of applications that are still using the cartridge is shown at the end of the same line.
Example 5.2. Listing Imported Cartridges And Removing Unused Inactive Cartridges
#oo-admin-ctl-cartridge -c list
* cron-1.4 plugin Cron 1.4 2014/06/16 22:09:55 UTC * jenkins-client-1 plugin Jenkins Client 2014/06/16 22:09:55 UTC mongodb-2.4 service MongoDB 2.4 2014/06/16 22:09:55 UTC * mysql-5.1 service MySQL 5.1 2014/06/16 22:09:55 UTC * mysql-5.5 service MySQL 5.5 2014/06/16 22:09:55 UTC ruby-1.8 web Ruby 1.8 2014/06/16 22:09:55 UTC * ruby-1.9 web Ruby 1.9 2014/06/16 22:09:55 UTC * haproxy-1.4 web_proxy Web Load Balancer 2014/06/16 22:09:55 UTC #oo-admin-ctl-cartridge -c clean
Deleting all unused cartridges from the broker ... 539f6b336892dff17900000f # ruby-1.8 # 539f6b336892dff179000012 mongodb-2.4 1
mongodb-2.4
and ruby-1.8
cartridges were both inactive cartridges. The ruby-1.8
cartridge was successfully removed, however the mongodb-2.4
cartridge was not because it was still in use by one application. Listing the imported cartridges again confirms the removal of only the ruby-1.8
cartridge:
Example 5.3. Listing Imported Cartridges After Removing Unused Inactive Cartridges
# oo-admin-ctl-cartridge -c list
* cron-1.4 plugin Cron 1.4 2014/06/16 22:09:55 UTC
* jenkins-client-1 plugin Jenkins Client 2014/06/16 22:09:55 UTC
mongodb-2.4 service MongoDB 2.4 2014/06/16 22:09:55 UTC
* mysql-5.1 service MySQL 5.1 2014/06/16 22:09:55 UTC
* mysql-5.5 service MySQL 5.5 2014/06/16 22:09:55 UTC
* ruby-1.9 web Ruby 1.9 2014/06/16 22:09:55 UTC
* haproxy-1.4 web_proxy Web Load Balancer 2014/06/16 22:09:55 UTC