Skip to content

Commit 5fe3deb

Browse files
committed
High availability setup
1 parent e138423 commit 5fe3deb

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/main/java/org/radarcns/hdfs/RestructureAvroRecords.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,16 @@ public static void main(String [] args) {
124124

125125
builder.putHdfsConfig("dfs.nameservices", commandLineArgs.hdfsUri);
126126
builder.putHdfsConfig("dfs.ha.namenodes." + commandLineArgs.hdfsUri, commandLineArgs.hdfsHa);
127-
builder.putHdfsConfig("dfs.namenode.rpc-address." + commandLineArgs.hdfsUri + "." + haNames[0], commandLineArgs.hdfsUri1);
128-
builder.putHdfsConfig("dfs.namenode.rpc-address." + commandLineArgs.hdfsUri + "." + haNames[1], commandLineArgs.hdfsUri2);
127+
builder.putHdfsConfig("dfs.namenode.rpc-address." + commandLineArgs.hdfsUri + "." + haNames[0], commandLineArgs.hdfsUri1 + ":8020");
128+
builder.putHdfsConfig("dfs.namenode.rpc-address." + commandLineArgs.hdfsUri + "." + haNames[1], commandLineArgs.hdfsUri2 + ":8020");
129129
builder.putHdfsConfig("dfs.client.failover.proxy.provider." + commandLineArgs.hdfsUri,"org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider");
130130
}
131131

132132
RestructureAvroRecords restr = builder.build();
133133

134134
try {
135135
for(String input : commandLineArgs.inputPaths) {
136-
logger.info("In: " + commandLineArgs.hdfsUri + input);
136+
logger.info("In: hdfs://" + commandLineArgs.hdfsUri + input);
137137
logger.info("Out: " + commandLineArgs.outputDirectory);
138138
restr.start(input);
139139
}
@@ -177,7 +177,6 @@ private RestructureAvroRecords(RestructureAvroRecords.Builder builder) {
177177

178178
public void setInputWebHdfsURL(String fileSystemURL) {
179179
conf.set("fs.defaultFS", "hdfs://" + fileSystemURL);
180-
conf.set("fs.default.name", conf.get("fs.defaultFS"));
181180
}
182181

183182
public void setOutputPath(String path) {

src/main/java/org/radarcns/hdfs/util/commandline/CommandLineArgs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public class CommandLineArgs {
2323
@Parameter(names = { "-n", "--nameservice"}, description = "The HDFS name services to connect to. Eg - '<HOST>' for single configurations or <CLUSTER_ID> for high availability web services.", required = true, validateWith = { PathValidator.class })
2424
public String hdfsUri;
2525

26-
@Parameter(names = { "--namenode-1" }, description = "High availability HDFS name node to also connect to. Eg - '<HOST>:<RPC_PORT>'.", validateWith = { PathValidator.class })
26+
@Parameter(names = { "--namenode-1" }, description = "High availability HDFS first name node hostname.", validateWith = { PathValidator.class })
2727
public String hdfsUri1;
2828

29-
@Parameter(names = { "--namenode-2" }, description = "High availability HDFS name node to also connect to. Eg - '<HOST>:<RPC_PORT>'.", validateWith = { PathValidator.class })
29+
@Parameter(names = { "--namenode-2" }, description = "High availability HDFS second name node hostname. Eg - '<HOST>'.", validateWith = { PathValidator.class })
3030
public String hdfsUri2;
3131

3232
@Parameter(names = { "--namenode-ha"}, description = "High availability HDFS name node names. Eg - 'nn1,nn2'.", validateWith = { PathValidator.class })

0 commit comments

Comments
 (0)