Configuration tconf = new HdfsConfiguration(); SecondaryNameNode secondary = null; secondary = new SecondaryNameNode(tconf, opts);
@SuppressWarnings("deprecation") SecondaryNameNode startSecondaryNameNode(Configuration conf ) throws IOException { conf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY, "0.0.0.0:0"); return new SecondaryNameNode(conf); }
@SuppressWarnings("deprecation") SecondaryNameNode startSecondaryNameNode(Configuration conf ) throws IOException { conf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY, "0.0.0.0:0"); return new SecondaryNameNode(conf); }
@Override protected SecondaryNameNode doCreate(Dictionary properties) throws Exception { Configuration conf = new Configuration(); for (Enumeration e = properties.keys(); e.hasMoreElements();) { Object key = e.nextElement(); Object val = properties.get(key); conf.set( key.toString(), val.toString() ); } SecondaryNameNode secondaryNameNode = new SecondaryNameNode(conf); new Daemon(secondaryNameNode).start(); return secondaryNameNode; }
/** * Check whether the secondary name-node can be started. */ @SuppressWarnings("deprecation") private boolean canStartSecondaryNode(Configuration conf) throws IOException { // Using full name allows us not to have to add deprecation tag to // entire source file. org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode sn = null; try { sn = new org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode(conf); } catch(IOException e) { if (e instanceof java.net.BindException) return false; throw e; } finally { if(sn != null) sn.shutdown(); } return true; }
SecondaryNameNode startSecondaryNameNode(Configuration conf ) throws IOException { conf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY, "0.0.0.0:0"); return new SecondaryNameNode(conf); }
/** * main() has some simple utility methods. * @param argv Command line parameters. * @exception Exception if the filesystem does not exist. */ public static void main(String[] argv) throws Exception { StringUtils.startupShutdownMessage(SecondaryNameNode.class, argv, LOG); Configuration tconf = new Configuration(); if (argv.length >= 1) { SecondaryNameNode secondary = new SecondaryNameNode(tconf); int ret = secondary.processArgs(argv); System.exit(ret); } // Create a never ending deamon Daemon checkpointThread = new Daemon(new SecondaryNameNode(tconf)); checkpointThread.start(); }
SecondaryNameNode startSecondaryNameNode(Configuration conf ) throws IOException { conf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY, "0.0.0.0:0"); return new SecondaryNameNode(conf); }
/** * main() has some simple utility methods. * @param argv Command line parameters. * @exception Exception if the filesystem does not exist. */ public static void main(String[] argv) throws Exception { StringUtils.startupShutdownMessage(SecondaryNameNode.class, argv, LOG); Configuration tconf = new Configuration(); try { argv = DFSUtil.setGenericConf(argv, tconf); } catch (IllegalArgumentException e) { System.err.println(e.getMessage()); printUsage(""); return; } if (argv.length >= 1) { SecondaryNameNode secondary = new SecondaryNameNode(tconf); int ret = secondary.processArgs(argv); System.exit(ret); } // Create a never ending deamon Daemon checkpointThread = new Daemon(new SecondaryNameNode(tconf)); checkpointThread.start(); }
SecondaryNameNode startSecondaryNameNode(Configuration conf, int index) throws IOException { Configuration snnConf = new Configuration(conf); snnConf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY, "0.0.0.0:0"); snnConf.set(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_DIR_KEY, MiniDFSCluster.getBaseDirectory() + "/2nn-" + index); return new SecondaryNameNode(snnConf); }
/** * Check whether the secondary name-node can be started. */ @SuppressWarnings("deprecation") private boolean canStartSecondaryNode(Configuration conf) throws IOException { // Using full name allows us not to have to add deprecation tag to // entire source file. org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode sn = null; try { sn = new org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode(conf); } catch(IOException e) { if (e instanceof java.net.BindException) return false; throw e; } finally { if(sn != null) sn.shutdown(); } return true; }
sn = new SecondaryNameNode(config); assertNotNull(sn);
@BeforeClass public static void setUpCluster() throws IOException { conf.set(DFSConfigKeys.DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY, "0.0.0.0:0"); conf.setLong(DFS_NAMENODE_CHECKPOINT_TXNS_KEY, 500); cluster = new MiniDFSCluster.Builder(conf).numDataNodes(0) .build(); cluster.waitActive(); snn = new SecondaryNameNode(conf); }
SecondaryNameNode secondary = null; try { secondary = new SecondaryNameNode(tconf, opts); } catch (IOException ioe) { LOG.fatal("Failed to start secondary namenode", ioe);
cluster.waitActive(); SecondaryNameNode secondary = new SecondaryNameNode(config); System.out.println("****testStorageRestore: Cluster and SNN started"); printStorages(cluster.getNameNode().getFSImage());
snn = new SecondaryNameNode(conf); snn = new SecondaryNameNode(conf);
/** * Test that the 2NN does not start if given a config with HA NNs. */ @Test public void testSecondaryNameNodeDoesNotStart() throws IOException { // Note we're not explicitly setting the nameservice Id in the // config as it is not required to be set and we want to test // that we can determine if HA is enabled when the nameservice Id // is not explicitly defined. Configuration conf = getHAConf("ns1", "1.2.3.1", "1.2.3.2"); try { new SecondaryNameNode(conf); fail("Created a 2NN with an HA config"); } catch (IOException ioe) { GenericTestUtils.assertExceptionContains( "Cannot use SecondaryNameNode in an HA cluster", ioe); } } }
sn = new SecondaryNameNode(config); assertNotNull(sn);
SecondaryNameNode secondary = null; try { secondary = new SecondaryNameNode(tconf, opts); } catch (IOException ioe) { LOG.fatal("Failed to start secondary namenode", ioe);
snn = new SecondaryNameNode(conf);