1 /** 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 package org.apache.hadoop.fs; 20 21 import org.apache.hadoop.classification.InterfaceAudience; 22 import org.apache.hadoop.classification.InterfaceStability; 23 import org.apache.hadoop.http.lib.StaticUserWebFilter; 24 25 /** 26 * This class contains constants for configuration keys used 27 * in the common code. 28 * 29 * It inherits all the publicly documented configuration keys 30 * and adds unsupported keys. 31 * 32 */ 33 34 @InterfaceAudience.Private 35 @InterfaceStability.Unstable 36 public class CommonConfigurationKeys extends CommonConfigurationKeysPublic { 37 38 /** Default location for user home directories */ 39 public static final String FS_HOME_DIR_KEY = "fs.homeDir"; 40 /** Default value for FS_HOME_DIR_KEY */ 41 public static final String FS_HOME_DIR_DEFAULT = "/user"; 42 /** Default umask for files created in HDFS */ 43 public static final String FS_PERMISSIONS_UMASK_KEY = 44 "fs.permissions.umask-mode"; 45 /** Default value for FS_PERMISSIONS_UMASK_KEY */ 46 public static final int FS_PERMISSIONS_UMASK_DEFAULT = 0022; 47 /** How often does RPC client send pings to RPC server */ 48 public static final String IPC_PING_INTERVAL_KEY = "ipc.ping.interval"; 49 /** Default value for IPC_PING_INTERVAL_KEY */ 50 public static final int IPC_PING_INTERVAL_DEFAULT = 60000; // 1 min 51 /** Enables pings from RPC client to the server */ 52 public static final String IPC_CLIENT_PING_KEY = "ipc.client.ping"; 53 /** Default value of IPC_CLIENT_PING_KEY */ 54 public static final boolean IPC_CLIENT_PING_DEFAULT = true; 55 /** Responses larger than this will be logged */ 56 public static final String IPC_SERVER_RPC_MAX_RESPONSE_SIZE_KEY = 57 "ipc.server.max.response.size"; 58 /** Default value for IPC_SERVER_RPC_MAX_RESPONSE_SIZE_KEY */ 59 public static final int IPC_SERVER_RPC_MAX_RESPONSE_SIZE_DEFAULT = 60 1024*1024; 61 /** Number of threads in RPC server reading from the socket */ 62 public static final String IPC_SERVER_RPC_READ_THREADS_KEY = 63 "ipc.server.read.threadpool.size"; 64 /** Default value for IPC_SERVER_RPC_READ_THREADS_KEY */ 65 public static final int IPC_SERVER_RPC_READ_THREADS_DEFAULT = 1; 66 67 /** Number of pending connections that may be queued per socket reader */ 68 public static final String IPC_SERVER_RPC_READ_CONNECTION_QUEUE_SIZE_KEY = 69 "ipc.server.read.connection-queue.size"; 70 /** Default value for IPC_SERVER_RPC_READ_CONNECTION_QUEUE_SIZE */ 71 public static final int IPC_SERVER_RPC_READ_CONNECTION_QUEUE_SIZE_DEFAULT = 72 100; 73 74 public static final String IPC_MAXIMUM_DATA_LENGTH = 75 "ipc.maximum.data.length"; 76 77 public static final int IPC_MAXIMUM_DATA_LENGTH_DEFAULT = 64 * 1024 * 1024; 78 79 /** How many calls per handler are allowed in the queue. */ 80 public static final String IPC_SERVER_HANDLER_QUEUE_SIZE_KEY = 81 "ipc.server.handler.queue.size"; 82 /** Default value for IPC_SERVER_HANDLER_QUEUE_SIZE_KEY */ 83 public static final int IPC_SERVER_HANDLER_QUEUE_SIZE_DEFAULT = 100; 84 85 /** 86 * CallQueue related settings. These are not used directly, but rather 87 * combined with a namespace and port. For instance: 88 * IPC_CALLQUEUE_NAMESPACE + ".8020." + IPC_CALLQUEUE_IMPL_KEY 89 */ 90 public static final String IPC_CALLQUEUE_NAMESPACE = "ipc"; 91 public static final String IPC_CALLQUEUE_IMPL_KEY = "callqueue.impl"; 92 public static final String IPC_CALLQUEUE_IDENTITY_PROVIDER_KEY = "identity-provider.impl"; 93 94 /** This is for specifying the implementation for the mappings from 95 * hostnames to the racks they belong to 96 */ 97 public static final String NET_TOPOLOGY_CONFIGURED_NODE_MAPPING_KEY = 98 "net.topology.configured.node.mapping"; 99 100 /** 101 * Supported compression codec classes 102 */ 103 public static final String IO_COMPRESSION_CODECS_KEY = "io.compression.codecs"; 104 105 /** Internal buffer size for Lzo compressor/decompressors */ 106 public static final String IO_COMPRESSION_CODEC_LZO_BUFFERSIZE_KEY = 107 "io.compression.codec.lzo.buffersize"; 108 109 /** Default value for IO_COMPRESSION_CODEC_LZO_BUFFERSIZE_KEY */ 110 public static final int IO_COMPRESSION_CODEC_LZO_BUFFERSIZE_DEFAULT = 111 64*1024; 112 113 /** Internal buffer size for Snappy compressor/decompressors */ 114 public static final String IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_KEY = 115 "io.compression.codec.snappy.buffersize"; 116 117 /** Default value for IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_KEY */ 118 public static final int IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_DEFAULT = 119 256 * 1024; 120 121 /** Internal buffer size for Lz4 compressor/decompressors */ 122 public static final String IO_COMPRESSION_CODEC_LZ4_BUFFERSIZE_KEY = 123 "io.compression.codec.lz4.buffersize"; 124 125 /** Default value for IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_KEY */ 126 public static final int IO_COMPRESSION_CODEC_LZ4_BUFFERSIZE_DEFAULT = 127 256 * 1024; 128 129 /** Use lz4hc(slow but with high compression ratio) for lz4 compression */ 130 public static final String IO_COMPRESSION_CODEC_LZ4_USELZ4HC_KEY = 131 "io.compression.codec.lz4.use.lz4hc"; 132 133 /** Default value for IO_COMPRESSION_CODEC_USELZ4HC_KEY */ 134 public static final boolean IO_COMPRESSION_CODEC_LZ4_USELZ4HC_DEFAULT = 135 false; 136 137 /** 138 * Service Authorization 139 */ 140 public static final String 141 HADOOP_SECURITY_SERVICE_AUTHORIZATION_DEFAULT_ACL = 142 "security.service.authorization.default.acl"; 143 public static final String 144 HADOOP_SECURITY_SERVICE_AUTHORIZATION_DEFAULT_BLOCKED_ACL = 145 "security.service.authorization.default.acl.blocked"; 146 public static final String 147 HADOOP_SECURITY_SERVICE_AUTHORIZATION_REFRESH_POLICY = 148 "security.refresh.policy.protocol.acl"; 149 public static final String 150 HADOOP_SECURITY_SERVICE_AUTHORIZATION_GET_USER_MAPPINGS = 151 "security.get.user.mappings.protocol.acl"; 152 public static final String 153 HADOOP_SECURITY_SERVICE_AUTHORIZATION_REFRESH_USER_MAPPINGS = 154 "security.refresh.user.mappings.protocol.acl"; 155 public static final String 156 HADOOP_SECURITY_SERVICE_AUTHORIZATION_REFRESH_CALLQUEUE = 157 "security.refresh.callqueue.protocol.acl"; 158 public static final String 159 HADOOP_SECURITY_SERVICE_AUTHORIZATION_GENERIC_REFRESH = 160 "security.refresh.generic.protocol.acl"; 161 public static final String 162 HADOOP_SECURITY_SERVICE_AUTHORIZATION_TRACING = 163 "security.trace.protocol.acl"; 164 public static final String 165 SECURITY_HA_SERVICE_PROTOCOL_ACL = "security.ha.service.protocol.acl"; 166 public static final String 167 SECURITY_ZKFC_PROTOCOL_ACL = "security.zkfc.protocol.acl"; 168 public static final String 169 SECURITY_CLIENT_PROTOCOL_ACL = "security.client.protocol.acl"; 170 public static final String SECURITY_CLIENT_DATANODE_PROTOCOL_ACL = 171 "security.client.datanode.protocol.acl"; 172 public static final String 173 SECURITY_DATANODE_PROTOCOL_ACL = "security.datanode.protocol.acl"; 174 public static final String 175 SECURITY_INTER_DATANODE_PROTOCOL_ACL = "security.inter.datanode.protocol.acl"; 176 public static final String 177 SECURITY_NAMENODE_PROTOCOL_ACL = "security.namenode.protocol.acl"; 178 public static final String SECURITY_QJOURNAL_SERVICE_PROTOCOL_ACL = 179 "security.qjournal.service.protocol.acl"; 180 public static final String HADOOP_SECURITY_TOKEN_SERVICE_USE_IP = 181 "hadoop.security.token.service.use_ip"; 182 public static final boolean HADOOP_SECURITY_TOKEN_SERVICE_USE_IP_DEFAULT = 183 true; 184 185 /** 186 * HA health monitor and failover controller. 187 */ 188 189 /** How often to retry connecting to the service. */ 190 public static final String HA_HM_CONNECT_RETRY_INTERVAL_KEY = 191 "ha.health-monitor.connect-retry-interval.ms"; 192 public static final long HA_HM_CONNECT_RETRY_INTERVAL_DEFAULT = 1000; 193 194 /* How often to check the service. */ 195 public static final String HA_HM_CHECK_INTERVAL_KEY = 196 "ha.health-monitor.check-interval.ms"; 197 public static final long HA_HM_CHECK_INTERVAL_DEFAULT = 1000; 198 199 /* How long to sleep after an unexpected RPC error. */ 200 public static final String HA_HM_SLEEP_AFTER_DISCONNECT_KEY = 201 "ha.health-monitor.sleep-after-disconnect.ms"; 202 public static final long HA_HM_SLEEP_AFTER_DISCONNECT_DEFAULT = 1000; 203 204 /* Timeout for the actual monitorHealth() calls. */ 205 public static final String HA_HM_RPC_TIMEOUT_KEY = 206 "ha.health-monitor.rpc-timeout.ms"; 207 public static final int HA_HM_RPC_TIMEOUT_DEFAULT = 45000; 208 209 /* Timeout that the FC waits for the new active to become active */ 210 public static final String HA_FC_NEW_ACTIVE_TIMEOUT_KEY = 211 "ha.failover-controller.new-active.rpc-timeout.ms"; 212 public static final int HA_FC_NEW_ACTIVE_TIMEOUT_DEFAULT = 60000; 213 214 /* Timeout that the FC waits for the old active to go to standby */ 215 public static final String HA_FC_GRACEFUL_FENCE_TIMEOUT_KEY = 216 "ha.failover-controller.graceful-fence.rpc-timeout.ms"; 217 public static final int HA_FC_GRACEFUL_FENCE_TIMEOUT_DEFAULT = 5000; 218 219 /* FC connection retries for graceful fencing */ 220 public static final String HA_FC_GRACEFUL_FENCE_CONNECTION_RETRIES = 221 "ha.failover-controller.graceful-fence.connection.retries"; 222 public static final int HA_FC_GRACEFUL_FENCE_CONNECTION_RETRIES_DEFAULT = 1; 223 224 /** number of zookeeper operation retry times in ActiveStandbyElector */ 225 public static final String HA_FC_ELECTOR_ZK_OP_RETRIES_KEY = 226 "ha.failover-controller.active-standby-elector.zk.op.retries"; 227 public static final int HA_FC_ELECTOR_ZK_OP_RETRIES_DEFAULT = 3; 228 229 /* Timeout that the CLI (manual) FC waits for monitorHealth, getServiceState */ 230 public static final String HA_FC_CLI_CHECK_TIMEOUT_KEY = 231 "ha.failover-controller.cli-check.rpc-timeout.ms"; 232 public static final int HA_FC_CLI_CHECK_TIMEOUT_DEFAULT = 20000; 233 234 /** Static user web-filter properties. 235 * See {@link StaticUserWebFilter}. 236 */ 237 public static final String HADOOP_HTTP_STATIC_USER = 238 "hadoop.http.staticuser.user"; 239 public static final String DEFAULT_HADOOP_HTTP_STATIC_USER = 240 "dr.who"; 241 242 /** 243 * User->groups static mapping to override the groups lookup 244 */ 245 public static final String HADOOP_USER_GROUP_STATIC_OVERRIDES = 246 "hadoop.user.group.static.mapping.overrides"; 247 public static final String HADOOP_USER_GROUP_STATIC_OVERRIDES_DEFAULT = 248 "dr.who=;"; 249 250 /** Enable/Disable aliases serving from jetty */ 251 public static final String HADOOP_JETTY_LOGS_SERVE_ALIASES = 252 "hadoop.jetty.logs.serve.aliases"; 253 public static final boolean DEFAULT_HADOOP_JETTY_LOGS_SERVE_ALIASES = 254 true; 255 256 /* Path to the Kerberos ticket cache. Setting this will force 257 * UserGroupInformation to use only this ticket cache file when creating a 258 * FileSystem instance. 259 */ 260 public static final String KERBEROS_TICKET_CACHE_PATH = 261 "hadoop.security.kerberos.ticket.cache.path"; 262 263 public static final String HADOOP_SECURITY_UID_NAME_CACHE_TIMEOUT_KEY = 264 "hadoop.security.uid.cache.secs"; 265 266 public static final long HADOOP_SECURITY_UID_NAME_CACHE_TIMEOUT_DEFAULT = 267 4*60*60; // 4 hours 268 269 public static final String IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_KEY = "ipc.client.fallback-to-simple-auth-allowed"; 270 public static final boolean IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_DEFAULT = false; 271 272 public static final String IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SASL_KEY = 273 "ipc.client.connect.max.retries.on.sasl"; 274 public static final int IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SASL_DEFAULT = 5; 275 276 /** How often the server scans for idle connections */ 277 public static final String IPC_CLIENT_CONNECTION_IDLESCANINTERVAL_KEY = 278 "ipc.client.connection.idle-scan-interval.ms"; 279 /** Default value for IPC_SERVER_CONNECTION_IDLE_SCAN_INTERVAL_KEY */ 280 public static final int IPC_CLIENT_CONNECTION_IDLESCANINTERVAL_DEFAULT = 281 10000; 282 283 public static final String HADOOP_USER_GROUP_METRICS_PERCENTILES_INTERVALS = 284 "hadoop.user.group.metrics.percentiles.intervals"; 285 286 public static final String RPC_METRICS_QUANTILE_ENABLE = 287 "rpc.metrics.quantile.enable"; 288 public static final boolean RPC_METRICS_QUANTILE_ENABLE_DEFAULT = false; 289 public static final String RPC_METRICS_PERCENTILES_INTERVALS_KEY = 290 "rpc.metrics.percentiles.intervals"; 291 292 /** Allowed hosts for nfs exports */ 293 public static final String NFS_EXPORTS_ALLOWED_HOSTS_SEPARATOR = ";"; 294 public static final String NFS_EXPORTS_ALLOWED_HOSTS_KEY = "nfs.exports.allowed.hosts"; 295 public static final String NFS_EXPORTS_ALLOWED_HOSTS_KEY_DEFAULT = "* rw"; 296 } 297