本文整理汇总了Java中org.elasticsearch.common.logging.ESLogger.info方法的典型用法代码示例。如果您正苦于以下问题:Java ESLogger.info方法的具体用法?Java ESLogger.info怎么用?Java ESLogger.info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.common.logging.ESLogger
的用法示例。
在下文中一共展示了ESLogger.info方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkUnsetAndMaybeExit
import org.elasticsearch.common.logging.ESLogger; //导入方法依赖的package包/类
private static void checkUnsetAndMaybeExit(String confFileSetting, String settingName) {
if (confFileSetting != null && confFileSetting.isEmpty() == false) {
ESLogger logger = Loggers.getLogger(Bootstrap.class);
logger.info("{} is no longer supported. crate.yml must be placed in the config directory and cannot be renamed.", settingName);
System.exit(1);
}
}
示例2: main
import org.elasticsearch.common.logging.ESLogger; //导入方法依赖的package包/类
public static void main(String[] args) {
System.setProperty("es.foreground", "yes");
String[] startArgs = new String[args.length + 1];
startArgs[0] = "start";
System.arraycopy(args, 0, startArgs, 1, args.length);
try {
BootstrapProxy.init(startArgs);
} catch (Throwable t) {
// format exceptions to the console in a special way
// to avoid 2MB stacktraces from guice, etc.
throw new StartupErrorProxy(t);
}
// start mysql server
Settings settings = BootstrapProxy.getSettings();
int maxConectNum = settings.getAsInt("mysql.max_connections", 1024);
int mysqlPort = settings.getAsInt("mysql.port", 8306);
ConnectScheduler scheduler = new ConnectScheduler(maxConectNum);
MysqlServer mysqlServer = new MysqlServer(mysqlPort, scheduler);
ESLogger logger = Loggers.getLogger(CrateF.class);
if (!mysqlServer.start()) {
logger.error("mysql server start failed");
System.exit(-1);
} else {
logger.info("mysql server start successful, max_connections: "
+ maxConectNum + " port: " + mysqlPort);
}
}
示例3: stop
import org.elasticsearch.common.logging.ESLogger; //导入方法依赖的package包/类
private Node stop() {
if (!lifecycle.moveToStopped()) {
return this;
}
ESLogger logger = Loggers.getLogger(Node.class, settings.get("name"));
logger.info("stopping ...");
injector.getInstance(TribeService.class).stop();
injector.getInstance(ResourceWatcherService.class).stop();
if (settings.getAsBoolean("http.enabled", true)) {
injector.getInstance(HttpServer.class).stop();
}
injector.getInstance(SnapshotsService.class).stop();
injector.getInstance(SnapshotShardsService.class).stop();
// stop any changes happening as a result of cluster state changes
injector.getInstance(IndicesClusterStateService.class).stop();
// we close indices first, so operations won't be allowed on it
injector.getInstance(IndexingMemoryController.class).stop();
injector.getInstance(IndicesTTLService.class).stop();
injector.getInstance(RoutingService.class).stop();
injector.getInstance(ClusterService.class).stop();
injector.getInstance(DiscoveryService.class).stop();
injector.getInstance(MonitorService.class).stop();
injector.getInstance(GatewayService.class).stop();
injector.getInstance(SearchService.class).stop();
injector.getInstance(RestController.class).stop();
injector.getInstance(TransportService.class).stop();
for (Class<? extends LifecycleComponent> plugin : pluginsService.nodeServices()) {
injector.getInstance(plugin).stop();
}
// we should stop this last since it waits for resources to get released
// if we had scroll searchers etc or recovery going on we wait for to finish.
injector.getInstance(IndicesService.class).stop();
logger.info("stopped");
return this;
}
示例4: checkUnsetAndMaybeExit
import org.elasticsearch.common.logging.ESLogger; //导入方法依赖的package包/类
private static void checkUnsetAndMaybeExit(String confFileSetting, String settingName) {
if (confFileSetting != null && confFileSetting.isEmpty() == false) {
ESLogger logger = Loggers.getLogger(Bootstrap.class);
logger.info("{} is no longer supported. elasticsearch.yml must be placed in the config directory and cannot be renamed.", settingName);
exit(1);
}
}
示例5: checkPermission
import org.elasticsearch.common.logging.ESLogger; //导入方法依赖的package包/类
public static boolean checkPermission(final HttpRequest request, final HttpChannel channel, ESAuthConfig config, ESLogger logger) {
/*
//config reload
if (request.paramAsBoolean("auth_reload", false)) {
config.reloadConfig();
logger.info("reload auth config");
}
*/
// 是否开启认证授权
boolean open_auth = config.getSet().getAsBoolean("open_auth", false);
if (!open_auth) {
return true;
}
String authStr = "";
if (request != null) {
authStr = Tool.base64Decode(request.param("auth", ""));
}
// logger.info("authStr:" + authStr);
String[] authArr = authStr.split(":");
if (authArr.length != 2) {
logger.info("Auth failed: invalid auth");
respForbidden(request, channel, logger);
return false;
}
String user_username = authArr[0].trim();
String config_username = config.getSet().get("username", "").trim();
String user_password = authArr[1].trim();
String config_password = config.getSet().get("password", "").trim();
// logger.info("user_username:" + user_username);
// logger.info("config_username:" + config_username);
// logger.info("user_password:" + user_password);
// logger.info("config_password:" + config_password);
if (!user_username.equals(config_username) || !user_password.equals(config_password)) {
logger.info("Auth failed: username[" + user_username + "] password[" + user_password + "]");
respForbidden(request, channel, logger);
return false;
}
return true;
}
示例6: checkIpPermission
import org.elasticsearch.common.logging.ESLogger; //导入方法依赖的package包/类
public static boolean checkIpPermission(final HttpRequest request, final HttpChannel channel, ESAuthConfig config, ESLogger logger) {
// 是否开启ip授权
boolean open_ip_auth = config.getSet().getAsBoolean("open_ip_auth", false);
if (!open_ip_auth) {
return true;
}
String[] ip_auth_list = config.getSet().getAsArray("ip_auth_list", new String[0]);
// logger.info("LocalAddr:" + request.getLocalAddress().toString());
// logger.info("RemoteAddr:" + request.getRemoteAddress().toString());
InetSocketAddress localAddr = (InetSocketAddress) request.getLocalAddress();
InetSocketAddress remoteAddr = (InetSocketAddress) request.getRemoteAddress();
boolean has_local = false;
boolean has_auth_ip = false;
for(String ip : ip_auth_list) {
if (ip.equals("local")
|| ip.equals("localhost")
|| ip.equals("127.0.0.1")) {
has_local = true;
}
if (ip.equals(remoteAddr.getHostName())) {
has_auth_ip = true;
}
logger.info("ip: " + ip + ", me: " + remoteAddr.getHostName() );
}
if (localAddr.getHostName().equals(remoteAddr.getHostName())) {
logger.info("Local Request");
if (!has_local) {
// respIpForbidden(request, channel, logger);
return true;
}
} else {
logger.info("Local:" + localAddr.getHostName());
logger.info("Remote:" + remoteAddr.getHostName());
if (!has_auth_ip) {
logger.info("Ip Auth failed: ip[" + remoteAddr.getHostName() + "]");
respIpForbidden(request, channel, logger);
return false;
}
}
return true;
}
示例7: CrateRestFilter
import org.elasticsearch.common.logging.ESLogger; //导入方法依赖的package包/类
@Inject
public CrateRestFilter(Settings settings) {
this.esApiEnabled = settings.getAsBoolean(ES_API_ENABLED_SETTING, true);
ESLogger logger = Loggers.getLogger(getClass().getPackage().getName(), settings);
logger.info("Elasticsearch HTTP REST API {}enabled", esApiEnabled ? "" : "not ");
}
示例8: start
import org.elasticsearch.common.logging.ESLogger; //导入方法依赖的package包/类
/**
* Start the node. If the node is already started, this method is no-op.
*/
public Node start() {
if (!lifecycle.moveToStarted()) {
return this;
}
ESLogger logger = Loggers.getLogger(Node.class, settings.get("name"));
logger.info("starting ...");
// hack around dependency injection problem (for now...)
injector.getInstance(Discovery.class).setRoutingService(injector.getInstance(RoutingService.class));
for (Class<? extends LifecycleComponent> plugin : pluginsService.nodeServices()) {
injector.getInstance(plugin).start();
}
injector.getInstance(MappingUpdatedAction.class).setClient(client);
injector.getInstance(IndicesService.class).start();
injector.getInstance(IndexingMemoryController.class).start();
injector.getInstance(IndicesClusterStateService.class).start();
injector.getInstance(IndicesTTLService.class).start();
injector.getInstance(SnapshotsService.class).start();
injector.getInstance(SnapshotShardsService.class).start();
injector.getInstance(RoutingService.class).start();
injector.getInstance(SearchService.class).start();
injector.getInstance(MonitorService.class).start();
injector.getInstance(RestController.class).start();
// TODO hack around circular dependencies problems
injector.getInstance(GatewayAllocator.class).setReallocation(injector.getInstance(ClusterService.class), injector.getInstance(RoutingService.class));
injector.getInstance(ResourceWatcherService.class).start();
injector.getInstance(GatewayService.class).start();
injector.getInstance(TenantManagementService.class).start();
// Start the transport service now so the publish address will be added to the local disco node in ClusterService
TransportService transportService = injector.getInstance(TransportService.class);
transportService.start();
injector.getInstance(ClusterService.class).start();
// start after cluster service so the local disco is known
DiscoveryService discoService = injector.getInstance(DiscoveryService.class).start();
transportService.acceptIncomingRequests();
discoService.joinClusterAndWaitForInitialState();
if (settings.getAsBoolean("http.enabled", true)) {
injector.getInstance(HttpServer.class).start();
}
injector.getInstance(TribeService.class).start();
if (settings.getAsBoolean("node.portsfile", false)) {
if (settings.getAsBoolean("http.enabled", true)) {
HttpServerTransport http = injector.getInstance(HttpServerTransport.class);
writePortsFile("http", http.boundAddress());
}
TransportService transport = injector.getInstance(TransportService.class);
writePortsFile("transport", transport.boundAddress());
}
logger.info("started");
return this;
}