Modern Big Data Processing with Hadoop
上QQ阅读APP看书,第一时间看更新

Configuration of HA NameNodes with shared storage

Add the following properties to the hdfs-site.xml:

Property
Value
dfs.nameservices cluster_name
dfs.ha.namenodes.cluster_name NN1, NN2
dfs.namenode.rpc-address.cluster_name.NN1 machine1:8020
dfs.namenode.rpc-address.cluster_name.NN2 machine2:8020
dfs.namenode.http-address.cluster_name.NN1 machine1:50070
dfs.namenode.http-address.cluster_name.NN2 machine2:50070
dfs.namenode.shared.edits.dir file:///mnt/filer1/dfs/ha-name-dir-shared
dfs.client.failover.proxy.provider.cluster_name org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider
dfs.ha.fencing.methods sshfence
dfs.ha.fencing.ssh.private-key-files /home/myuser/.ssh/id_rsa
dfs.ha.fencing.methods sshfence([[username][:port]])
dfs.ha.fencing.ssh.connect-timeout 30000

Add the following properties to core-site.xml:

Property Value
fs.defaultFS hdfs://cluster_name