use of org.apache.accumulo.server.ServerOpts in project accumulo by apache.
the class Master method main.
public static void main(String[] args) throws Exception {
try {
final String app = "master";
ServerOpts opts = new ServerOpts();
opts.parseArgs(app, args);
SecurityUtil.serverLogin(SiteConfiguration.getInstance());
String hostname = opts.getAddress();
Instance instance = HdfsZooInstance.getInstance();
ServerConfigurationFactory conf = new ServerConfigurationFactory(instance);
VolumeManager fs = VolumeManagerImpl.get();
MetricsSystemHelper.configure(Master.class.getSimpleName());
Accumulo.init(fs, instance, conf, app);
Master master = new Master(instance, conf, fs, hostname);
DistributedTrace.enable(hostname, app, conf.getSystemConfiguration());
master.run();
} catch (Exception ex) {
log.error("Unexpected exception, exiting", ex);
System.exit(1);
} finally {
DistributedTrace.disable();
}
}
use of org.apache.accumulo.server.ServerOpts in project accumulo by apache.
the class Monitor method main.
public static void main(String[] args) throws Exception {
final String app = "monitor";
ServerOpts opts = new ServerOpts();
opts.parseArgs(app, args);
String hostname = opts.getAddress();
SecurityUtil.serverLogin(SiteConfiguration.getInstance());
VolumeManager fs = VolumeManagerImpl.get();
instance = HdfsZooInstance.getInstance();
config = new ServerConfigurationFactory(instance);
context = new AccumuloServerContext(instance, config);
log.info("Version " + Constants.VERSION);
log.info("Instance " + instance.getInstanceID());
MetricsSystemHelper.configure(Monitor.class.getSimpleName());
Accumulo.init(fs, instance, config, app);
Monitor monitor = new Monitor();
// Servlets need access to limit requests when the monitor is not active, but Servlets are instantiated
// via reflection. Expose the service this way instead.
Monitor.HA_SERVICE_INSTANCE = monitor;
DistributedTrace.enable(hostname, app, config.getSystemConfiguration());
try {
monitor.run(hostname);
} finally {
DistributedTrace.disable();
}
}
use of org.apache.accumulo.server.ServerOpts in project accumulo by apache.
the class TabletServer method main.
public static void main(String[] args) throws IOException {
try {
final String app = "tserver";
ServerOpts opts = new ServerOpts();
opts.parseArgs(app, args);
SecurityUtil.serverLogin(SiteConfiguration.getInstance());
String hostname = opts.getAddress();
Instance instance = HdfsZooInstance.getInstance();
ServerConfigurationFactory conf = new ServerConfigurationFactory(instance);
VolumeManager fs = VolumeManagerImpl.get();
MetricsSystemHelper.configure(TabletServer.class.getSimpleName());
Accumulo.init(fs, instance, conf, app);
final TabletServer server = new TabletServer(instance, conf, fs);
server.config(hostname);
DistributedTrace.enable(hostname, app, conf.getSystemConfiguration());
if (UserGroupInformation.isSecurityEnabled()) {
UserGroupInformation loginUser = UserGroupInformation.getLoginUser();
loginUser.doAs(new PrivilegedExceptionAction<Void>() {
@Override
public Void run() {
server.run();
return null;
}
});
} else {
server.run();
}
} catch (Exception ex) {
log.error("Uncaught exception in TabletServer.main, exiting", ex);
System.exit(1);
} finally {
DistributedTrace.disable();
}
}
use of org.apache.accumulo.server.ServerOpts in project accumulo by apache.
the class TraceServer method main.
public static void main(String[] args) throws Exception {
final String app = "tracer";
ServerOpts opts = new ServerOpts();
opts.parseArgs(app, args);
loginTracer(SiteConfiguration.getInstance());
Instance instance = HdfsZooInstance.getInstance();
ServerConfigurationFactory conf = new ServerConfigurationFactory(instance);
VolumeManager fs = VolumeManagerImpl.get();
MetricsSystemHelper.configure(TraceServer.class.getSimpleName());
Accumulo.init(fs, instance, conf, app);
String hostname = opts.getAddress();
TraceServer server = new TraceServer(instance, conf, hostname);
try {
server.run();
} finally {
log.info("tracer stopping");
ZooReaderWriter.getInstance().getZooKeeper().close();
}
}
Aggregations