|
@@ -39,12 +39,14 @@ import org.apache.hadoop.hdfs.server.namenode.FSImage.NameNodeDirType;
|
|
|
import org.apache.hadoop.hdfs.server.namenode.FSImage.NameNodeFile;
|
|
|
import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol;
|
|
|
import org.apache.hadoop.hdfs.DFSConfigKeys;
|
|
|
+import org.apache.hadoop.hdfs.DFSUtil;
|
|
|
import org.apache.hadoop.hdfs.HdfsConfiguration;
|
|
|
import org.apache.hadoop.http.HttpServer;
|
|
|
import org.apache.hadoop.ipc.RPC;
|
|
|
import org.apache.hadoop.ipc.RemoteException;
|
|
|
import org.apache.hadoop.metrics.jvm.JvmMetrics;
|
|
|
import org.apache.hadoop.net.NetUtils;
|
|
|
+import org.apache.hadoop.security.UserGroupInformation;
|
|
|
import org.apache.hadoop.util.Daemon;
|
|
|
import org.apache.hadoop.util.StringUtils;
|
|
|
|
|
@@ -106,6 +108,11 @@ public class SecondaryNameNode implements Runnable {
|
|
|
* Create a connection to the primary namenode.
|
|
|
*/
|
|
|
public SecondaryNameNode(Configuration conf) throws IOException {
|
|
|
+ UserGroupInformation.setConfiguration(conf);
|
|
|
+ DFSUtil.login(conf,
|
|
|
+ DFSConfigKeys.DFS_NAMENODE_KEYTAB_FILE_KEY,
|
|
|
+ DFSConfigKeys.DFS_NAMENODE_USER_NAME_KEY);
|
|
|
+
|
|
|
try {
|
|
|
initialize(conf);
|
|
|
} catch(IOException e) {
|