配置

HA

  1. val configuration = new Configuration
  2. configuration.setBoolean("dfs.support.append", true)
  3. configuration.set("dfs.client.block.write.replace-datanode-on-failure.policy", "NEVER")
  4. configuration.set("dfs.client.block.write.replace-datanode-on-failure.enable", "true")
  5. configuration.set("dfs.block.access.token.enable", "true")
  6. configuration.set("dfs.http.policy", "HTTP_ONLY")
  7. configuration.set("dfs.replication", "1")
  8. configuration.set("fs.hdfs.impl", classOf[org.apache.hadoop.hdfs.DistributedFileSystem].getName)
  9. configuration.set("fs.file.impl", classOf[org.apache.hadoop.fs.LocalFileSystem].getName)
  10. configuration.set("fs.hdfs.impl.disable.cache", "true")
  11. configuration.set("fs.defaultFS", s"hdfs://HaimaNX")
  12. configuration.set("dfs.nameservices", "HaimaNX")
  13. configuration.set(s"dfs.ha.namenodes.HaimaNX", "nn1,nn2")
  14. configuration.set(s"dfs.client.failover.proxy.provider.HaimaNX",
  15. "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider")
  16. configuration.set(s"dfs.namenode.rpc-address.HaimaNX.nn1", "mvp-hadoop26:8020")
  17. configuration.set(s"dfs.namenode.rpc-address.HaimaNX.nn2", "MVP-HADOOP27:8020")

无HA

读写

文档更新时间: 2019-01-28 16:54