public static void main(String[] args) throws Exception { SecurityUtil.serverLogin(); Instance instance = HdfsZooInstance.getInstance(); ServerConfiguration conf = new ServerConfiguration(instance); FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), conf.getConfiguration()); Accumulo.init(fs, conf, "tracer"); String hostname = Accumulo.getLocalAddress(args); TraceServer server = new TraceServer(conf, hostname); Accumulo.enableTracing(hostname, "tserver"); server.run(); log.info("tracer stopping"); }
final String logConfigFile = locateLogConfig(System.getenv("ACCUMULO_CONF_DIR"), application); int dataVersion = Accumulo.getAccumuloPersistentVersion(fs); log.info("Data Version " + dataVersion); Accumulo.waitForZookeeperAndHdfs(fs); if (!(canUpgradeFromDataVersion(dataVersion))) { throw new RuntimeException("This version of accumulo (" + Constants.VERSION + ") is not compatible with files stored using data version " + dataVersion); monitorSwappiness(conf);
private static synchronized void _getInstanceID() { if (instanceId == null) { AccumuloConfiguration acuConf = SiteConfiguration.getInstance(); // InstanceID should be the same across all volumes, so just choose one VolumeManager fs; try { fs = VolumeManagerImpl.get(); } catch (IOException e) { throw new RuntimeException(e); } Path instanceIdPath = Accumulo.getAccumuloInstanceIdPath(fs); log.trace("Looking for instanceId from {}", instanceIdPath); String instanceIdFromFile = ZooUtil.getInstanceIDFromHdfs(instanceIdPath, acuConf); instanceId = instanceIdFromFile; } }
final int accumuloPersistentVersion = Accumulo.getAccumuloPersistentVersion(fs); if (Accumulo.persistentVersionNeedsUpgrade(accumuloPersistentVersion)) {
public static void main(String[] args) throws Exception { final String app = "tracer"; Accumulo.setupLogging(app); loginTracer(SiteConfiguration.getInstance()); ServerOpts opts = new ServerOpts(); opts.parseArgs(app, args); Instance instance = HdfsZooInstance.getInstance(); ServerConfigurationFactory conf = new ServerConfigurationFactory(instance); VolumeManager fs = VolumeManagerImpl.get(); MetricsSystemHelper.configure(TraceServer.class.getSimpleName()); Accumulo.init(fs, conf, app); String hostname = opts.getAddress(); TraceServer server = new TraceServer(conf, hostname); try { server.run(); } finally { log.info("tracer stopping"); ZooReaderWriter.getInstance().getZooKeeper().close(); } }
int dataVersion = Accumulo.getAccumuloPersistentVersion(fs); log.info("Data Version " + dataVersion); Accumulo.waitForZookeeperAndHdfs(fs); monitorSwappiness();
public static void main(String[] args) throws UnknownHostException, IOException { SecurityUtil.serverLogin(); Instance instance = HdfsZooInstance.getInstance(); ServerConfiguration serverConf = new ServerConfiguration(instance); final FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), serverConf.getConfiguration()); Accumulo.init(fs, serverConf, "gc"); String address = "localhost"; SimpleGarbageCollector gc = new SimpleGarbageCollector(); Opts opts = new Opts(); opts.parseArgs(SimpleGarbageCollector.class.getName(), args); if (opts.safeMode) gc.setSafeMode(); if (opts.offline) gc.setOffline(); if (opts.verbose) gc.setVerbose(); if (opts.address != null) address = opts.address; String hostname = address; // Catch a few edge cases where we might get a non-useful address if ("0.0.0.0".equals(address)) { // Get a better hostname for this system hostname = InetAddress.getLocalHost().getHostName(); } gc.init(fs, instance, SecurityConstants.getSystemCredentials(), serverConf.getConfiguration().getBoolean(Property.GC_TRASH_IGNORE)); Accumulo.enableTracing(hostname, "gc"); gc.run(hostname); }
public static synchronized int getAccumuloPersistentVersion(VolumeManager fs) { // It doesn't matter which Volume is used as they should all have the data version stored return getAccumuloPersistentVersion(fs.getVolumes().iterator().next()); }
if (Accumulo.getAccumuloPersistentVersion(fs) == Constants.PREV_DATA_VERSION) { Accumulo.abortIfFateTransactions();
final int accumuloPersistentVersion = Accumulo.getAccumuloPersistentVersion(fs); if (Accumulo.persistentVersionNeedsUpgrade(accumuloPersistentVersion)) { + " save all logs and file a bug."); Accumulo.abortIfFateTransactions(); try { log.info("Upgrading zookeeper");
/** * Utility program that will change the goal state for the master from the command line. */ public static void main(String[] args) throws Exception { if (args.length != 1 || MasterGoalState.valueOf(args[0]) == null) { System.err.println( "Usage: accumulo " + SetGoalState.class.getName() + " [NORMAL|SAFE_MODE|CLEAN_STOP]"); System.exit(-1); } SecurityUtil.serverLogin(SiteConfiguration.getInstance()); VolumeManager fs = VolumeManagerImpl.get(); Accumulo.waitForZookeeperAndHdfs(fs); ZooReaderWriter.getInstance().putPersistentData( ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZMASTER_GOAL_STATE, args[0].getBytes(UTF_8), NodeExistsPolicy.OVERWRITE); }
@Override public void run() { try { log.info("Starting to upgrade !METADATA table."); MetadataTable.moveMetaDeleteMarkers(instance, SecurityConstants.getSystemCredentials()); log.info("Updating persistent data version."); Accumulo.updateAccumuloVersion(fs); log.info("Upgrade complete"); waitForMetadataUpgrade.countDown(); } catch (Exception ex) { log.fatal("Error performing upgrade", ex); System.exit(1); } } };
public static void main(String[] args) throws Exception { try { final String app = "master"; Accumulo.setupLogging(app); SecurityUtil.serverLogin(SiteConfiguration.getInstance()); ServerOpts opts = new ServerOpts(); opts.parseArgs(app, args); String hostname = opts.getAddress(); ServerConfigurationFactory conf = new ServerConfigurationFactory( HdfsZooInstance.getInstance()); VolumeManager fs = VolumeManagerImpl.get(); MetricsSystemHelper.configure(Master.class.getSimpleName()); Accumulo.init(fs, conf, app); Master master = new Master(conf, fs, hostname); DistributedTrace.enable(hostname, app, conf.getConfiguration()); master.run(); } catch (Exception ex) { log.error("Unexpected exception, exiting", ex); System.exit(1); } finally { DistributedTrace.disable(); } }
public static synchronized void updateAccumuloVersion(FileSystem fs) { try { if (getAccumuloPersistentVersion(fs) == Constants.PREV_DATA_VERSION) { fs.create(new Path(ServerConstants.getDataVersionLocation() + "/" + Constants.DATA_VERSION)); // TODO document failure mode & recovery if FS permissions cause above to work and below to fail ACCUMULO-2596 fs.delete(new Path(ServerConstants.getDataVersionLocation() + "/" + Constants.PREV_DATA_VERSION), false); } } catch (IOException e) { throw new RuntimeException("Unable to set accumulo version: an error occurred.", e); } }
private void upgradeZookeeper() { // 1.5.1 and 1.6.0 both do some state checking after obtaining the zoolock for the // monitor and before starting up. It's not tied to the data version at all (and would // introduce unnecessary complexity to try to make the master do it), but be aware // that the master is not the only thing that may alter zookeeper before starting. if (Accumulo.getAccumuloPersistentVersion(fs) == Constants.PREV_DATA_VERSION) { // This Master hasn't started Fate yet, so any outstanding transactions must be from before the upgrade. // Change to Guava's Verify once we use Guava 17. if (null != fate) { throw new IllegalStateException( "Access to Fate should not have been initialized prior to the Master transitioning to active. Please save all logs and file a bug."); } Accumulo.abortIfFateTransactions(); try { log.info("Upgrading zookeeper"); IZooReaderWriter zoo = ZooReaderWriter.getInstance(); zoo.recursiveDelete(ZooUtil.getRoot(instance) + "/loggers", NodeMissingPolicy.SKIP); zoo.recursiveDelete(ZooUtil.getRoot(instance) + "/dead/loggers", NodeMissingPolicy.SKIP); zoo.putPersistentData(ZooUtil.getRoot(instance) + Constants.ZRECOVERY, new byte[] {'0'}, NodeExistsPolicy.SKIP); for (String id : Tables.getIdToNameMap(instance).keySet()) { zoo.putPersistentData(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + id + Constants.ZTABLE_COMPACT_CANCEL_ID, "0".getBytes(UTF_8), NodeExistsPolicy.SKIP); } haveUpgradedZooKeeper = true; } catch (Exception ex) { log.fatal("Error performing upgrade", ex); System.exit(1); } } }
/** * Utility program that will change the goal state for the master from the command line. */ public static void main(String[] args) throws Exception { if (args.length != 1 || MasterGoalState.valueOf(args[0]) == null) { System.err.println("Usage: accumulo " + SetGoalState.class.getName() + " [NORMAL|SAFE_MODE|CLEAN_STOP]"); System.exit(-1); } SecurityUtil.serverLogin(); FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), ServerConfiguration.getSiteConfiguration()); Accumulo.waitForZookeeperAndHdfs(fs); ZooReaderWriter.getInstance().putPersistentData(ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZMASTER_GOAL_STATE, args[0].getBytes(UTF_8), NodeExistsPolicy.OVERWRITE); }
Accumulo.updateAccumuloVersion(fs, accumuloPersistentVersion); log.info("Upgrade complete"); waitForMetadataUpgrade.countDown();
public static void main(String[] args) throws UnknownHostException, IOException { final String app = "gc"; Accumulo.setupLogging(app); SecurityUtil.serverLogin(SiteConfiguration.getInstance()); Instance instance = HdfsZooInstance.getInstance(); ServerConfigurationFactory conf = new ServerConfigurationFactory(instance); log.info("Version " + Constants.VERSION); log.info("Instance " + instance.getInstanceID()); final VolumeManager fs = VolumeManagerImpl.get(); MetricsSystemHelper.configure(SimpleGarbageCollector.class.getSimpleName()); Accumulo.init(fs, conf, app); Opts opts = new Opts(); opts.parseArgs(app, args); SimpleGarbageCollector gc = new SimpleGarbageCollector(opts, fs, conf); DistributedTrace.enable(opts.getAddress(), app, conf.getConfiguration()); try { gc.run(); } finally { DistributedTrace.disable(); } }
public static void main(String[] args) throws Exception { SecurityUtil.serverLogin(); FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), ServerConfiguration.getSiteConfiguration()); String hostname = Accumulo.getLocalAddress(args); instance = HdfsZooInstance.getInstance(); config = new ServerConfiguration(instance); Accumulo.init(fs, config, "monitor"); Monitor monitor = new Monitor(); Accumulo.enableTracing(hostname, "monitor"); monitor.run(hostname); }
private void upgradeMetadata() { if (Accumulo.getAccumuloPersistentVersion(fs) == Constants.PREV_DATA_VERSION) {