This is the documentation for Cloudera Manager 4.8.3.
Documentation for other versions is available at Cloudera Documentation.

Using Safety Valves for Custom Configuration

A "safety valve" lets you insert a text string verbatim into a configuration file, such a XML configuration files, properties files, text files, or an environment. The safety value mechanism is intended for advanced use in cases where there is a specific Hadoop configuration setting that you find is not exposed in Cloudera Manager; contact Cloudera Support if you are required to use it. Safety valve configuration generally overrides normal configuration.

The values you enter into a safety valve must conform to the syntax of the recipient. For an XML configuration file, the safety valve must contain valid XML property definitions, for a properties file, the safety valve must contain valid property definitions. Some files simply require a list of host addresses.

The UI will give you an indicator if something needs a restart.

Service-wide safety valves apply to all roles in the service; a safety valve value for a role group apply to all instances of the role associated with that role group.

There are safety valves for servers and client configurations. In general after changing a server safety value, you must restart the server and after changing a client safety valve you must redeploy the client configuration. Sometimes you can refresh instead of restart. In some cases, you will need to restart a dependent server after changing a client configuration. For example, changing a MapReduce client configuration will mark the dependent Hive server as stale, which must then be restarted. The Admin Console will display an indicator when a server must be restarted.

There are five main types of safety values:
  • Configuration - allow you to set configuration properties in various configuration files; the Description field tells you into which configuration file your additions will be placed. Configuration files have the extension .xml or .conf.
    For example, there are several configuration safety valves for the Hive service. One Hive safety valve property is called the HiveServer2 Configuration Safety Valve for hive-site.xml; settings you enter here will be inserted verbatim into the hive-site.xml file associated with the HiveServer2 role group.

    This property definition is what you would put in that configuration safety valve to specify a MySQL connector library:
    <property> 
      <name>hive.aux.jars.path</name> 
      <value>file:///usr/share/java/mysql-connector-java.jar</value>
    </property>

    To see a list of safety valves that apply to a specific configuration file, enter the configuration file name in the Search field in the top navigation bar. For example, searching for mapred-site.xml will show the safety valves that have mapred-site.xml in their description.

  • Environment - allow you to specify key-value pairs for a service, role, or client that are inserted into the respective environment.
    One example of using an environment safety valve is to add a JAR to a classpath. Place your JARs in a custom location such as /opt/myjars and extend the classpath via the appropriate service environment safety valve. For example, add HBASE_CLASSPATH=/opt/myjars/* to the HBase Service Environment Safety Valve.
      Note: Do not place JARs inside locations such as /opt/cloudera or /usr/lib/{hadoop*,hbase*,hive*,etc.} that are managed by Cloudera because they get overwritten at upgrades.
  • Logging - allow you to set properties in a log4j.properties file.
  • Metrics - allow you to set properties to configure Hadoop metrics in a hadoop-metrics.properties or hadoop-metrics2.properties file.
  • White and black lists - allow you to specify a list of host addresses that are allowed or disallowed from accessing a service.

Setting a Safety Valve

  1. Click a service.
  2. Select Configuration > View and Edit.
  3. Expand a category group and click an Advanced subcategory.
  4. In the Property column, choose a property that contains the string Safety Valve.
  5. Click the Value column to enable editing.
  6. Specify the properties.
  7. Click Save Changes.
  8. Restart the service or redeploy client configurations as indicated.