我已在具有此IP地址W.X.Y.Z的服务器上安装了elasticsearch
我能够跑步
./elasticsearch-6.3.2/bin/elasticsearch
elasticsearch服务可在localhost(远程服务器)上访问,但是我无法使用此地址http://W.X.Y.Z:9200/上的浏览器从本地计算机上访问它。
然后我尝试通过添加以下几行来更改elasticsearch-6.3.2 / config / elasticsearch.yml文件(请参阅所附的屏幕截图)
network.host: 0.0.0.0
http.port: 9200
目前,我无法运行
./elasticsearch-6.3.2/bin/elasticsearch
我通过添加更新了/etc/security/limits.conf文件
elasticsearch - nofile 65536
elasticsearch - nproc 4096
此命令ulimit -a仍显示此屏幕 enter image description here
而且总是无法运行./elasticsearch命令,我得到的结果
[2018-11-22T09:50:06,714][INFO ][o.e.n.Node ] [] initializing ...
[2018-11-22T09:50:06,866][INFO ][o.e.e.NodeEnvironment ] [b1qDVeW] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [14.2gb], net total_space [17.2gb], types [rootfs]
[2018-11-22T09:50:06,871][INFO ][o.e.e.NodeEnvironment ] [b1qDVeW] heap size [1015.6mb], compressed ordinary object pointers [true]
[2018-11-22T09:50:06,873][INFO ][o.e.n.Node ] [b1qDVeW] node name derived from node ID [b1qDVeW5RRWfC58mHtWaKQ]; set [node.name] to override
[2018-11-22T09:50:06,873][INFO ][o.e.n.Node ] [b1qDVeW] version[6.3.2], pid[15624], build[default/tar/053779d/2018-07-20T05:20:23.451332Z], OS[Linux/3.16.0-5-amd64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_191/25.191-b12]
[2018-11-22T09:50:06,875][INFO ][o.e.n.Node ] [b1qDVeW] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.Z9qppca6, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/home/developer/elasticsearch-6.3.2, -Des.path.conf=/home/developer/elasticsearch-6.3.2/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
[2018-11-22T09:50:12,367][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [aggs-matrix-stats]
[2018-11-22T09:50:12,373][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [analysis-common]
[2018-11-22T09:50:12,373][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [ingest-common]
[2018-11-22T09:50:12,374][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [lang-expression]
[2018-11-22T09:50:12,374][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [lang-mustache]
[2018-11-22T09:50:12,374][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [lang-painless]
[2018-11-22T09:50:12,375][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [mapper-extras]
[2018-11-22T09:50:12,375][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [parent-join]
[2018-11-22T09:50:12,375][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [percolator]
[2018-11-22T09:50:12,376][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [rank-eval]
[2018-11-22T09:50:12,376][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [reindex]
[2018-11-22T09:50:12,376][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [repository-url]
[2018-11-22T09:50:12,376][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [transport-netty4]
[2018-11-22T09:50:12,376][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [tribe]
[2018-11-22T09:50:12,377][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-core]
[2018-11-22T09:50:12,377][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-deprecation]
[2018-11-22T09:50:12,377][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-graph]
[2018-11-22T09:50:12,378][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-logstash]
[2018-11-22T09:50:12,378][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-ml]
[2018-11-22T09:50:12,378][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-monitoring]
[2018-11-22T09:50:12,378][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-rollup]
[2018-11-22T09:50:12,379][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-security]
[2018-11-22T09:50:12,379][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-sql]
[2018-11-22T09:50:12,379][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-upgrade]
[2018-11-22T09:50:12,380][INFO ][o.e.p.PluginsService ] [b1qDVeW] loaded module [x-pack-watcher]
[2018-11-22T09:50:12,380][INFO ][o.e.p.PluginsService ] [b1qDVeW] no plugins loaded
[2018-11-22T09:50:21,545][INFO ][o.e.x.s.a.s.FileRolesStore] [b1qDVeW] parsed [0] roles from file [/home/developer/elasticsearch-6.3.2/config/roles.yml]
[2018-11-22T09:50:22,679][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [controller/15672] [Main.cc@109] controller (64 bit): Version 6.3.2 (Build 903094f295d249) Copyright (c) 2018 Elasticsearch BV
[2018-11-22T09:50:23,497][DEBUG][o.e.a.ActionModule ] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2018-11-22T09:50:24,036][INFO ][o.e.d.DiscoveryModule ] [b1qDVeW] using discovery type [zen]
[2018-11-22T09:50:25,981][INFO ][o.e.n.Node ] [b1qDVeW] initialized
[2018-11-22T09:50:25,982][INFO ][o.e.n.Node ] [b1qDVeW] starting ...
[2018-11-22T09:50:26,351][INFO ][o.e.t.TransportService ] [b1qDVeW] publish_address {94.177.240.139:9300}, bound_addresses {[::]:9300}
[2018-11-22T09:50:26,407][INFO ][o.e.b.BootstrapChecks ] [b1qDVeW] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max number of threads [3903] for user [developer] is too low, increase to at least [4096]
[2018-11-22T09:50:26,445][INFO ][o.e.n.Node ] [b1qDVeW] stopping ...
[2018-11-22T09:50:26,483][INFO ][o.e.n.Node ] [b1qDVeW] stopped
[2018-11-22T09:50:26,484][INFO ][o.e.n.Node ] [b1qDVeW] closing ...
[2018-11-22T09:50:26,511][INFO ][o.e.n.Node ] [b1qDVeW] closed
[2018-11-22T09:50:26,521][INFO ][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started
答案 0 :(得分:1)
您的问题与网络地址无关,而与限制有关。
看看什么返回linux shell命令:
import pino, { Logger } from 'pino';
let logger: Logger;
switch (process.env.NODE_ENV) {
case 'development':
// @ts-ignore
logger = pino({ prettyPrint: { colorize: true } });
break;
case 'production':
const dest = pino.extreme(); // logs to stdout with no args
logger = pino(dest);
break;
default:
throw new Error('Logger must be initialized! Set up process.env.NODE_ENV');
}
// here is the code fo setting up the process with the logger
setInterval(() => logger && logger.flush(), 10000).unref();
export default logger;
看看值ulimit -a
和max user processes
,对于运行Elasticsearch来说太低了。临时使用ulimit命令提高它们:
virtual memory
或像这样永久修改它们:
> ulimit -u 4096
> ulimit -v 262144
(如此处说明:https://www.elastic.co/guide/en/elasticsearch/reference/master/vm-max-map-count.html)
并编辑/etc/security/limits.conf
sysctl -w vm.max_map_count=262144
(如此处说明:https://www.elastic.co/guide/en/elasticsearch/reference/master/setting-system-settings.html)