-
Notifications
You must be signed in to change notification settings - Fork 132
The alternatives.json file
The alternatives.json file is a secondary, optional, part of the parcel metadata. It contains definitions for entries that should be registered with the system's alternatives system. Typically, these alternatives entries will be used to provide convenient access to programs inside the parcel (eg: Creating a /usr/bin/hdfs that points into the CDH parcel).
If alternatives are provided by a parcel, and if CM is configured to create them, then they will be created at the time the parcel is activated, and deleted when the parcel is deactivated. Implicitly this means that if you switch from one version of a parcel to another, the alternatives will be replaced by new ones pointing into the newly activated version.
If the alternative being added is already a registered alternative (obviously with a different target) on the system, then the registration will happen, but the active target will only switch if the alternative is currently in auto mode and the new target priority is higher than the current one. Cloudera provided parcels deliberately have a low priority, on the basis that if there is an alternatives overlap, the other entry is probably the one the user wants. You can choose whatever priority level you want for your alternatives, but think about the implications of an overlap for your product.
{
"avro-tools": {
"destination": "/usr/bin/avro-tools",
"source": "bin/avro-tools",
"priority": 10,
"isDirectory": false
},
"beeline": {
"destination": "/usr/bin/beeline",
"source": "bin/beeline",
"priority": 10,
"isDirectory": false
},
"hadoop": {
"destination": "/usr/bin/hadoop",
"source": "bin/hadoop",
"priority": 10,
"isDirectory": false
},
"hbase-conf": {
"destination": "/etc/hbase/conf",
"source": "etc/hbase/conf.dist",
"priority": 10,
"isDirectory": true
},
"hbase-solr-conf": {
"destination": "/etc/hbase-solr/conf",
"source": "etc/hbase-solr/conf.dist",
"priority": 10,
"isDirectory": true
},
"hive-conf": {
"destination": "/etc/hive/conf",
"source": "etc/hive/conf.dist",
"priority": 10,
"isDirectory": true
}
}