1. 程式人生 > >Hadoop之旅(7)— HDFS HA Zookeeper自動故障轉移

Hadoop之旅(7)— HDFS HA Zookeeper自動故障轉移

<!-- 兩個NameNode -->
	<property>
		<name>dfs.nameservices</name>
		<value>ns1</value>
	</property>
	<property>
		<name>dfs.ha.namenodes.ns1</name>
		<value>nn1,nn2</value>
	</property>
	
	<!-- #####################NameNode RPC ADDRESS######################### -->
	<property>
		<name>dfs.namenode.rpc-address.ns1.nn1</name>
		<value>czy-1:8020</value>
	</property>
	<property>
		<name>dfs.namenode.rpc-address.ns1.nn2</name>
		<value>czy-2:8020</value>
	</property>
	
	
	<!-- #####################NameNode HTTP WEB ADDRESS######################### -->
	<property>
		<name>dfs.namenode.http-address.ns1.nn1</name>
		<value>czy-1:50070</value>
	</property>
	<property>
		<name>dfs.namenode.http-address.ns1.nn2</name>
		<value>czy-2:50070</value>
	</property>
	
	
	<!-- #####################NameNode SHARED EDITS ADDRESS######################### -->
	<property>
		<name>dfs.namenode.shared.edits.dir</name>
		<value>qjournal://czy-1:8485;czy-2:8485;czy-3:8485/ns1</value>
	</property>
	<property>
		<name>dfs.journalnode.edits.dir</name>
		<value>/usr/local/chenzhengyou/hadoop/cluster/data/tmp/dfs/jn</value>
	</property>
	
	
	<!-- #################### HDFS PROXY client ######################### -->	
	<property>
		<name>dfs.client.failover.proxy.provider.ns1</name>
		<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
	</property>	
	
	
	<!-- ##################### NameNodes FENCE 隔離 ######################### -->	
	<property>
		<name>dfs.ha.fencing.methods</name>
		<value>sshfence</value>
	</property>
	<!--注意:兩個NameNode之間能夠ssh無密碼登入-->
	<property>
		<name>dfs.ha.fencing.ssh.private-key-files</name>
		<value>/root/.ssh/id_rsa</value>
	</property>
	
	
	<!-- #####################  automatic failover ######################### -->		
	<property>
		<name>dfs.ha.automatic-failover.enabled</name>
		<value>true</value>
	</property>
	
	<!--許可權-->
	<property>
		<name>dfs.permissions</name>
		<value>false</value>
    </property>

2.3、slaves檔案(三臺機器的主機名)