Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 11-15-2016 10:53 AM
Hi,
I have already tested my HDFS HA cluster with my java application (i.e simple file upload/download).
Now that I have configured federated cluster, How can I use it in same code with few necessary modifications. Here is my code example for HDFS HA cluster. Please suggest for Federation HA cluster. Problem is I think my Configuration object is getting null while getting the FileSystem object for federated cluster.
conf.set("fs.defaultFS", "hdfs://HadoopTestHA");
conf.set("dfs.replication","4");
conf.set("dfs.ha.namenodes.HadoopTestHA", "nn1,nn2");
conf.set("dfs.namenode.rpc-address.HadoopTestHA.nn1","hadoop4ind.india:8020");
conf.set("dfs.namenode.rpc-address.HadoopTestHA.nn2","hadoop5ind.india:8020");
conf.set("dfs.client.failover.proxy.provider.HadoopTestHA","org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider");
copyFromLocalHDFS(conf,"Fed_Java_Test"); // File uploading code
Created 12-26-2016 07:57 PM
In your code, you may have to add the following line:
conf.set("dfs.nameservices", "HadoopTestHA")
Created 12-26-2016 04:22 PM
@Viraj Vekaria could you please try setting these properties in conf and see if it helps?
dfs.nameservices=HadoopTestHA
dfs.ha.namenodes.HadoopTestHA=nn1,nn2
dfs.namenode.rpc-address.HadoopTestHA.namenode1=hadoop4ind.india:8020
dfs.namenode.rpc-address.HadoopTestHA.namenode2=hadoop5ind.india:8020
dfs.client.failover.proxy.provider.HadoopTestHA=org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider
Created 12-26-2016 07:57 PM
In your code, you may have to add the following line:
conf.set("dfs.nameservices", "HadoopTestHA")